http://stackoverflow.com/q/28654192
tagged with: iframe
has title: Open iframe links in new tab (Google AdSense)
type: Question
duplicate of: http://stackoverflow.com/q/28640410
tagged with: javascript
linked to: http://stackoverflow.com/q/28640410
score: 0
has comment: http://stackoverflow.com/comment/45605449
tagged with: jquery
has body: I know this is not allowed by google, and i can get my adsense acount banned but i will take the risks :D The scenario is: Google gives you a script to put in your page. &lt;script type="text/javascript"&gt; google_ad_client = "ca-pub-xxxxxxxxxxxx"; google_ad_slot = "xxxxxx"; google_ad_width = 300; google_ad_height = 250; &lt;/script&gt; &lt;script type="text/javascript" src="//pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt; When page loads it generates an add! Here is a link, so you can inspect the add: When the page loads, this script generates an iframe, we will call it iframe A Iframe A contains contains a html page with 2 iframes in it, we will call it iframe B and iframe C. So far we have an iframe that contains 2 iframes inside. The second iframe, iframe C, contains a link. All I want to do is "To open the link in new tab" :D I can do this by adding with javascript attribute target="_blank".. BUT i CANT select the link() with javascript because the iframe is from another site. For security reasons browsers dont let you to access the content of an iframe if is not from your site. I am loking for some sort of a hack... I was thinking if playing with events will help me ? Like catching the event of link click, than stop the event and than fire new event to open link in new tab. Or catch the leftclick event, stop event, fire right click event than, from the cotext menu select "open link in new tab" (all of this happens when user leftclick the link) Any suggestions are welcome, I need to look this problem from a different perspective...
has comment: http://stackoverflow.com/comment/45605357
has comment: http://stackoverflow.com/comment/45605382
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45605405
answer count: 0

http://stackoverflow.com/comment/45782831
has text: i recently did a code survey of all the cdn.js scripts. it found 144 uses of reduceRight compared to 654 uses of reduce. sadly, i threw away the data (took 2 hours to delete all the scripts on a fast box) or else i would find you specifics, but they should be out there if reduceRight is 1/4th as used...
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28607020
type: QuestionComment

http://stackoverflow.com/q/28708463
answer count: 2
accepted answer: http://stackoverflow.com/a/28708534
tagged with: javascript
tagged with: jquery
upvote count: 2
has answer: http://stackoverflow.com/a/28708534
possible better answer: http://stackoverflow.com/a/28708594
has body: I've checked out all the related questions I could find and still cannot get this to work so am reaching out to you lovely folk! I wish my site to have a random color background (one of multiple pre-selected colors) each time someone visits. There are various times people have asked for it to call up a random image but I just wish to have a block color, assuming using bold background. The two options I have seen used in similar ways, but to no avail, are: jQuery (link: taken from a Tumblr query): 1) Creating a new 'background.js' file in /js/ with the code: &lt;script&gt; var bgcolorlist=new Array("background: #ff871b", "background: #15efa1", "background: #51ddff", "background: #ff1b6c", "background: #000000"); var color = bgcolorlist[Math.floor(Math.random()*bgcolorlist.length)]; $('body').css('backgroundColor', color); &lt;/script&gt; 2) Adding to function.php: add_action( 'wp_enqueue_scripts', 'add_my_script' ); function add_my_script() { wp_enqueue_script( 'your-script', // name your script so that you can attach other scripts and de-register, etc. get_template_directory_uri() . '/js/your-script.js', // this is the location of your script file array('jquery') // this array lists the scripts upon which your script depends ); } &amp; PHP and CSS (link): I put this whole string in the style.css file: &lt;?php $input = array("#000080", "#00CED1", "#191970"); $rand_keys = array_rand($input, 2); echo $input[$rand_keys[0]] . "\n"; echo $input[$rand_keys[1]] . "\n"; ?&gt; body { background: &lt;?php echo $color; ?&gt;; } Unfortunately neither of these solutions seem to work for me and both threads are outdated so cannot get further answers hence starting a new thread. Any ideas for where I might be going wrong for either? Any other ways around this you think would be a better way to solve the problem? Further info: I'm using the super simple Less theme, which only comes with 3 files: functions.php, index.php and style.css - which I'm using as a bare bones theme to compl…
favorite count: 0
tagged with: php
tagged with: css
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: wordpress
has answer: http://stackoverflow.com/a/28708594
has title: Create a random background color in Wordpress
type: Question
linked to: http://stackoverflow.com/q/13530556
linked to: http://stackoverflow.com/q/18116470

http://stackoverflow.com/comment/45625265
has text: @Bergi it was just a requirement that was a part of the problem
comment on: http://stackoverflow.com/q/28664865
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45524255
type: QuestionComment
type: Comment
has text: You can of course not make _anything_ “go straight to the download folder”, that would be a huge security issue. The most you can do is trigger a download dialog, so that user can decide whether to save the offered resource and where.
comment on: http://stackoverflow.com/q/28610100
score: 0

http://stackoverflow.com/a/28673580
score: 1
answers question: http://stackoverflow.com/q/28669127
upvote count: 1
has body: Filtered selector that calls .remove only once Since there're other span elements within TR that are unrelated to the problem it's not possible to write a pure CSS filter selector string (so we could either use .has) to sufficiently filter elements. but instead of removing each table row individually we filter them first and remove them all at once. $("tr.project-description").filter(function() { return !$("span.verfied-badge", this).length; }).remove();
downvote count: 0
type: Answer

http://stackoverflow.com/tag/html
tags question: http://stackoverflow.com/q/28749104
tags question: http://stackoverflow.com/q/28654349
tags question: http://stackoverflow.com/q/28683394
tags question: http://stackoverflow.com/q/28691766
tags question: http://stackoverflow.com/q/28725622
tags question: http://stackoverflow.com/q/28616527
tags question: http://stackoverflow.com/q/28607323
tags question: http://stackoverflow.com/q/28689680
tags question: http://stackoverflow.com/q/28654228
tags question: http://stackoverflow.com/q/28747903
tags question: http://stackoverflow.com/q/28604112
tags question: http://stackoverflow.com/q/28723568
tags question: http://stackoverflow.com/q/28641695
tags question: http://stackoverflow.com/q/28746908
tags question: http://stackoverflow.com/q/28676899
tags question: http://stackoverflow.com/q/28629014
tags question: http://stackoverflow.com/q/28688557
tags question: http://stackoverflow.com/q/28703946
tags question: http://stackoverflow.com/q/28647369
tags question: http://stackoverflow.com/q/28702877
tags question: http://stackoverflow.com/q/28602712
tags question: http://stackoverflow.com/q/28708327
tags question: http://stackoverflow.com/q/28706520
tags question: http://stackoverflow.com/q/28671867
tags question: http://stackoverflow.com/q/28718657
tags question: http://stackoverflow.com/q/28728810
tags question: http://stackoverflow.com/q/28623304
tags question: http://stackoverflow.com/q/28736512
tags question: http://stackoverflow.com/q/28748410
tags question: http://stackoverflow.com/q/28679737
tags question: http://stackoverflow.com/q/28669877
tags question: http://stackoverflow.com/q/28686332
tags question: http://stackoverflow.com/q/28744267
tags question: http://stackoverflow.com/q/28624092
tags question: http://stackoverflow.com/q/28667070
tags question: http://stackoverflow.com/q/28619300
tags question: http://stackoverflow.com/q/28612960
tags question: http://stackoverflow.com/q/28643851
tags question: http://stackoverflow.com/q/28633697
tags question: http://stackoverflow.com/q/28730048
tags question: http://stackoverflow.com/q/28611376
tags question: http://stackoverflow.com/q/28738881
tags question: http://stackoverflow.com/q/28650417
tags question: http://stackoverflow.com/q/28614719
tags question: http://stackoverflow.com/q/28719322
tags question: http://stackoverflow.com/q/28614760
tags question: http://stackoverflow.com/q/28697240
tags question: http://stackoverflow.com/q/28635103
tags question: http://stackoverflow.com/q/28721281
tags question: http://stackoverflow.com/q/28728921
tags question: http://stackoverflow.com/q/28697270
tags question: http://stackoverflow.com/q/28710116
tags question: http://stackoverflow.com/q/28649041
tags question: http://stackoverflow.com/q/28746979
tags question: http://stackoverflow.com/q/28610100
tags question: http://stackoverflow.com/q/28664379
tags question: http://stackoverflow.com/q/28622701
tags question: http://stackoverflow.com/q/28671205
tags question: http://stackoverflow.com/q/28729122
tags question: http://stackoverflow.com/q/28658746
tags question: http://stackoverflow.com/q/28742303
tags question: http://stackoverflow.com/q/28610143
tags question: http://stackoverflow.com/q/28682375
tags question: http://stackoverflow.com/q/28599769
tags question: http://stackoverflow.com/q/28649851
tags question: http://stackoverflow.com/q/28705925
tags question: http://stackoverflow.com/q/28683919
tags question: http://stackoverflow.com/q/28736735
tags question: http://stackoverflow.com/q/28636262
tags question: http://stackoverflow.com/q/28729950
tags question: http://stackoverflow.com/q/28724391
tags question: http://stackoverflow.com/q/28673220
tags question: http://stackoverflow.com/q/28737720
tags question: http://stackoverflow.com/q/28616955
tags question: http://stackoverflow.com/q/28700754
tags question: http://stackoverflow.com/q/28715723
tags question: http://stackoverflow.com/q/28668581
tags question: http://stackoverflow.com/q/28721012
tags question: http://stackoverflow.com/q/28658927
tags question: http://stackoverflow.com/q/28631374

http://stackoverflow.com/a/28801101
type: AcceptedAnswer
type: Answer
has body: This was not possible. I added to code to create this feature and posted to Git. New capability is now available in plugin
answers question: http://stackoverflow.com/q/28675130
has comment: http://stackoverflow.com/comment/78550375
accepted answer of: http://stackoverflow.com/q/28675130
score: 0

http://stackoverflow.com/comment/45502097
comment on: http://stackoverflow.com/q/28597583
score: 0
type: Comment
type: QuestionComment
has text: I don't know where the parent page is, but it's pretty simple - it's all client-side, no backend required. The w3schools example is the entire source. The drawback is that it won't work if the user doesn't have a mail client installed...

http://stackoverflow.com/comment/45739472
type: AnswerComment
type: Comment
has text: But i dont know how to pass a data inside the ng-model which is `qgrade.score`. my goal is to place an existing grade which was saved in my database then put it in the input text.
comment on: http://stackoverflow.com/a/28726273
score: 0

http://stackoverflow.com/q/28683910
has body: I am working on a node.js application which generates a html page. This html page displays a list of associates built according to the data passed onto this page. A list is built something like as follows: //loop for all assocaite id's passed to this page <li class="testClass" data-associateid="<%= assocID %>"> ClickMe! The generated html src looks something like this: I am trying to get the value of the data attribute using Jquery & I tried the following: $(".btnClass").click(function(){ console.log($".testClass").attr("data-associateid")); }); But this outputs'AA01'everytime i click on the btn and I am not getting the expected output in the console: AA01 AA02 AA03 I tried the following also but it gives me undefined: $(".btnClass").click(function(){ console.log($(this).find(".testClass").attr("data-associateid")); });
has answer: http://stackoverflow.com/a/28684220
downvote count: 0
tagged with: javascript
answer count: 6
tagged with: jquery
has answer: http://stackoverflow.com/a/28684173
favorite count: 0
has comment: http://stackoverflow.com/comment/45660971
tagged with: http://stackoverflow.com/tag/html
tagged with: node.js
upvote count: 3
has title: How to get the value of data attribute using jquery
has comment: http://stackoverflow.com/comment/45660736
possible better answer: http://stackoverflow.com/a/28684173
has answer: http://stackoverflow.com/a/28685236
accepted answer: http://stackoverflow.com/a/28684408
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/28684398
has comment: http://stackoverflow.com/comment/45660615
has comment: http://stackoverflow.com/comment/45662057
has comment: http://stackoverflow.com/comment/45661058
tagged with: dom
has answer: http://stackoverflow.com/a/28684184
type: Question
has answer: http://stackoverflow.com/a/28684408

http://stackoverflow.com/comment/45517261
comment on: http://stackoverflow.com/q/28606222
score: 0
type: Comment
type: QuestionComment
has text: @dfsq but where to put controllers `$scope.isAuthUser = false;` ?

http://stackoverflow.com/comment/45512822
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28603940
has text: And when do you want it to execute ?
score: 0

http://stackoverflow.com/comment/45994496
type: Comment
comment on: http://stackoverflow.com/a/28674950
score: 0
type: AnswerComment
has text: "This closure would not be collected until you delete the global variable, so it's true that the other approach avoids 1 reference to be "leaked"." --- this is simply wrong. An object that `something` holds a reference to will be marked as a garbage as soon as the interpreter goes out of this anonymous function scope.

http://stackoverflow.com/comment/45613675
type: QuestionComment
comment on: http://stackoverflow.com/q/28658522
score: 0
has text: It is producing a list between the start and end numbers and with the step given.
type: Comment

http://stackoverflow.com/q/28595079
answer count: 0
has comment: http://stackoverflow.com/comment/45496884
has body: $("#html").load('edit.html #html'); I want to reload the changed html content of the same page without refreshing thats the complete code below: Titel Crea tu post Seleccionar Imágen Imágen Seleccionada Reset file Publicar send Hecha un vistazo Ajustes Conexión automática Quitar fondo Guardar Crear un post Ver posts Eliminar posts Actualizaciones Extensiones Ajustes
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45497499
score: 0
type: Question
has title: Why this code below shows only white without the new content?
has comment: http://stackoverflow.com/comment/45498284
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45497418
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45771933
comment on: http://stackoverflow.com/a/28743350
score: 0
type: AnswerComment
type: Comment
has text: Well, if you would have seen the fiddle, that i have shared, it already considers the approach you have told..But anyways, Thanks for your time.. :)

http://stackoverflow.com/q/28711730
tagged with: javascript
has title: Photoshop document loses focus when dialog window is closed
tagged with: scripting
tagged with: photoshop
answer count: 0
score: 0
type: UnansweredQuestion
tagged with: extendscript
has comment: http://stackoverflow.com/comment/45775560
has body: After adding a new document to Photoshop via a dialog window the document loses focus. I have already tried bringToFront() and app.refresh(). The document is active until the dialog closes. Output of app.activeDocument is correct, but the document isn't active. win = new Window('dialog'); win.btnAdd = win.add('button'); win.btnAdd.text = 'Add new document'; win.btnAdd.onClick = function() { win.close(); app.documents.add('8 in', '10 in', 300, '8x10'); }; win.center(); win.show();
type: Question
has comment: http://stackoverflow.com/comment/46010570

http://stackoverflow.com/a/28644073
downvote count: 0
has body: You want to use .slide:hover as you suggested for the open hand. Then for the closed hand on click .slide:active. See this JsFiddle. .slide:hover { cursor: url('https://maps.gstatic.com/mapfiles/openhand_8_8.cur'), auto; } .slide:active { cursor: url('https://maps.gstatic.com/mapfiles/closedhand_8_8.cur'), auto; }
answers question: http://stackoverflow.com/q/28644033
type: AcceptedAnswer
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/28644033

http://stackoverflow.com/q/28652922
answer count: 0
type: UnansweredQuestion
downvote count: 1
type: Question
tagged with: numbers
duplicate of: http://stackoverflow.com/q/6505033
score: 0
has comment: http://stackoverflow.com/comment/45603207
has comment: http://stackoverflow.com/comment/45603413
has body: If you run this code you get 599052. It does this for any number this length until it contains an 8 or 9 generally. Also if the starting number is not a 0 it will work. This really stumped me and I scoured the web to no avail. I'm hoping someone here has some insight into what is going on here. var addd = function (num) { return num; }; addd(02222014);
upvote count: 1
tagged with: function
has comment: http://stackoverflow.com/comment/45603096
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/6505033
has comment: http://stackoverflow.com/comment/45602965
has title: Weird javascript number behavior
has comment: http://stackoverflow.com/comment/45602910

image
tags question: http://stackoverflow.com/q/28674516
tags question: http://stackoverflow.com/q/28602162
tags question: http://stackoverflow.com/q/28614500
tags question: http://stackoverflow.com/q/28687939
tags question: http://stackoverflow.com/q/28711794
tags question: http://stackoverflow.com/q/28731567
tags question: http://stackoverflow.com/q/28707294
tags question: http://stackoverflow.com/q/28732214
tags question: http://stackoverflow.com/q/28704727
tags question: http://stackoverflow.com/q/28692695
tags question: http://stackoverflow.com/q/28656434
tags question: http://stackoverflow.com/q/28682903
tags question: http://stackoverflow.com/q/28599476
tags question: http://stackoverflow.com/q/28721631
tags question: http://stackoverflow.com/q/28633094
tags question: http://stackoverflow.com/q/28659678
tags question: http://stackoverflow.com/q/28684457
tags question: http://stackoverflow.com/q/28657256
tags question: http://stackoverflow.com/q/28668025
tags question: http://stackoverflow.com/q/28738426
tags question: http://stackoverflow.com/q/28681738
tags question: http://stackoverflow.com/q/28683638
tags question: http://stackoverflow.com/q/28676608
tags question: http://stackoverflow.com/q/28678219
tags question: http://stackoverflow.com/q/28666563
tags question: http://stackoverflow.com/q/28625780
tags question: http://stackoverflow.com/q/28712378
tag name: image
tags question: http://stackoverflow.com/q/28705989
tags question: http://stackoverflow.com/q/28637780
tags question: http://stackoverflow.com/q/28616704
tags question: http://stackoverflow.com/q/28747294
tags question: http://stackoverflow.com/q/28680547
tags question: http://stackoverflow.com/q/28624129
type: Tag
tags question: http://stackoverflow.com/q/28653810
tags question: http://stackoverflow.com/q/28652567

http://stackoverflow.com/comment/45716810
has text: Use mediaquery and change font-size for different resolution.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28714544

http://stackoverflow.com/q/28694132
has title: How to store form data in an ajax variable?
tagged with: jquery
favorite count: 0
tagged with: ajax
upvote count: 2
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/45679924
has comment: http://stackoverflow.com/comment/45679380
has comment: http://stackoverflow.com/comment/45679245
has comment: http://stackoverflow.com/comment/45679872
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45679494
has comment: http://stackoverflow.com/comment/45679304
has comment: http://stackoverflow.com/comment/45679334
has answer: http://stackoverflow.com/a/28694370
type: Question
has comment: http://stackoverflow.com/comment/45679735
accepted answer: http://stackoverflow.com/a/28694370
has answer: http://stackoverflow.com/a/28694412
tagged with: javascript
has comment: http://stackoverflow.com/comment/45679102
has comment: http://stackoverflow.com/comment/45679337
has comment: http://stackoverflow.com/comment/45679832
answer count: 3
possible better answer: http://stackoverflow.com/a/28694425
score: 2
has body: I have a form with one text field. This form is submitted using ajax. While submitting, I want to save the data in the textfield in one of ajax variables too. Below is my code. But that didn't work well. If I insert the data "test7", then the $data variable will contain the below textinput=&textarea=&customName=test7 How can I correctly get the data inside the textbox to an ajax variable? For more information, my application is designed using bootstrap.
has comment: http://stackoverflow.com/comment/45679178
downvote count: 0
has answer: http://stackoverflow.com/a/28694425

http://stackoverflow.com/q/28719797
has comment: http://stackoverflow.com/comment/45734259
type: Question
tagged with: object
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/45728175
accepted answer: http://stackoverflow.com/a/28720079
has comment: http://stackoverflow.com/comment/45734335
answer count: 1
has comment: http://stackoverflow.com/comment/45726676
has title: How to push Json Array Dynamically within Json object
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28720079
has comment: http://stackoverflow.com/comment/45755869
has body: $('#form1').submit(function(e) { e.preventDefault(); dataLayer = []; dataLayer.push({ 'event': 'pre-addToCart', 'ecommerce': { 'currencyCode': 'EUR', 'add': { 'products': [] // I need to insert the products data here directly instead of pushing it } } }); Here is the manipulation I'm doing after the object has been created. I want this to be done directly within the object. Any thoughts? var length = $(".booking-ticket-table tbody tr").length; for (var i = 0; i &lt;= length; i++) { var prod_sku = $(".booking-ticket-table td.alpha")[i].textContent.trim().split(/\s/).join(''); var prod_name = $(".booking-ticket-table td.alpha")[i].textContent.trim(); //Prod name var prod_price = $(".booking-ticket-table td.omega")[i].textContent.trim().replace('£',''); //Prod Price var prod_qty = $(".booking-ticket-table td:nth-of-type(2) input")[i].getAttribute("value"); //Prod Qty dataLayer[0].ecommerce.add.products.push({ "id":"1232", "sku":prod_sku, "name": prod_name, "price": prod_price, "quantity": prod_qty }); } });

http://stackoverflow.com/comment/46182114
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28802164
has text: Yup, I had an http call on that one and not a socket call, my bad, adjusted it to the socket request and all is working as expected, always one that gets missed. :)
type: AnswerComment

http://stackoverflow.com/q/28733573
has body: I'm having problems trying to dynamically generate an HTML table based on input (column/row) values. When I hardcode the values in the loop below (i.e. instead of using the prompt), it creates the correct number of cells. However, when using x.length within the loop, something isn't working correctly. works correctly: function createTable() { // declare variables var body = document.body, table = document.createElement('table'); // Begin creating table // for each row for(var r = 0; r &lt; 8; r++) { // create row var tr = table.insertRow(); // for each column for(var c = 0; c &lt; 8; c++) { // create column var td = tr.insertCell(); td.appendChild(document.createTextNode('Cell')); } } // append table to body body.appendChild(table); } createTable(); does not create correct cells based on variable input function createTable() { // declare variables var body = document.body, table = document.createElement('table'), rows = prompt("enter rows"), columns = prompt("enter columns"); // Begin creating table // for each row for(var r = 0; r &lt; rows.length; r++) { // create row var tr = table.insertRow(); // for each column for(var c = 0; c &lt; columns.length; c++) { // create column var td = tr.insertCell(); td.appendChild(document.createTextNode('Cell')); } } // append table to body body.appendChild(table); } createTable();
type: Question
score: 0
has title: Problems using x.length within for loop
answer count: 2
has answer: http://stackoverflow.com/a/28733933
tagged with: for-loop
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28733584

http://stackoverflow.com/q/28740949
linked to: http://stackoverflow.com/q/18755750
tagged with: xmlhttprequest
linked to: http://stackoverflow.com/q/27463901
answer count: 4
has answer: http://stackoverflow.com/a/30468151
has comment: http://stackoverflow.com/comment/45795378
type: Question
has comment: http://stackoverflow.com/comment/45765344
score: 8
tagged with: internet-explorer
has answer: http://stackoverflow.com/a/34616830
has comment: http://stackoverflow.com/comment/45765263
has comment: http://stackoverflow.com/comment/45774343
tagged with: javascript
has answer: http://stackoverflow.com/a/43938453
has comment: http://stackoverflow.com/comment/45768883
has comment: http://stackoverflow.com/comment/45813398
tagged with: cors
downvote count: 0
has answer: http://stackoverflow.com/a/42969313
has body: Every development pipeline has 2 parts. FIRST to work hard and develop the application. SECOND to work harder and make it compatible with the great arrogant IE. We have an AngularJS (v1.3.13) application without any server side code developed in Webstorm. We are making REST calls to service. Our application works fine on Chrome and Firefox without any Console errors. However when we try to open the page in IE11 or IE9 (not tried IE10), our page doesn't load. Console suggests we have 2 errors. One of them is Access is Denied on xhr.open(method, url, true); in angular.js. There are number of posts on internet and none seems to be working. This is what I have tried. Hosting app in IIS with changed Handler Mappings to support Cross Domain calls on an Application pool of .Net v4.0 (as suggested by a Senior) Tried to disable to cache for HTTP requests. Adding Domain in trusted site category and also adding locahost/IP to local intranet. Changing request type to JSONP and trying to add Access-Control-Allow-Origin (with value of *) to headers. Changing IE settings to allow Cross Domain calls. Error is still chasing us. Even my colleagues have tried the same on their machines ending up with similar blow. Is there anyone to suggest me something on this. It may be CORS and I may need to go for xdr (XDomainRequest) but not sure how to use it as error is in angular.js. I am certainly no expert on this so please suggest. Screen shot of the error: IE shows another error: [$injector:nomod] Module 'ngLocale' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.2.16/$injector/nomod?p0=ngLocale which I am ignoring for now. Please suggest me something on this. Thanks.
favorite count: 0
has comment: http://stackoverflow.com/comment/73031352
tagged with: angularjs
upvote count: 8
has title: Access is Denied on IE11 in AngularJS
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45794819

http://stackoverflow.com/a/28637900
score: 2
accepted answer of: http://stackoverflow.com/q/28637780
has body: Have you tried formatting your image location using a relative link where the @ symbol precedes the image location. Your code and explanation also doesn't explain are they uploading the image from their machine in a location like My Documents or if they are uploading the image strictly from and http link. To upload from a local machine using Javascript and HTML, you might checkout this code. Your question is one that regularly comes up when writing custom Javascript functions. &lt;script type='text/javascript'&gt; function main() { var inputFileToLoad = document.createElement("input"); inputFileToLoad.type = "file"; inputFileToLoad.id = "inputFileToLoad"; document.body.appendChild(inputFileToLoad); var buttonLoadFile = document.createElement("button"); buttonLoadFile.onclick = loadImageFileAsURL; buttonLoadFile.textContent = "Load Selected File"; document.body.appendChild(buttonLoadFile); } function loadImageFileAsURL() { var filesSelected = document.getElementById("inputFileToLoad").files; if (filesSelected.length &gt; 0) { var fileToLoad = filesSelected[0]; if (fileToLoad.type.match("image.*")) { var fileReader = new FileReader(); fileReader.onload = function(fileLoadedEvent) { var imageLoaded = document.createElement("img"); imageLoaded.src = fileLoadedEvent.target.result; document.body.appendChild(imageLoaded); }; fileReader.readAsDataURL(fileToLoad); } } } main(); &lt;/script&gt; You can check out the full article on this issue of image uploads using Javascript and HTML 5 here: https://thiscouldbebetter.wordpress.com/2012/12/20/uploading-and-displaying-an-image-from-a-file-using-html5-and-javascript/
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28637780
has comment: http://stackoverflow.com/comment/45582045
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/45655978

http://stackoverflow.com/a/28824507
has comment: http://stackoverflow.com/comment/46011673
type: Answer
has comment: http://stackoverflow.com/comment/45928471
has comment: http://stackoverflow.com/comment/46005283
has comment: http://stackoverflow.com/comment/45927310
has comment: http://stackoverflow.com/comment/46015794
has body: We have a Custom report in IFRAME at our dashboard and we have to apply some CSS Styles on that report. With following lines of code, i was able to get to the report and apply styles. var ContentIframe = window.top.document.getElementById('contentIFrame0'); if(ContentIframe!=null) { var DashboardIframe=ContentIframe.contentDocument.frames["dashboardFrame"] if(DashboardIframe!=null) { //DashboardIframe.document.frames["IFRAME_SalesTrend"].document.getElementById("compatibilityNotification").style.display = "none"; We have Activities View on dashoboard, I can get and refresh it like below. DashboardIframe.document.getElementById("Activities").control.refresh(); } It works and you can also test it in the developer tools Console. It is able to find that element.
score: 0
answers question: http://stackoverflow.com/q/28716176

http://stackoverflow.com/comment/74329643
type: AnswerComment
score: 0
type: Comment
has text: Just reading this answer. Thanks for linking to that awesome post and your answer.
comment on: http://stackoverflow.com/a/39648853

http://stackoverflow.com/a/28725988
accepted answer of: http://stackoverflow.com/q/28723176
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has body: You're not returning the token in jwtInterceptorProvider.tokenGetter. From the docs jwtInterceptorProvider.tokenGetter = function(store, $http, jwtHelper) { var idToken = store.get('token'); var refreshToken = store.get('refreshToken'); if (jwtHelper.isTokenExpired(idToken)) { return auth.refreshIdToken(refreshToken); } else { return idToken; } }
type: Answer
answers question: http://stackoverflow.com/q/28723176

http://stackoverflow.com/q/28696910
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28698695
has comment: http://stackoverflow.com/comment/45685083
has comment: http://stackoverflow.com/comment/45685751
tagged with: javascript
tagged with: google-maps-api-3
tagged with: google-maps
has comment: http://stackoverflow.com/comment/45684970
answer count: 1
has comment: http://stackoverflow.com/comment/45687380
favorite count: 0
tagged with: geometry
has body: I have a very simple application (only one page) on which user draw polygons on the map and it also get lat, long, centre and radius of the circle that user drew. I would like to limit user to draw only one circle as a source (Which I did and works fine), and then let him/her to select one or more destinations on the map. So, the first circle could be "source" and the next circles are "destinations".. My question: how can I assign different variables to these circles in order to differentiate source place from destinations? Here is my code (I used google api, Drawing library: https://developers.google.com/maps/documentation/javascript/examples/drawing-tools): &lt;script type="text/javascript"&gt; (function () { var circle; function initialize() { var mapOptions = { center: new google.maps.LatLng(-34.397, 150.644), zoom: 8 }; var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var drawingManager = new google.maps.drawing.DrawingManager({ drawingMode: google.maps.drawing.OverlayType.MARKER, drawingControl: true, drawingControlOptions: { position: google.maps.ControlPosition.TOP_CENTER, drawingModes: [ google.maps.drawing.OverlayType.MARKER, google.maps.drawing.OverlayType.CIRCLE, google.maps.drawing.OverlayType.POLYGON, google.maps.drawing.OverlayType.POLYLINE, google.maps.drawing.OverlayType.RECTANGLE ] }, markerOptions: { icon: 'images/beachflag.png' }, circleOptions: { fillColor: '#ffff00', fillOpacity: 1, strokeWeight: 5, clickable: false, editable: true, zIndex: 1 } }); drawingManager.setMap(map); google.maps.event.addListener(drawingManager, 'circlecomplete', onCircleComplete); } function onCircleComplete(shape) { if (shape == null || (!(shape instanceof google.maps.Circle))) return; if (circle != null) { circle.setMap(null); circle = null; } circle = shape; var radius = circle.getRadius(); center = circle.getCenter(); var latitude = circle.getCenter().lat(); var longitude = circle.getCenter().lng(); } google.maps.event.addDomListen…
has title: let user draw only one circle as source but some circles for destination
accepted answer: http://stackoverflow.com/a/28698695
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45685702
upvote count: 2
score: 1

http://stackoverflow.com/comment/45712536
type: Comment
type: QuestionComment
has text: try this $(this).parent("td").parent("tr").remove();
score: 0
comment on: http://stackoverflow.com/q/28712259

http://stackoverflow.com/comment/45506290
type: Comment
type: QuestionComment
has text: If this will help , im using latest firefox , and i cant see the login span .
score: 0
comment on: http://stackoverflow.com/q/28600097

http://stackoverflow.com/comment/45632448
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28669127
has text: Next time be careful about stating correct languages especially in title, because **Java ≠ Javascript** in any way shape or form. Unless you're doing a string matching of *Java* in string *Javascript*. In that case you'll get a match. ;)

http://stackoverflow.com/a/28729342
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28729248
has comment: http://stackoverflow.com/comment/45745349
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/45745208
has body: By looking at your code it seems that you didn't handle the case of undefined, while your teamDetails.name can be undefined undefined until it fetch data from service. Because when you trying to fetch data form service through ajax, your input variable is undefined, when filter code tries to apply .replace method on undefined object, it will never work ( .replace() only works on string) Checking if your teamDetails.name object is defined or not is good idea, because filter runs on every digest cycle. Filter .filter('cleanteam', function () { return function (input) { return angular.isDefined(input) &amp;&amp; input != null ? //better error handling input.replace('AFC', '').replace('FC', ''):''; } }); Hope this could help you, Thanks.
has comment: http://stackoverflow.com/comment/45745239
accepted answer of: http://stackoverflow.com/q/28729248

http://stackoverflow.com/a/28674872
type: Answer
has comment: http://stackoverflow.com/comment/45643000
downvote count: 0
score: 1
has body: Use detach(). old.before( new ).detach() is the equivalent to replaceWith() ;)
answers question: http://stackoverflow.com/q/28674204
upvote count: 1

http://stackoverflow.com/q/28593453
tagged with: grid
has answer: http://stackoverflow.com/a/28593753
has answer: http://stackoverflow.com/a/37466293
type: Question
score: 3
accepted answer: http://stackoverflow.com/a/28593753
tagged with: javascript
has title: Creating Grid on the fly with jquery
downvote count: 0
tagged with: jquery
favorite count: 0
has body: I'm new to frontend and I'm trying to practice doing this simple task: I have to create a grid on the fly that is n * n (n being inputed by the user). I succesfully created a fix sized grid, but my problem is when trying to do this dynamically. This is the code I wrote for a 3*3 grid: http://jsfiddle.net/y7c2h8yk/ For trying to create it dynamically I wrote the following function: var setGridDimensions = function(n) { // emptying current grid $(".row").empty(); var $grid = $("#grid"); for (var i = 0; i &lt; n; i++) { // adding row $grid.append('&lt;div class="row"&gt;'); // adding each to element to row **var $row = $(".row")[i];** for (var j = 0; j &lt; n; j++) { $row.append('&lt;div class="col"&gt;&lt;/div&gt;'); } } }; Now, I understand there is a problem with line var $row = $(".row")[i]. What I need is inside the loop first create the row, then select the row created and then loop again and create each column. How can i do that ? Any help would be really appreciated. Thanks.
has answer: http://stackoverflow.com/a/28594111
has answer: http://stackoverflow.com/a/28593559
answer count: 4
type: AnsweredQuestion
tagged with: frontend
upvote count: 3
possible better answer: http://stackoverflow.com/a/28593559

http://stackoverflow.com/q/28659922
has answer: http://stackoverflow.com/a/28659996
score: 1
duplicate of: http://stackoverflow.com/q/901115
tagged with: youtube
type: AnsweredQuestion
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28660004
type: Question
has comment: http://stackoverflow.com/comment/45615805
answer count: 2
downvote count: 2
linked to: http://stackoverflow.com/q/901115
favorite count: 0
accepted answer: http://stackoverflow.com/a/28659996
has title: REGEX How to get start time of youtube URL in Javascript
upvote count: 3
has body: I have the following regex that I'm using in Javascript: /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&amp;v=)([^#\&amp;\?]*).*/ It gets me the video ID correctly. I want to expand it to extract start time of videos: I know there are at least two formats (if not more): "t=" and "start=" http://youtu.be/xxxxxxxx?t=30s https://www.youtube.com/watch?v=xxxxxxxx&amp;start=30 thanks,
has answer: http://stackoverflow.com/a/28660004
tagged with: regex

http://stackoverflow.com/comment/45659603
score: 0
comment on: http://stackoverflow.com/q/28682265
type: QuestionComment
has text: similar: http://stackoverflow.com/questions/28087624/how-to-save-1-million-records-to-mongodb-asyncronously
type: Comment

http://stackoverflow.com/comment/55796801
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28709165
type: Comment
has text: Your link to experimental transformers is broken.

http://stackoverflow.com/a/28605250
has body: Try This:- var c = "10"; function show(a, b){ c = a+b; alert(c); console.log(c); document.getElementById("demo").innerHTML = c; } window.onload = function () { document.getElementById("demo").innerHTML = c; }; This example calls a function which performs a calculation, and returns the result:
type: Answer
upvote count: 0
score: -1
downvote count: 1
answers question: http://stackoverflow.com/q/28604915

http://stackoverflow.com/comment/45758039
type: AnswerComment
has text: I need to use only JS. Thanks
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28736965

http://stackoverflow.com/comment/45605374
type: QuestionComment
has text: where is your worker class?
score: 0
comment on: http://stackoverflow.com/q/28654203
type: Comment

http://stackoverflow.com/comment/45602640
type: Comment
has text: You were correct with the realization that the code was working fine - the problem was that while socket.io existed as a node module, it wasnt installed.
comment on: http://stackoverflow.com/a/28651662
type: AnswerComment
score: 0

http://stackoverflow.com/a/28727851
score: 1
has comment: http://stackoverflow.com/comment/45759760
has comment: http://stackoverflow.com/comment/45745858
upvote count: 1
has comment: http://stackoverflow.com/comment/45743275
type: Answer
answers question: http://stackoverflow.com/q/28727620
downvote count: 0
has body: Like @charlietfl, I'm also curious why you use an &lt;object&gt; tag. But the general approach I'd recommend would be for page-1 to send page-2 a query parameter (e.g. "path/page2.html?disableCheck=true"). Then you can check for this in page-2 like so: &lt;script&gt; if (location.search.indexOf("disableCheck")) { $("#mydiv").hide(); } &lt;/script&gt; This query-param approach could obviously be faked, but I suspect that's not a major concern.

ammo.js
type: Tag
tag name: ammo.js
tags question: http://stackoverflow.com/q/28616283

http://stackoverflow.com/comment/45639211
comment on: http://stackoverflow.com/a/28672845
type: Comment
score: 0
type: AnswerComment
has text: please add your html also @Mario

http://stackoverflow.com/q/28642426
accepted answer: http://stackoverflow.com/a/28642593
tagged with: callback
possible better answer: http://stackoverflow.com/a/28642478
has answer: http://stackoverflow.com/a/28642478
has comment: http://stackoverflow.com/comment/45583421
has answer: http://stackoverflow.com/a/28642778
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28642593
type: Question
has title: Break out from a "super function" from a callback
tagged with: javascript
score: 0
has body: I was wondering if it was possible to break out from a "super function" from a callback function. I simplified my code to be more readable function isClicked() { var userInputs = $("input"); userInputs.each(function (index, element) { if ($(element).val() === "") return; //But I want to break out from isClicked() }); } I instinctively wrote this code, but I quickly realized that my reasoning was wrong, returning only broke from the current iteration of the callback. So basically, my question is if it is possible to break out from isClicked() within the callback. There is a easy fix to my problem, but I was wondering if the above was even possible
answer count: 3

http://stackoverflow.com/comment/45603185
score: 0
comment on: http://stackoverflow.com/a/28595070
type: Comment
type: AnswerComment
has text: `pngparse` library is only for node.js. How can I use it on client side?

http://stackoverflow.com/q/28697288
favorite count: 0
has body: I have multiple divs with the class badge-partial. I now wish to iterate over each of these divs and remove all children from each div. I have tried the following: $(".badge-partial").each(function() { $(this).children().remove(); }); But this does not trigger anything.
has answer: http://stackoverflow.com/a/28697337
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28697337
has title: Iterate over multiple divs and remove children of each div
type: Question
score: -2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45684840
downvote count: 3
has comment: http://stackoverflow.com/comment/45684787
has comment: http://stackoverflow.com/comment/45684954
has comment: http://stackoverflow.com/comment/45684920
upvote count: 1
answer count: 1

http://stackoverflow.com/comment/45702890
comment on: http://stackoverflow.com/q/28705795
type: QuestionComment
type: Comment
score: 0
has text: Nevermind, I found a solid link here that should help http://stackoverflow.com/questions/5004233/jquery-ajax-post-example-with-php/14217926#14217926

http://stackoverflow.com/comment/45615173
score: 0
type: Comment
has text: Sorry, I thought the solution was much simpler, I'll edit the question as well.
comment on: http://stackoverflow.com/a/28659659
type: AnswerComment

http://stackoverflow.com/a/28600362
type: Answer
downvote count: 0
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45506594
has body: You can not access the contents of a document which is not on the same domain as the parent document. That is the Same Origin Policy.
answers question: http://stackoverflow.com/q/28600287
has comment: http://stackoverflow.com/comment/45506549

http://stackoverflow.com/a/28631744
type: Answer
accepted answer of: http://stackoverflow.com/q/28631620
has comment: http://stackoverflow.com/comment/45564462
downvote count: 0
score: 1
type: AcceptedAnswer
has body: Have you tried this: var dt = new Date(); var weekBefore = dt.setDate(dt.getDate() - 7); var weekAfter = dt.setDate(dt.getDate() + 7); JavaScript will figure it out automatically the date 7 days before and after!
answers question: http://stackoverflow.com/q/28631620
upvote count: 1

http://stackoverflow.com/a/28650007
score: 2
has body: Don't use switch for range checks like this. It's possible with switch (true) { case (a &gt; 30000): a = a - 30000; b = b++; but just don't do that. Use if/else instead. While switch is really just an abstract if/else construct, use it for things like this: switch(a){ case 1: ... }
upvote count: 2
answers question: http://stackoverflow.com/q/28649904
type: Answer
downvote count: 0

http://stackoverflow.com/comment/45757532
score: 0
type: Comment
has text: @RemyLebeau the idea was to create a single sign-on system which works with windows logon. You login to windows, open the website, the website recognizes you by your windows logon and voila, you are authenticated. I don't want to limit this functionality to AD-only, which is why I require a custom solution.
type: QuestionComment
comment on: http://stackoverflow.com/q/28728614

http://stackoverflow.com/comment/45783712
comment on: http://stackoverflow.com/a/28729445
type: Comment
has text: you dont need to define new functions, check out the lodash example in bluebird .call documentation, i believe same is possible in q
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45689686
score: 0
has text: Why don't you just use PHP for this? You can do a redirect after an amount of time with the header function.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28699773

http://stackoverflow.com/q/28601023
has comment: http://stackoverflow.com/comment/45507699
accepted answer: http://stackoverflow.com/a/28601126
has title: How to print JSON response in javascript
favorite count: 0
tagged with: ajax
possible better answer: http://stackoverflow.com/a/28601393
has answer: http://stackoverflow.com/a/28601393
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45507636
has answer: http://stackoverflow.com/a/28601126
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45507620
type: Question
answer count: 2
has body: I am able to make a Ajax request and getting response as well in form of JSON string, still alert box of JavaScript is not showing actual response text. I am new to ajax concept and dont know much. Ajax-Call:- Action triggered on dropdown &lt;select name="state" onchange="getOptions(this.value)"&gt; Javascript Function called :- function getOptions(state){ AJAX.onreadystatechange = handler; AJAX.open("GET", "getData?id="+state); AJAX.send(); }; Response Firebug is showing This is my code to fetch response and print. function handler() { if(AJAX.readyState == 4 &amp;&amp; AJAX.status == 200) { var json = eval('(' + AJAX.responseText +')'); alert('Success. Result:' + json); } else if (AJAX.readyState == 4 &amp;&amp; AJAX.status != 200) { alert('Something went wrong...'); } } Every time its a success but i get output as
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45507713

http://stackoverflow.com/comment/45723640
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28717036
has text: #Joe Fitter is there any wa to turn of parsing, formatting and sorting in datatable, may be it speed up adding data?? i'm using datatable 1.9.4
type: AnswerComment

http://stackoverflow.com/q/28595546
has comment: http://stackoverflow.com/comment/45498976
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28595568
has answer: http://stackoverflow.com/a/28596306
score: -3
tagged with: http://stackoverflow.com/tag/html
has title: Why is this code working in jsfiddle but not in my html page
has comment: http://stackoverflow.com/comment/45497819
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28596336
has comment: http://stackoverflow.com/comment/45498373
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45499034
tagged with: javascript
downvote count: 4
has body: I've never had this problem before. I have this code that I am trying to implement into my application http://jsfiddle.net/TC6Gr/119/ I have tried Pasting all the jsfiddle code in a new page without my code, it doesn't work. Wrap/unwrap the script in $(document).ready... it doesn't work. When I put an alert in the click function, the alert displays but doesn't display the modal?
answer count: 3
has comment: http://stackoverflow.com/comment/45498781
tagged with: jquery

internet-explorer-9
tag name: internet-explorer-9
tags question: http://stackoverflow.com/q/28722135
tags question: http://stackoverflow.com/q/28706343
tags question: http://stackoverflow.com/q/28680113
type: Tag
tags question: http://stackoverflow.com/q/28741528
tags question: http://stackoverflow.com/q/28696706

http://stackoverflow.com/comment/45524464
comment on: http://stackoverflow.com/q/28609623
type: QuestionComment
has text: You are right. there is no way, only listen for both events `idle` and `tilesloaded`and if `tilesloaded`is not fired you can animate your marker after a timeout.
score: 0
type: Comment

http://stackoverflow.com/q/28676311
tagged with: canvas
answer count: 1
favorite count: 0
upvote count: 2
tagged with: http://stackoverflow.com/tag/html
has body: When using the canvas element. Is it safe to call getContext("2d") only once after the page is loaded? Or should I call this function every time I want to draw a frame?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45645968
has comment: http://stackoverflow.com/comment/45646180
has answer: http://stackoverflow.com/a/28676817
score: 1
has title: Is it safe to store the value of getContext
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45646095
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28676817

http://stackoverflow.com/a/28737174
upvote count: 3
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28737155
downvote count: 0
type: Answer
score: 3
answers question: http://stackoverflow.com/q/28737155
has body: Valid CSS selector will be $("#divItemName input[type='text']").val(itemName); Colon : in front of attribute selector [type='text'] looks weird even for older jQuery version. While #divItemName input[type='text'] is perfectly valid CSS syntax, it's not jQuery specific thing.

http://stackoverflow.com/q/28743214
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45781519
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45773515
answer count: 0
has body: This is my coding of navbar. When I switch to mobile view navbar works fine, but when I add some php content like include some pages by using using include function of php, then its stop working collapsing. enter code here Navbar <!-- Toggle navigation Mohit Sharma Training (current) Skills Projects Hobbies Contact
has comment: http://stackoverflow.com/comment/45824386
has comment: http://stackoverflow.com/comment/45769173
has comment: http://stackoverflow.com/comment/45773569
type: Question
tagged with: javascript
score: 0
tagged with: jquery
has title: Bootstrap 3 Collapsing
has comment: http://stackoverflow.com/comment/45770508
tagged with: twitter-bootstrap

http://stackoverflow.com/comment/45514341
comment on: http://stackoverflow.com/a/28604644
has text: Thanks for the code. But when I click back to "select a state" still text box is visible. how can i hide this?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45688607
type: AnswerComment
has text: @Quentin, could you please explain why this is not an answer for the old and the edited question?
type: Comment
comment on: http://stackoverflow.com/a/28698704
score: 0

http://stackoverflow.com/comment/45543061
type: Comment
comment on: http://stackoverflow.com/q/28620231
type: QuestionComment
has text: Agree with floribon, `element.scope` is something you use only for a quick debug session in order to inspect the scope. Using it for something else is a big code-smell.
score: 0

http://stackoverflow.com/comment/45612303
score: 0
type: Comment
type: QuestionComment
has text: When you have an object with properties that you need to transfer to another object: When you need to alter properties of object `A` but you want to let `A` intact, you could copy the properties to `B` and change them, much like you would use `slice` to copy part of an array.
comment on: http://stackoverflow.com/q/28657071

http://stackoverflow.com/a/28694593
downvote count: 0
has body: Ok - many thanks @dark-ashelin ended up with this - bit of a hack but it works. $(function () { var sidebar = $("#sidebar"); var top = $('#sidebar').offset().top - parseFloat($('#sidebar').css('marginTop').replace(/auto/, 0)); var footTop = $('#footer').offset().top - parseFloat($('#footer').css('marginTop').replace(/auto/, 0))-60; var maxY = footTop - $('#sidebar').outerHeight() - 85; $(window).scroll(function (evt) { var y = $(this).scrollTop(); if (y &gt; 100) { if (y &lt; maxY) { $('#sidebar').addClass('stickyside').removeAttr('style'); } else { $('#sidebar').removeClass('stickyside').css({ position: 'absolute', top: (maxY + 50) + 'px' }); } } else { $('#sidebar').removeClass('stickyside'); } }); });
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/45680104
answers question: http://stackoverflow.com/q/28692947

http://stackoverflow.com/q/28671539
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45636899
type: Question
tagged with: angularjs-directive
has answer: http://stackoverflow.com/a/28674599
has body: We are using service,factory and provider in the modules of angularjs.my Question is what is the difference among each other and at what condition they should be used in angularjs.please solve my doubt.
score: 0
answer count: 1
tagged with: javascript
has title: difference between service,factory.provider in angularjs
linked to: http://stackoverflow.com/q/15666048
has comment: http://stackoverflow.com/comment/45637019
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/tag/json
tags question: http://stackoverflow.com/q/28610663
tags question: http://stackoverflow.com/q/28640338
tags question: http://stackoverflow.com/q/28627632
tags question: http://stackoverflow.com/q/28671993
tags question: http://stackoverflow.com/q/28688131
tags question: http://stackoverflow.com/q/28687931
tags question: http://stackoverflow.com/q/28702492
tags question: http://stackoverflow.com/q/28745515
tags question: http://stackoverflow.com/q/28697412
tags question: http://stackoverflow.com/q/28633223
tags question: http://stackoverflow.com/q/28611588
tags question: http://stackoverflow.com/q/28648766
tags question: http://stackoverflow.com/q/28734424
tags question: http://stackoverflow.com/q/28667151
tags question: http://stackoverflow.com/q/28711510
tags question: http://stackoverflow.com/q/28614194
tags question: http://stackoverflow.com/q/28659515
tags question: http://stackoverflow.com/q/28630297
tags question: http://stackoverflow.com/q/28623082
tags question: http://stackoverflow.com/q/28714690
tags question: http://stackoverflow.com/q/28665258
tags question: http://stackoverflow.com/q/28617633
tags question: http://stackoverflow.com/q/28657344
tags question: http://stackoverflow.com/q/28690497
tags question: http://stackoverflow.com/q/28691735
tags question: http://stackoverflow.com/q/28680654
tags question: http://stackoverflow.com/q/28717182
tags question: http://stackoverflow.com/q/28620214
tags question: http://stackoverflow.com/q/28598729
tags question: http://stackoverflow.com/q/28620483
tags question: http://stackoverflow.com/q/28668021
tags question: http://stackoverflow.com/q/28605619
tags question: http://stackoverflow.com/q/28706300
tags question: http://stackoverflow.com/q/28630004
tags question: http://stackoverflow.com/q/28703178
tags question: http://stackoverflow.com/q/28749937
tags question: http://stackoverflow.com/q/28717594
tags question: http://stackoverflow.com/q/28617862
tags question: http://stackoverflow.com/q/28707487
tags question: http://stackoverflow.com/q/28665335
tags question: http://stackoverflow.com/q/28683615
tags question: http://stackoverflow.com/q/28630379
tags question: http://stackoverflow.com/q/28682441
tags question: http://stackoverflow.com/q/28599638
tags question: http://stackoverflow.com/q/28649297
tags question: http://stackoverflow.com/q/28611926
tags question: http://stackoverflow.com/q/28647548
tags question: http://stackoverflow.com/q/28676390
tags question: http://stackoverflow.com/q/28606747
tags question: http://stackoverflow.com/q/28646946
tags question: http://stackoverflow.com/q/28612767
tags question: http://stackoverflow.com/q/28615179
tags question: http://stackoverflow.com/q/28742453
tags question: http://stackoverflow.com/q/28687940
tags question: http://stackoverflow.com/q/28682340
tags question: http://stackoverflow.com/q/28731505
tags question: http://stackoverflow.com/q/28726387
tags question: http://stackoverflow.com/q/28709816
tags question: http://stackoverflow.com/q/28695693
tags question: http://stackoverflow.com/q/28716396
tags question: http://stackoverflow.com/q/28629142
tags question: http://stackoverflow.com/q/28722872
tags question: http://stackoverflow.com/q/28612058
tags question: http://stackoverflow.com/q/28625257
tags question: http://stackoverflow.com/q/28746021
tags question: http://stackoverflow.com/q/28734249
tags question: http://stackoverflow.com/q/28701919
tags question: http://stackoverflow.com/q/28617022
tags question: http://stackoverflow.com/q/28716424
tags question: http://stackoverflow.com/q/28615525
tags question: http://stackoverflow.com/q/28738594
tags question: http://stackoverflow.com/q/28613475
type: Tag
tags question: http://stackoverflow.com/q/28676198
tags question: http://stackoverflow.com/q/28609921
tags question: http://stackoverflow.com/q/28693144
tags question: http://stackoverflow.com/q/28639345
tags question: http://stackoverflow.com/q/28703522
tags question: http://stackoverflow.com/q/28743091
tags question: http://stackoverflow.com/q/28724813

http://stackoverflow.com/q/28720546
upvote count: 1
has comment: http://stackoverflow.com/comment/45728690
score: 1
type: Question
has body: /*what i want is to set the maxDate as vmEndDate */ app.directive('myDatepicker', function ($parse) { return function (scope, element, attrs, controller) { var ngModel = $parse(attrs.ngModel); alert(element.val()); $(function(){ element.datepicker({ showOn:"both", // changeYear:true, //changeMonth:true, dateFormat:'dd-MMMM-yyyy', //maxDate: vmEndDate, minDate: new Date(), // yearRange: '1920:2012', onSelect:function (dateText, inst) { scope.$apply(function(scope){ // Change binded variable ngModel.assign(scope, dateText); }); } }); }); } }); /*html code */ &lt;input id="dp" type="text" ng-model="vmEndDate" name="mDate" my-datepicker/&gt; /Aim: I want create a date picker (max and min ) using angular custom directive min is to day date and max date is vm end date (receiving from server )/
has title: Send the binded (ng-model) data to Angularjs custome directive
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28722491
has comment: http://stackoverflow.com/comment/45729100
answer count: 1
has comment: http://stackoverflow.com/comment/45728872
favorite count: 0
has comment: http://stackoverflow.com/comment/45728189
has comment: http://stackoverflow.com/comment/45729237
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/q/28739387
has body: I am still quite new to php. I have read that if you want to call a php method from a button, you will first need to assign the button's onclick event to call a javascript function, which in turn has to post to the php page via ajax. Currently, my javascript is as follows: function handle_qa_submit_comment(postId, parentPostId, elem){ //console.log(elem); var ajaxUrl = './index.php'; var elem = encodeURIComponent(elem); var data = { action : 'add_comment', data : { 'postId' : postId, 'parentPostId' : parentPostId, 'elem' : elem } }; $.ajax({ url: ajaxUrl, data: JSON.stringify(data), contentType: 'application/json', async: true, }).always(function(jqxhr,textStatus){ console.log("jqxhr:"); console.log(jqxhr); console.log("status:"); console.log(textStatus); }); return false; } yes, I suspect the elem parameter is wrong - the argument supplied for that parameter is this on the button's onclick handler What happens in this code is that the data variable - as json - is being posted to my php page - index.php. my php is as follows: require 'asdf-include/app/csrf.class.php'; require 'asdf-include/app/csrf_handler.php'; session_start(); $GLOBALS['csrf'] = new csrf(); $GLOBALS['token_id'] = $csrf-&gt;get_token_id(); $GLOBALS['token_value'] = $csrf-&gt;get_token($token_id); header('Content-Type: application/json'); $aResult = array(); $post = filter_input(INPUT_POST,'action'); if( !isset($post)) { // Set base path here so this works with symbolic links for multiple installations define('ASDF_BASE_DIR', dirname(empty($_SERVER['SCRIPT_FILENAME']) ? __FILE__ : $_SERVER['SCRIPT_FILENAME']).'/'); require 'asdf-include/asdf-index.php'; } else { echo "'data found1234'" ; // I Never saw it even get to this point } First things first - PHP is still brand new and shiny to me. I am not sure how I will inspect the value of the $_POST superglobal. What matters is that it seems that the response I get from the php is the entire page's parsed html instead of what I echoed. Maybe I am going …
has title: Calling php code from Javascript - AJAX responds with entire page's html
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45762512
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28742006
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45762794
has comment: http://stackoverflow.com/comment/45762888
upvote count: 1
tagged with: php
type: Question

http://stackoverflow.com/a/28679392
has comment: http://stackoverflow.com/comment/45652432
has comment: http://stackoverflow.com/comment/45651922
answers question: http://stackoverflow.com/q/28679311
upvote count: 2
has comment: http://stackoverflow.com/comment/45651978
has comment: http://stackoverflow.com/comment/45652361
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45651902
has body: $(document).ready(function () { $(".slide-image a img").each(function () { this.src = this.dataset.src; }); }); Working Fiddle
type: Answer
accepted answer of: http://stackoverflow.com/q/28679311

http://stackoverflow.com/a/29520132
upvote count: 1
downvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28608497
has body: From docs: // Create async action with `completed` &amp; `failed` children var makeRequest = Reflux.createAction({ asyncResult: true });
score: 0

http://stackoverflow.com/comment/45583602
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28642127
has text: Sir, I need to link the date('Ymd'); to $currentdatetime, How to do it??
type: AnswerComment

http://stackoverflow.com/comment/45743500
type: Comment
has text: $(document).ready(function() { var a = new time(); var b = a.getTime(); $("#theTime").val(b); });
type: AnswerComment
comment on: http://stackoverflow.com/a/28728030
score: 0

http://stackoverflow.com/comment/45613607
type: AnswerComment
type: Comment
has text: Thanks! An excellent explanation. If I am not using $scope, but am using a 'Controller as <alias>' notation in ng-controller and the var vm = this' (John Papa style), then how does this change the $scope.$apply statement?
comment on: http://stackoverflow.com/a/28640230
score: 0

http://stackoverflow.com/a/28686038
type: Answer
score: 2
has body: If you don't mind the solution be a function and not a RegEx, here is a code that works fine. function isSetString(str, separator) { //TODO input validation var arr = str &amp;&amp; str.split(separator || ","), l = arr &amp;&amp; arr.length, o = {}; for (var i = 0; i &lt; l; i++) { if (o.hasOwnProperty( arr[i] )) { return false; } else { o[ arr[i] ] = true; } } return true; }
downvote count: 0
answers question: http://stackoverflow.com/q/28685513
upvote count: 2

http://stackoverflow.com/comment/45699745
comment on: http://stackoverflow.com/q/28705018
has text: Also - I'm on Chrome (40.0.2214.115 m), and they're turning white for me
score: 1
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45616196
type: AnswerComment
comment on: http://stackoverflow.com/a/28660264
type: Comment
has text: I tried, but it happens the same situation at first, its allways appearing the same message and starts duplicating, triplicating...and goes on
score: 0

http://stackoverflow.com/comment/45632885
type: QuestionComment
has text: The use case is that if the error is not handled I want to display a message. In essence I want something similar to a catch all in a main loop that you see in other architectures.
comment on: http://stackoverflow.com/q/28663772
type: Comment
score: 0

http://stackoverflow.com/comment/45733406
has text: I am using jsfiddle. And in the console at the bottom of the screen it only the last value entered appears in the array.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28722941

http://stackoverflow.com/comment/45698278
score: 2
has text: `json_encode()` requires an array that **starts with 0**, otherwise it will convert it to an associative array (i.e. "map").
comment on: http://stackoverflow.com/q/28704086
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28604823
tagged with: express
score: 0
answer count: 1
has body: I am creating a filter for a JSON object to filter the result depending on the value of the field. if we have the object below: var vo = [{ "programName": "Tesco.com", "code": "FFCLUB10", "updateDate": "1424270164689" }, { "id": 160320, "programId": 239597, "programName": "Panda Security UK" }]; Using the following code I want to filter the object and just have the one that programName starts with T: Voucher = _.where(vo, { 'programName': new RegExp('^' + '[T]', 'i')}); However I have an empty object as a result, I am using the lodash module. Could you give me some lights on this? Thanks
has title: _.where with RegExp in object return empty lodash
tagged with: regex
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28604950
accepted answer: http://stackoverflow.com/a/28604950
type: Question
tagged with: javascript

http://stackoverflow.com/comment/45662057
has text: Updated my answer to match what you are asking
score: 0
comment on: http://stackoverflow.com/q/28683910
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45816663
type: Comment
has text: @JJC I know :s but it helps and has other functions like auto restart and you can start multiple copies of the app at the same time and it automatically does the balancing and stuff like that. :)
score: 0
comment on: http://stackoverflow.com/a/28696974
type: AnswerComment

debugging
tags question: http://stackoverflow.com/q/28675147
tag name: debugging
tags question: http://stackoverflow.com/q/28669947
tags question: http://stackoverflow.com/q/28608981
tags question: http://stackoverflow.com/q/28644251
type: Tag
tags question: http://stackoverflow.com/q/28659263
tags question: http://stackoverflow.com/q/28736022
tags question: http://stackoverflow.com/q/28724774
tags question: http://stackoverflow.com/q/28618015
tags question: http://stackoverflow.com/q/28671532
tags question: http://stackoverflow.com/q/28700404
tags question: http://stackoverflow.com/q/28669233
tags question: http://stackoverflow.com/q/28632619
tags question: http://stackoverflow.com/q/28640841

http://stackoverflow.com/q/28648101
upvote count: 5
type: Question
score: 5
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: utf-8
favorite count: 0
has answer: http://stackoverflow.com/a/54730701
has body: is it possible to save characters such as "ěščřžýáé" in text to PDF using PDFkit? Their browser demo is here: http://pdfkit.org/demo/browser.html Note: I use only js libraries, no node.js etc.
type: UnansweredQuestion
has title: PDFKit: save UTF8 special characters
tagged with: pdfkit

http://stackoverflow.com/comment/128881409
comment on: http://stackoverflow.com/a/62298591
score: 1
type: AnswerComment
has text: I really like this one.
type: Comment

javascript
tags question: http://stackoverflow.com/q/28602982
tags question: http://stackoverflow.com/q/28632672
tags question: http://stackoverflow.com/q/28627060
tags question: http://stackoverflow.com/q/28731008
tags question: http://stackoverflow.com/q/28686045
tags question: http://stackoverflow.com/q/28693773
tags question: http://stackoverflow.com/q/28696838
tags question: http://stackoverflow.com/q/28650679
tags question: http://stackoverflow.com/q/28606129
tags question: http://stackoverflow.com/q/28646228
tags question: http://stackoverflow.com/q/28731628
tags question: http://stackoverflow.com/q/28606985
tags question: http://stackoverflow.com/q/28636505
tags question: http://stackoverflow.com/q/28636845
tags question: http://stackoverflow.com/q/28691770
tags question: http://stackoverflow.com/q/28603805
tags question: http://stackoverflow.com/q/28737842
tags question: http://stackoverflow.com/q/28702191
tags question: http://stackoverflow.com/q/28729248
tags question: http://stackoverflow.com/q/28685128
tags question: http://stackoverflow.com/q/28740918
tags question: http://stackoverflow.com/q/28639783
tags question: http://stackoverflow.com/q/28614035
tags question: http://stackoverflow.com/q/28750182
tags question: http://stackoverflow.com/q/28743437
tags question: http://stackoverflow.com/q/28743299
tags question: http://stackoverflow.com/q/28602489
tags question: http://stackoverflow.com/q/28632993
tags question: http://stackoverflow.com/q/28649467
tags question: http://stackoverflow.com/q/28696744
tags question: http://stackoverflow.com/q/28727173
tags question: http://stackoverflow.com/q/28608023
tags question: http://stackoverflow.com/q/28679261
tags question: http://stackoverflow.com/q/28696345
tags question: http://stackoverflow.com/q/28707423
tags question: http://stackoverflow.com/q/28741768
tags question: http://stackoverflow.com/q/28685573
tags question: http://stackoverflow.com/q/28595109
tags question: http://stackoverflow.com/q/28650746
tags question: http://stackoverflow.com/q/28670440
tags question: http://stackoverflow.com/q/28630695
tags question: http://stackoverflow.com/q/28597686
tags question: http://stackoverflow.com/q/28612686
tags question: http://stackoverflow.com/q/28621175
tags question: http://stackoverflow.com/q/28680809
tags question: http://stackoverflow.com/q/28595172
tags question: http://stackoverflow.com/q/28701157
tags question: http://stackoverflow.com/q/28670719
tags question: http://stackoverflow.com/q/28601023
tags question: http://stackoverflow.com/q/28645486
tags question: http://stackoverflow.com/q/28663517
tags question: http://stackoverflow.com/q/28634366
tags question: http://stackoverflow.com/q/28704835
tags question: http://stackoverflow.com/q/28611099
tags question: http://stackoverflow.com/q/28614995
tags question: http://stackoverflow.com/q/28690412
tags question: http://stackoverflow.com/q/28618015
tags question: http://stackoverflow.com/q/28621915
tags question: http://stackoverflow.com/q/28598339
tags question: http://stackoverflow.com/q/28665348
tags question: http://stackoverflow.com/q/28684704
tags question: http://stackoverflow.com/q/28644791
tags question: http://stackoverflow.com/q/28633024
tags question: http://stackoverflow.com/q/28649673
tags question: http://stackoverflow.com/q/28672867
tags question: http://stackoverflow.com/q/28666538
tags question: http://stackoverflow.com/q/28701591
tags question: http://stackoverflow.com/q/28612535
tags question: http://stackoverflow.com/q/28612593
tags question: http://stackoverflow.com/q/28671636
tags question: http://stackoverflow.com/q/28698499
tags question: http://stackoverflow.com/q/28624211
tags question: http://stackoverflow.com/q/28597167
tags question: http://stackoverflow.com/q/28613343
tags question: http://stackoverflow.com/q/28711627
tags question: http://stackoverflow.com/q/28652308
tags question: http://stackoverflow.com/q/28709476
tags question: http://stackoverflow.com/q/28678763
tags question: http://stackoverflow.com/q/28628288
tags question: http://stackoverflow.com/q/28716693

http://stackoverflow.com/q/28624809
has title: html disabled textfield should allow changes made by javascript
has comment: http://stackoverflow.com/comment/45550842
has comment: http://stackoverflow.com/comment/45550661
answer count: 3
has answer: http://stackoverflow.com/a/28624913
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28624884
has comment: http://stackoverflow.com/comment/45550678
accepted answer: http://stackoverflow.com/a/28625236
has body: i have a textfield which should be disabled for user-actions but should be filled by a javascript after another user-action. Is this somehow possible? It can be a solution made by js, css or even html.
has answer: http://stackoverflow.com/a/28624884
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
score: 0
type: Question
has answer: http://stackoverflow.com/a/28625236

http://stackoverflow.com/q/28637896
type: Question
upvote count: 1
has answer: http://stackoverflow.com/a/28637974
has title: How to hide elements when another element is clicked
tagged with: javascript
tagged with: jquery
favorite count: 0
score: 0
has body: Having a bit of difficulty getting this jquery to work. I have a form where all fields are nested in a div.form-group. The subscribe button has an id of subscribe. I want the form fields to disappear on click... but my js is not working out. Here's what I've tried, to no avail: (function($) { window.onload = function () { $("#subscribe").click(function() { $(".form-group").css("display: none"); }); } })(jQuery); The form-group class is set to display: block in the CSS. Is there something obvious I'm missing here? Any help is greatly appreciated. cheers,
has answer: http://stackoverflow.com/a/28638058
downvote count: 1
tagged with: css
answer count: 4
has answer: http://stackoverflow.com/a/28637925
has comment: http://stackoverflow.com/comment/45575442
has answer: http://stackoverflow.com/a/28637943
accepted answer: http://stackoverflow.com/a/28637943
possible better answer: http://stackoverflow.com/a/28637925
has comment: http://stackoverflow.com/comment/45575480
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45575412

http://stackoverflow.com/comment/45553782
score: 1
type: AnswerComment
type: Comment
has text: You really don't, you can compare to 0. `x % 2 === 0`
comment on: http://stackoverflow.com/a/28626426

http://stackoverflow.com/q/28679368
has answer: http://stackoverflow.com/a/28679817
tagged with: node.js
score: 0
answer count: 2
has title: Node.js Random Scheduling
possible better answer: http://stackoverflow.com/a/28679541
accepted answer: http://stackoverflow.com/a/28679817
tagged with: javascript
has answer: http://stackoverflow.com/a/28679541
type: AnsweredQuestion
tagged with: laterjs
has body: I have a function that I want to call within a random range in Node. So, for instance, I would like it to be executed once between 2 and 12 hours, then again once between 2 and 12 hours, and so on. However, this interval should not be fixed, so I need that interval to be recalculated at the end of every call. If possible, I'd also like to limit the days of the week that this can execute, so not on Saturdays and Sundays as an example. I've tried looking into later.js, which does the second part very well, but I can't seem to find a way to incrementally randomize the interval. Does anyone know how to accomplish this?
type: Question

http://stackoverflow.com/comment/45594361
comment on: http://stackoverflow.com/q/28648157
type: Comment
has text: var img1 = document.getElementById('image1'); var img1 = document.getElementById('image2'); var img1 = document.getElementById('image3'); setInterval(function(){ nFilter.style.display='block', 3000 ); setInterval(function(){ nFilter.style.display='block', 6000 ); setInterval(function(){ nFilter.style.display='block', 9000 );
score: 0
type: QuestionComment

http://stackoverflow.com/a/28732629
upvote count: 1
answers question: http://stackoverflow.com/q/28732419
downvote count: 0
type: Answer
has body: document.querySelectorAll("span") returns a NodeList and not an Array, so if you tried document.querySelectorAll("span").map(...) you would get an error about map not being defined (same if you tried to a .join) [].map.call(document.querySelectorAll("span"), function(a){ return a.textContent; } ) This is simply using call to make it so the NodeList is used as an Array for the map function for (var i = 0; i &lt; animals.length; i++) { (function(i) { this.print = function() { console.log('#' + i + ' ' + this.species + ': ' + this.name); } this.print(); }).call(animals[i], i); } the this here is the animals array. I'm guessing you need call here because animals is otherwise out of scope to the inner anonymous function? Actually the this here will refer to the object in the animals array at index i. But animals is not out of scope, it is just easier to do this.species than animals[i].species. They could have just as easily done )(i) and done animals[i].species instead of ).call(...) and this.species what is the purpose of passing in the index i as the second argument in .call(animals[i], i);? Since they are using an anonymous function, if they did not use the IIFE and pass in the index i argument, the anonymous function would use whatever value the for loop's increment variable i was last set to. So the print function would be logging the same info instead of each objects info.
score: 1

http://stackoverflow.com/a/28651825
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/45601409
has comment: http://stackoverflow.com/comment/45601541
has comment: http://stackoverflow.com/comment/45600986
downvote count: 0
has comment: http://stackoverflow.com/comment/45601078
has comment: http://stackoverflow.com/comment/45601334
type: Answer
has body: f is only available in the form_for block, which is being prematurely closed with the first &lt;% end %&gt;. &lt;% form_for @post do |f| %&gt; &lt;/div&gt; &lt;% end %&gt; &lt;!-- Closes form_for; remove this line --&gt; &lt;p&gt; &lt;%= f.label :body %&gt;&lt;br&gt; &lt;%= f.text_area :body %&gt; &lt;/p&gt; &lt;p&gt; &lt;%= f.submit %&gt; &lt;/p&gt; &lt;% end %&gt; Edit: &lt;button type="button" class="btn btn-primary"&gt;&lt;%= f.submit %&gt;&lt;/button&gt; in show.html.erb is also outside of the context of the form block. Move this line to _form.html.erb, before the closing &lt;% end %&gt; and your error should disappear. This will solve the error, but your form will not be output unless you modify the opening tag as Eifion suggested.
answers question: http://stackoverflow.com/q/28651743

http://stackoverflow.com/comment/45501333
type: QuestionComment
comment on: http://stackoverflow.com/q/28595627
has text: The value in this string is not a valid json...
score: 0
type: Comment

http://stackoverflow.com/q/28678207
downvote count: 0
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28678575
type: AnsweredQuestion
upvote count: 1
possible better answer: http://stackoverflow.com/a/28678428
type: Question
has answer: http://stackoverflow.com/a/28678428
has body: I need to convert a flat array where the similar data is held in separate properties into an array of arrays grouping the data fields from each property together. Hopefully an example will make sense of this. The original array: [{"MtmDate":"2014-10-24", "MouldingID":"1233B", "ID":38, "Mtm01":5.10, "Mtm02":6.63,"Mtm03":5.84 }, {"MtmDate":"2014-10-25", "MouldingID":"1233B", "ID":39, "Mtm01":5.13, "Mtm02":6.21,"Mtm03":6.64 }, {"MtmDate":"2014-10-26", "MouldingID":"1233B", "ID":40, "Mtm01":5.68, "Mtm02":5.95,"Mtm03":6.37 }, ... ] Output required: [{"Mtm": 1, values: [{"MtmDate": "2014-10-24", "ID":38, data: 5.10}, {"MtmDate": "2014-10-25", "ID":39, data: 5.13}, {"MtmDate": "2014-10-26", "ID":40, data: 5.68}]}, {"Mtm": 2, values: [{"MtmDate": "2014-10-24", "ID":38, data: 6.63}, {"MtmDate": "2014-10-25", "ID":39, data: 6.21}, {"MtmDate": "2014-10-26", "ID":40, data: 5.95}]}, {"Mtm": 3, values: [{"MtmDate": "2014-10-24", "ID":38, data: 5.84}, {"MtmDate": "2014-10-25", "ID":39, data: 6.64}, {"MtmDate": "2014-10-26", "ID":40, data: 6.37}]}, ] I know that I can do this by 'manually' setting up objects for each data field and adding them to the new array: var mtm1 = { mtm: 1, values: [] }, mtm2 = { mtm: 2, values: [] }, mtm3 = { mtm: 3, values: [] }; var dataByPoint = []; dataByPoint.push(mtm1); dataByPoint.push(mtm2); dataByPoint.push(mtm3); and then iterating through the original array grabbing the data for each object: $.each(d, function(index, value) { var details1 = { mtmDate: value.MtmDate, id: value.ID, data: value.Mtm01 }; if (details1.data) dataByPoint[0].values.push(details1); var details2 = { mtmDate: value.MtmDate, id: value.ID, data: value.Mtm02 }; if (details2.data) dataByPoint[1].values.push(details2); var details3 = { mtmDate: value.MtmDate, id: value.ID, data: value.Mtm03 }; if (details3.data) dataByPoint[2].values.push(details3); }); However there are in fact a dozen of these data properties and this method seems long-winded. Is there a way I can populate th…
score: 1
has title: Create new javascript array extracting data from object properties
has answer: http://stackoverflow.com/a/28678575
answer count: 2
tagged with: arrays

http://stackoverflow.com/q/28685645
upvote count: 0
answer count: 1
has body: I've tried AJAX, but I cannot seem to get this working. I've scoured stack, and the internet. So thanks in advance if someone can help me. What I have is formatted JSON. I'm able to use json_decode to pump out an associative array. I'm able to then iterate through that array and display want I want and store them in variables. I have a button and id like when clicked to use AJAX to call PHP file to write those variables to a text file. I tried using function dothis() { $.get("/abc.php"); return false; } Click Me If I run abc.php manually, it functions as expected but onclick appears to do nothing. Can someone point me in the right direction, or show me a better example of AJAX. I appreciate it. edit: Uncaught TypeError: undefined is not a function dothis onclick is what is displaying in console
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28686350
accepted answer: http://stackoverflow.com/a/28686350
score: -3
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45664445
has title: Pass variables from PHP to text file from button press
has comment: http://stackoverflow.com/comment/45664820
has comment: http://stackoverflow.com/comment/45664792
downvote count: 3
has comment: http://stackoverflow.com/comment/45664778
has comment: http://stackoverflow.com/comment/45664992
type: Question
has comment: http://stackoverflow.com/comment/45664804
has comment: http://stackoverflow.com/comment/45663982
tagged with: javascript

google-analytics
tags question: http://stackoverflow.com/q/28633494
tags question: http://stackoverflow.com/q/28639715
tags question: http://stackoverflow.com/q/28685402
tags question: http://stackoverflow.com/q/28704573
tags question: http://stackoverflow.com/q/28690021
tag name: google-analytics
tags question: http://stackoverflow.com/q/28712872
tags question: http://stackoverflow.com/q/28633868
tags question: http://stackoverflow.com/q/28722802
tags question: http://stackoverflow.com/q/28706188
tags question: http://stackoverflow.com/q/28707784
tags question: http://stackoverflow.com/q/28630809
tags question: http://stackoverflow.com/q/28750251
type: Tag
tags question: http://stackoverflow.com/q/28645170
tags question: http://stackoverflow.com/q/28663696

http://stackoverflow.com/q/28620088
score: 0
has comment: http://stackoverflow.com/comment/45542983
has body: Trying to display only that matches the dropdown boxes selected in the form. The form gets generated using a Form class, and options are in tables in the database (race, class). In the end looks like this: Character Name: Gender: Female Male Character Race: Goblin Human Undead Character Class: Warrior Wizard My controller calls in the Avatar, CharacterClass, Race classes. My avatar table has columns that store the IDs to the race.id, and class.id table.id_column's. # Get all the avatars in the `avatars` table. $avatars=$avatar_obj->getAllAvatars(); foreach($avatars as $avatar) { # Get the image information from the database, and set them to data members. $avatar_obj->getThisImage($avatar->image_id); # Set the Image object to a variable. $image_obj=$avatar_obj->getImageObj(); # Set the image file name to a variable. $image_file_name=$image_obj->getFileName(); # Get the class info from the database and set the data members. $class_obj->getThisCharacterClass($avatar->class_id); # Get the race info from the database and set the data members. $race_obj->getThisRace($avatar->race_id); echo ' ', ' ', ' getTitle().'" />', ' '; echo $race_obj->getDescription().' '; echo $class_obj->getDescription(); echo ' '; } This displays a bunch of 's: Goblin description. Warrior Description Goblin description. Wizard Description Human description. Warrior Description Human description. Wizard Description Undead description. Warrior Description Undead description. Wizard Description (And a lot more) I am stuck at this point. I am not sure how to figure out the jQuery to hide/show the correct .
has title: Change div according to dropdown boxes selected
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45542897
answer count: 1
has answer: http://stackoverflow.com/a/28620503
tagged with: php
type: AnsweredQuestion
tagged with: mysql
accepted answer: http://stackoverflow.com/a/28620503
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28668703
score: 0
downvote count: 2
has comment: http://stackoverflow.com/comment/45631950
has comment: http://stackoverflow.com/comment/45631903
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45631674
has comment: http://stackoverflow.com/comment/45631578
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/62377458
has answer: http://stackoverflow.com/a/28668842
tagged with: javascript
tagged with: jquery
has body: I have an event calender in my magento website. I need to redirect users to current date while they are in other months. I have a button called TODAY to write the click event. EX : now I am in month of march, I want to go to February by clicking the button TODAY. Please see the image I will post here. I am unable to publish an image, if any one nee an image for this I can send it to you. Great pleasure if any one can help me on this. Thank you. EDIT &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css"&gt; &lt;script src="http://code.jquery.com/ui/1.11.2/jquery-ui.js"&gt;&lt;/script&gt; jQuery(function() { var jqdpopup = jQuery('#event_popup').dialog({autoOpen: false}); var myDate = new Date(); var prettyDate =(myDate.getMonth()+1) + '/' + myDate.getDate() + '/' + myDate.getFullYear(); jQuery("#date_input").val(prettyDate); jQuery('.eventslisting_title span').html(prettyDate); getevents(prettyDate); var datesArray=["11/02/2014","11/03/2014"]; jQuery(function(){ jQuery('#event_calender').datepicker({ inline: true, beforeShowDay: function (date) { var theday = (date.getMonth()+1) +'/'+ date.getDate()+ '/' + date.getFullYear(); return [true,jQuery.inArray(theday, datesArray) &gt;=0?"eventDate":'']; }, onSelect: function(date, obj){ jQuery('#date_input').val(date); //Updates value of of your input jQuery('.eventslisting_title span').html(date); getevents(date); jqdpopup.dialog( "open" ); } });
accepted answer: http://stackoverflow.com/a/28668842
tagged with: datepicker
has title: How to select current day when user was in other months in Datepicker calender by using a clickable button.?
possible better answer: http://stackoverflow.com/a/28668832
favorite count: 0
has answer: http://stackoverflow.com/a/28668832
upvote count: 2

http://stackoverflow.com/q/28729085
tagged with: ecmascript-6
has comment: http://stackoverflow.com/comment/45744648
has comment: http://stackoverflow.com/comment/45744860
downvote count: 0
tagged with: javascript
tagged with: specifications
possible better answer: http://stackoverflow.com/a/28729370
has answer: http://stackoverflow.com/a/28729370
score: 3
has title: Is the blink() method really deprecated?
answer count: 4
linked to: http://stackoverflow.com/q/14363740
favorite count: 0
has answer: http://stackoverflow.com/a/28730361
upvote count: 3
has body: I don't mean the infamous HTML element &lt;blink&gt;, but the JavaScript function String.prototype.blink. The MDN page in my link - but also a few other sources found by Google - indicate that this is a deprecated feature (W3Schools goes even further and lists it as nonstandard, incorrectly noting that it's not supported by any current browser, but anyway...) alert("Hello World!".blink()); After a look into the ES6 specification (current RC is 34), I couldn't find any evidence for those claims: apparently, nothing in the spec suggests that the blink method is deprecated, obsolete or nonstandard. Same thing for the other string methods big, bold, fixed, fontcolor, fontsize, italics, strike, sub, sup: while the respective HTML elements are deprecated, the JavaScript methods don't look like they are. Of course, my sources may be inaccurate, but the MDN reference is usually quite reliable, so I'm suspecting that I'm overlooking something here. Can someone else confirm or debunk the fact that the blink method is deprecated? Sources appreciated.
has answer: http://stackoverflow.com/a/28729153
has answer: http://stackoverflow.com/a/28729241
type: AnsweredQuestion
tagged with: deprecated
has comment: http://stackoverflow.com/comment/45744807
type: Question
accepted answer: http://stackoverflow.com/a/28730361

http://stackoverflow.com/comment/45783427
type: Comment
comment on: http://stackoverflow.com/a/28749667
has text: SCRIPT5007: Unhandled exception at line 23, column 21 in ms-appx://io.cordova.blankcordovaapp2/www/index.html 0x800a138f - JavaScript runtime error: Unable to get property 'createConnection' of undefined or null reference File: index.html, Line: 23, Column: 21 This error popped up
score: 0
type: AnswerComment

mysql
tags question: http://stackoverflow.com/q/28672405
tags question: http://stackoverflow.com/q/28746466
tags question: http://stackoverflow.com/q/28742684
tags question: http://stackoverflow.com/q/28668896
tags question: http://stackoverflow.com/q/28625193
tags question: http://stackoverflow.com/q/28678764
tag name: mysql
tags question: http://stackoverflow.com/q/28694938
tags question: http://stackoverflow.com/q/28716334
tags question: http://stackoverflow.com/q/28683421
tags question: http://stackoverflow.com/q/28640077
tags question: http://stackoverflow.com/q/28657889
tags question: http://stackoverflow.com/q/28735025
tags question: http://stackoverflow.com/q/28617996
tags question: http://stackoverflow.com/q/28683662
tags question: http://stackoverflow.com/q/28670716
tags question: http://stackoverflow.com/q/28627632
tags question: http://stackoverflow.com/q/28655312
tags question: http://stackoverflow.com/q/28687415
type: Tag
tags question: http://stackoverflow.com/q/28735081
tags question: http://stackoverflow.com/q/28652495
tags question: http://stackoverflow.com/q/28729091
tags question: http://stackoverflow.com/q/28677909
tags question: http://stackoverflow.com/q/28748559
tags question: http://stackoverflow.com/q/28610666
tags question: http://stackoverflow.com/q/28596313
tags question: http://stackoverflow.com/q/28740065
tags question: http://stackoverflow.com/q/28709962
tags question: http://stackoverflow.com/q/28731992
tags question: http://stackoverflow.com/q/28702792
tags question: http://stackoverflow.com/q/28737140
tags question: http://stackoverflow.com/q/28655903
tags question: http://stackoverflow.com/q/28703178
tags question: http://stackoverflow.com/q/28667978
tags question: http://stackoverflow.com/q/28731406
tags question: http://stackoverflow.com/q/28743823
tags question: http://stackoverflow.com/q/28679990
tags question: http://stackoverflow.com/q/28707217
tags question: http://stackoverflow.com/q/28671553
tags question: http://stackoverflow.com/q/28703805
tags question: http://stackoverflow.com/q/28620088
tags question: http://stackoverflow.com/q/28641741
tags question: http://stackoverflow.com/q/28663986
tags question: http://stackoverflow.com/q/28696203
tags question: http://stackoverflow.com/q/28674621

http://stackoverflow.com/q/28734288
has comment: http://stackoverflow.com/comment/45759530
type: Question
has comment: http://stackoverflow.com/comment/45753934
tagged with: javascript
tagged with: jquery
has body: I have along div's for accordion menu with each has id's likes For expand and collapse To find all div's i am using below two methods $("div[id^='sample_']"); I got all 100 div no i loop 100 times and click event or Direct click event with class name $('.sample').on('click'); In above both which one best or any better process
has comment: http://stackoverflow.com/comment/45758512
downvote count: 0
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28737123
upvote count: 2
has comment: http://stackoverflow.com/comment/45758942
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Which one is best for performance in jquery select class names vs id's
has comment: http://stackoverflow.com/comment/45753900
tagged with: css
score: 2

http://stackoverflow.com/comment/45711037
type: AnswerComment
type: Comment
has text: Excellent, I knew it would be simple.
comment on: http://stackoverflow.com/a/28710684
score: 0

http://stackoverflow.com/a/28649002
has comment: http://stackoverflow.com/comment/45596069
has comment: http://stackoverflow.com/comment/45595828
score: 1
has comment: http://stackoverflow.com/comment/45600138
upvote count: 1
answers question: http://stackoverflow.com/q/28642637
has body: doCallTest returns a promise that rejects with an error, not the string "Nooooo". (as a side note, please don't reject with non-errors) Try this, it will reject with the string: doCallTest = function() { return P.reject('Nooooo'); };
accepted answer of: http://stackoverflow.com/q/28642637
has comment: http://stackoverflow.com/comment/45595790
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45595780
has comment: http://stackoverflow.com/comment/45595591
type: Answer
has comment: http://stackoverflow.com/comment/45595651

http://stackoverflow.com/a/28650562
has comment: http://stackoverflow.com/comment/45598562
type: AcceptedAnswer
downvote count: 0
has body: Due to the items() function which returns the array and the ng-repeat you got a recursion. This breaks the $digest cycle. If you don't return the array and just bind it to a scope variable it works like a charm ;) See the fiddle.
type: Answer
has comment: http://stackoverflow.com/comment/45598551
has comment: http://stackoverflow.com/comment/45598523
upvote count: 1
answers question: http://stackoverflow.com/q/28650045
accepted answer of: http://stackoverflow.com/q/28650045
score: 1

http://stackoverflow.com/comment/45675498
has text: Ah - that's easy - will alter fiddle to show - was just trying to convey the mechanism of how each bit is done... .hold on
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28692065

http://stackoverflow.com/comment/45588654
comment on: http://stackoverflow.com/a/28645166
has text: Sorry, that doesn't work, The browser executes the href part if you use the "open in new tab" function. but you could disable the functionality "open in new tab" when you use a span instead an a-tag
type: Comment
score: 0
type: AnswerComment

typeerror
tags question: http://stackoverflow.com/q/28687406
tags question: http://stackoverflow.com/q/28600317
tag name: typeerror
tags question: http://stackoverflow.com/q/28653495
type: Tag
tags question: http://stackoverflow.com/q/28677126

http://stackoverflow.com/comment/45693278
score: 1
type: QuestionComment
has text: meta, title, script, and link tags all belong within the header. Your structure should be HTML tag wrapping HEAD tag and BODY tag: the head containing meta - information, scripts, etc., and the body containing the content of the page
comment on: http://stackoverflow.com/q/28701550
type: Comment

http://stackoverflow.com/q/28633094
possible better answer: http://stackoverflow.com/a/28633362
accepted answer: http://stackoverflow.com/a/28633308
score: 0
answer count: 2
tagged with: image-scaling
tagged with: javascript
has answer: http://stackoverflow.com/a/28633308
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28633362
has title: Each image less than the previous
tagged with: image
type: Question
has body: I have array with 5 images, which I displayed with PHP. How can I use JavaScript to diplay them such that each image is 10% lower than the previous? foreach($top_images as $top_i) { echo '#'.$ratio; echo ' '; $ratio++; }

http://stackoverflow.com/comment/45761297
has text: http://stackoverflow.com/questions/14220321/how-to-return-the-response-from-an-ajax-call - similar because both are regarding async processing
comment on: http://stackoverflow.com/q/28738748
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/45782819
comment on: http://stackoverflow.com/a/28750019
type: Comment
type: AnswerComment
has text: Thank you ! However, it is acting a bit silly. it works if I hover in sequence like pic1 - pic2 - pic3 -pic4 . But if I first hover pic4 then it gets stuck, no pic3,2,1. If hover over pic3 first, no more pic2 and pic1. What is causing the problem?
score: 0

http://stackoverflow.com/comment/45642767
type: QuestionComment
comment on: http://stackoverflow.com/q/28674459
has text: It looks like you have it working.
score: 0
type: Comment

http://stackoverflow.com/q/28731628
has answer: http://stackoverflow.com/a/28733227
has body: I'm using Chai, Mocha, and Sinon for my testing framework. Right now, I have a test for this working, but I actually have to create a directory and put files in it to get my tests to actually do something (this will be a large test suite, so doing things with all this diskIO is not ideal, to say the least). How can I stub out the injection mechanism so that I don't have to touch the disk in the test? I was thinking, in the example code below, some way to stub the err and the files parameters injected by the fs.readdir method. That way, I avoid testing fs.readdir in my unit test. I did some Googling and looked at the API Docs but I didn't find what I needed (or didn't recognize it). Here is some sample code of what I'm talking about: Function under test function fsFxnWrapper(dir, callback) { var doSomeMutation = function (files) { ... }; fs.readdir(dir, function(err, files) { callback(err, doSomeMutation(files)); }); } Sample Test Case describe('When the directory has things'', function () { before(function () { ... }); after(function () { ... }); // I'm not sure how to write my stubs so that fs.readdir inside of the // fsFxnWrapper doesn't have to go out to the filesystem to retrieve something... it('should do the proper mutation on the files list', function () { var valueAfterMutation = [ /* the expected answer */]; fsFxnWrapper('test/dir', function (err, files) { expect(files).to.deep.equal(valueAfterMutation); expect(err).to.equal(null); }); }); });
has title: How would I stub an fs callback's injected params to remove the need to touch the filesystem in a test suite?
type: Question
tagged with: stub
tagged with: javascript
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/28733227
has comment: http://stackoverflow.com/comment/45749768
tagged with: asynchronous
has answer: http://stackoverflow.com/a/28732798
tagged with: sinon
possible better answer: http://stackoverflow.com/a/28732798
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/comment/45702065
has text: So obvious... Why I thought it was necessary for the functions to be available globally is a mystery to me.:)
type: AnswerComment
comment on: http://stackoverflow.com/a/28706103
type: Comment
score: 1

http://stackoverflow.com/a/28720954
has comment: http://stackoverflow.com/comment/45728886
score: 0
answers question: http://stackoverflow.com/q/28720017
type: Answer
has body: Does it work if you build you .config like so: app.config( function($routeProvider) { $routeProvider .when('/', { templateUrl : '/views/index.html' }) .when('/exterior', { templateUrl : '/views/exterior.html' }) .when('/interior', { templateUrl : '/views/interior.html' }) .when('/gallery', { templateUrl : '/views/gallery.html' }) .when('/form', { templateUrl : '/views/form.html' }) .when('/live-preview', { templateUrl : '/views/live-preview.html' }) .otherwise({ redirectTo : '/' }); });
has comment: http://stackoverflow.com/comment/45728784
has comment: http://stackoverflow.com/comment/45728857
has comment: http://stackoverflow.com/comment/45728925
has comment: http://stackoverflow.com/comment/45728801

http://stackoverflow.com/comment/45693939
type: QuestionComment
comment on: http://stackoverflow.com/q/28701913
type: Comment
has text: 1) yes you can 2) no you cannot
score: 0

http://stackoverflow.com/q/28622399
has comment: http://stackoverflow.com/comment/45546861
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
answer count: 0
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45546768
has comment: http://stackoverflow.com/comment/45546831
has title: Is it proper/safe to generate random anchor href and image src via JavaScript on the index of my website?
tagged with: javascript
downvote count: 0
has body: On my index page, I have a section that displays a different anchor href and image src depending on the date, via JavaScript switch, e.g.: HTML &lt;a id="dailyDeal" href="index.html" title="Daily Deal"&gt;&lt;img src="loading.gif" alt="Daily Deal" /&gt;&lt;/a&gt; JavaScript switch (md) { case '0-1': // New Year document.getElementById('dailyDeal').href = 'deals/new-year.html'; document.getElementById('dailyDeal').innerHTML = '&lt;img src="images/deals/new-year.jpg" alt="Daily Deal" /&gt;'; break; // ... and so on I like to have certain (not too important) content that is dynamic, but I was curious to know the pros/cons, and possibly the effect it would have on SEO and/or validation in general.
favorite count: 0
has comment: http://stackoverflow.com/comment/45546746

http://stackoverflow.com/q/28715182
favorite count: 0
has answer: http://stackoverflow.com/a/28715679
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Self adjustable CSS border width
downvote count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/13474754
has body: I have a div element as below for example: &lt;div style="height: 10%; width: 20%; border: 1px solid black"&gt; Div Content &lt;/div&gt; Since the above div has height and width in %, I want the border width also to adjust when we resize the element. Looks like there is no way of denominating border width apart from pixel. So is there any idea on how to adjust the border width?
type: Question
duplicate of: http://stackoverflow.com/q/13474754
score: 1
has answer: http://stackoverflow.com/a/28715504
has comment: http://stackoverflow.com/comment/45718271
answer count: 2
upvote count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28714156
type: UnansweredQuestion
tagged with: css
linked to: http://stackoverflow.com/q/16670931
has answer: http://stackoverflow.com/a/28714226
score: 0
type: Question
answer count: 2
tagged with: javascript
has body: I know that there are almost the same questions related to scrollbars with some good answers, unfortunately that did not work for me. I want to hide scrollbars leaving scrolling functionality. Here is what I have: &lt;div class="sidebar"&gt; &lt;div id="status"&gt; &lt;/div&gt; &lt;..li items etc &gt; &lt;/div&gt;&lt;!-- END SIDEBAR --&gt; And my CSS, .sidebar { overflow: hidden; height: 90%; } .sidebar .#status { overflow:scroll; } My status id div is empty initially, and I have some list items (links) after it, what I am doing is that my status id div is being filled with li elements via ajax, since there are many of them i need scrollbar functionality, but since it is my sidebar positioned at the left side I do not want scrollbars to appear. Note: Making parent div overflow:hiddent and child one to scroll doesn't help.
has answer: http://stackoverflow.com/a/28714287
has comment: http://stackoverflow.com/comment/45716148
linked to: http://stackoverflow.com/q/13317364
has comment: http://stackoverflow.com/comment/45716116
tagged with: http://stackoverflow.com/tag/html
has title: Removing scrollbars but leave scrolling functionality

http://stackoverflow.com/q/28659376
accepted answer: http://stackoverflow.com/a/28659403
favorite count: 0
upvote count: 2
has body: Can additional object properties in coffeescript/javascript be added dynamically to an existing object? For example: var fred = { name: "Fred", species: "Sub-Human" }; Now later, for example, I want to add college major to get this: { name: "Fred", species: "Sub-Human", major: "Computer Science" } And... how does this affect, or does it affect performance?
tagged with: node.js
type: AnsweredQuestion
score: 1
has title: Can additional object properties in coffeescript/javascript be added dynamically to an existing object?
tagged with: coffeescript
has answer: http://stackoverflow.com/a/28659403
downvote count: 1
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28659415
has answer: http://stackoverflow.com/a/28659415
answer count: 2

http://stackoverflow.com/q/28722047
tagged with: javascript
score: -1
upvote count: 0
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: css
has body: Can anyone help identify if the Vertical Tabs built on this page: http://www.google.ca/doubleclick/insights/ Is it pure CSS or does it use Javascript?
tagged with: tabs
has answer: http://stackoverflow.com/a/28722749
has title: Recreating Vertical Tab using only CSS
downvote count: 1
type: Question

http://stackoverflow.com/a/34104096
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/96010582
has comment: http://stackoverflow.com/comment/93840280
answers question: http://stackoverflow.com/q/28685092
score: 3
downvote count: 0
has body: You can pass an already existing express instance into keystone before you initialise keystone using the 'app' object on keystone. Which you can read about here: http://keystonejs.com/docs/configuration/#options-concepts EDIT* from comments for updated docs: https://keystonejs.com/documentation/configuration/project-options Theres even a little extra bit of text describing how to pass in your own express instance and how it changed with newer versions of express. var express = require('express'), app = express(), keystone = require('keystone'), serve = require('serve-static'), favicon = require('serve-favicon'), body = require('body-parser'), cookieParser = require('cookie-parser'), multer = require('multer'); var cookieSecret = 'secretCookie' //Add your middleware app.use(cookieParser(cookieSecret)); app.use(body.urlencoded({ extended: true })); app.use(body.json()); app.use(multer()); keystone.init({ 'name': 'Website Name', 'brand': 'Website Brand', 'session': false, 'updates': 'updates', 'auth': true, 'user model': 'User', 'auto update': true, 'cookie secret': cookieSecret }); // Let keystone know where your models are defined. Here we have it at the `/models` keystone.import('models'); // Serve your static assets app.use(serve('./public')); // This is where your normal routes and files are handled app.get('/', function(req, res, next) { res.send('hello world'); }); keystone.app = app; keystone.start(); Then keystone will use your instance of express which will allow you to add all the middleware as if it is express on its own before you initialise keystone.

http://stackoverflow.com/q/28617992
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: android
answer count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: google-chrome
has body: Example of what I mean: http://jsfiddle.net/dtipson/ttebddd5/2/ In all other browsers, and in cases not linking to twitter's intents pages, when you open a new window or target blank, it opens in a new tab. But with android, even once you've set the browser to handle links to twitter.com, the new window opens, then immediately closes, and then the original (calling) page navigates to twitter.com. Example code that won't work properly (though I doubt it's anything to do with this): window.open( 'https://twitter.com/intent/tweet?text=hi', 'intent', 'scrollbars=yes,resizable=yes,toolbar=no,location=yes,status=no,width=550,height=420'); My guess is that this has something to do with have Android handles "application intents": if a page redirects to something that claims to have a native application link, it looks back up the chain of window.opener and affects the original page instead. To try and block this behavior, I've tried using window.open to open a page that waits a few seconds and THEN redirects to twitter.com/intents. But even here, the new tab opens, waits for however many seconds on that transition page, and then right when it redirects, it closes itself and the original tab redirects to twitter.com instead. I've tried setting window.opener to null (even though that shouldn't do anything). I'm not sure how any code on twitter.com could even affect the original page as they are obviously not on the same domain (and I've tried setting things up so that the original domain does NOT have twitter's widgets.js on it, so they can't be using POSTMessage). This really seems to be a (imho, bad) )quirk with how Android handles intents. Anyone know of any workarounds?
score: 1
tagged with: twitter
type: Question
tagged with: webintents
has title: Why do Android browsers (Chrome/stock) force twitter intents to close then open in the same window, even when _blank or window.open are used?

http://stackoverflow.com/a/28639140
accepted answer of: http://stackoverflow.com/q/28639023
has comment: http://stackoverflow.com/comment/45577726
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45577880
has body: Looking up on the console, it shows that your fonts &amp; your button image are missing. "NetworkError: 404 Not Found - http://agentboris.com/newwebsite/listings/Fonts/d7f7fba3-4873-4084-b7f2-6f3fa4ee6019.woff" d7f7fba...19.woff "NetworkError: 404 Not Found - http://agentboris.com/newwebsite/listings/listings/images/buttons.png" buttons.png "NetworkError: 404 Not Found - http://agentboris.com/newwebsite/listings/Fonts/fef20495-bab9-40eb-a873-7791998e1f4f.woff" fef2049...4f.woff "NetworkError: 404 Not Found - http://agentboris.com/newwebsite/listings/Fonts/bc176270-17fa-4c78-a343-9fe52824e501.woff" bc17627...01.woff "NetworkError: 404 Not Found - http://agentboris.com/newwebsite/listings/Fonts/4bf0ead4-e61b-4992-832b-6ff05828d99f.woff" 4bf0ead...9f.woff "NetworkError: 404 Not Found - http://agentboris.com/newwebsite/listings/Fonts/6a76c8c6-2abe-4842-b3e2-e675c21ddd49.woff" 6a76c8c...49.woff "NetworkError: 404 Not Found - http://agentboris.com/newwebsite/listings/Fonts/e1c997f3-fb27-4289-abc6-5ef059e51723.woff" e1c997f...23.woff "NetworkError: 404 Not Found - http://agentboris.com/newwebsite/listings/Fonts/3d829673-d42c-49ec-8799-1287be541432.ttf" 3d82967...432.ttf "NetworkError: 404 Not Found - http://agentboris.com/newwebsite/listings/Fonts/e005478c-7941-4de3-bd68-040d7d07645e.ttf" e005478...45e.ttf "NetworkError: 404 Not Found - http://agentboris.com/newwebsite/listings/Fonts/3516f91d-ac48-42cd-acfe-1be691152cc4.ttf" 3516f91...cc4.ttf "NetworkError: 404 Not Found - http://agentboris.com/newwebsite/listings/Fonts/73713a0b-8f6a-4c4e-b8a8-7cf238e632f6.ttf" 73713a0...2f6.ttf "NetworkError: 404 Not Found - http://agentboris.com/newwebsite/listings/Fonts/aaf1ac29-cd40-43ec-9a28-a947df44d661.ttf" aaf1ac2...661.ttf "NetworkError: 404 Not Found - http://agentboris.com/newwebsite/listings/Fonts/0b3b140c-bdbe-488f-8976-992b4104de0c.ttf" 0b3b140...e0c.ttf "NetworkError: 404 Not Found - http://agentboris.com/newwebsite/listings/Fonts/d7f7fba3-4873-4084-b7f2-6f3fa4ee6019.woff" d…
has comment: http://stackoverflow.com/comment/45615305
has comment: http://stackoverflow.com/comment/45646079
has comment: http://stackoverflow.com/comment/45605435
type: Answer
has comment: http://stackoverflow.com/comment/45578373
has comment: http://stackoverflow.com/comment/45578311
has comment: http://stackoverflow.com/comment/45605037
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28639023

http://stackoverflow.com/comment/45581007
comment on: http://stackoverflow.com/q/28640931
score: 0
has text: You need to understand JavaScript Arrays. You are creating an Array that has `.length === 1` in `indentSpace`.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28739745
upvote count: 87
has answer: http://stackoverflow.com/a/67550639
possible better answer: http://stackoverflow.com/a/28741819
type: Question
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/28514411
has answer: http://stackoverflow.com/a/44715252
has answer: http://stackoverflow.com/a/54985465
has answer: http://stackoverflow.com/a/45849918
accepted answer: http://stackoverflow.com/a/28744141
tagged with: ecmascript-6
tagged with: ecmascript-harmony
score: 87
has comment: http://stackoverflow.com/comment/76414351
has answer: http://stackoverflow.com/a/28741819
has body: How would I make an iterator out of an ES6 class in the same manner as JS1.7 SomeClass.prototype.__iterator__ = function() {...} syntax? [EDIT 16:00] The following works: class SomeClass { constructor() { } *[Symbol.iterator]() { yield '1'; yield '2'; } //*generator() { //} } an_instance = new SomeClass(); for (let v of an_instance) { console.log(v); } WebStorm flags *[Symbol.iterator]() with a 'function name expected' warning directly following the asterix, but otherwise this compiles and runs fine with Traceur. (Note WebStorm does not generate any errors for *generator().)
answer count: 7
tagged with: javascript
has answer: http://stackoverflow.com/a/28744141
favorite count: 0
has answer: http://stackoverflow.com/a/52011924
has title: How to make an iterator out of an ES6 class
downvote count: 0

http://stackoverflow.com/comment/45517311
comment on: http://stackoverflow.com/a/28605035
score: 0
type: Comment
has text: thanks for your suggestions. can you please help me to learn more about return()?
type: AnswerComment

http://stackoverflow.com/comment/127830651
type: AnswerComment
comment on: http://stackoverflow.com/a/72265631
type: Comment
has text: @Timo The only problem I see in the other solution is that it doesn't work with empty files, because it fails to handle the end of stream event. I'll try to come up with an update when I have the time.
score: 1

http://stackoverflow.com/a/28616539
has body: I believe i figured it out... I should have been using classes, not IDs. I switched it and it worked..
type: Answer
answers question: http://stackoverflow.com/q/28614793
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28614793

http://stackoverflow.com/comment/45721563
type: QuestionComment
comment on: http://stackoverflow.com/q/28716396
type: Comment
score: 0
has text: Is this the complete response?

http://stackoverflow.com/a/28722528
type: Answer
accepted answer of: http://stackoverflow.com/q/28702990
has comment: http://stackoverflow.com/comment/45883525
downvote count: 0
score: 6
has body: I was clueless, so I decided to modif the JavaScript plugin to add more logs. And I finally found the error, which is a vicious problem of... case sensitivity! Let me explain. Let's consider the saveMeasureFromLCOVFile method of the CoverageSensor.java: protected void saveMeasureFromLCOVFile(SensorContext context) { String providedPath = settings.getString(JavaScriptPlugin.LCOV_REPORT_PATH); File lcovFile = getIOFile(fileSystem.baseDir(), providedPath); ... LOG.info("Analysing {}", lcovFile); LCOVParser parser = new LCOVParser(fileSystem.baseDir()); Map&lt;String, CoverageMeasuresBuilder&gt; coveredFiles = parser.parseFile(lcovFile); for (InputFile inputFile : fileSystem.inputFiles(mainFilePredicate)) { try { CoverageMeasuresBuilder fileCoverage = coveredFiles.get(inputFile.file().getAbsolutePath()); org.sonar.api.resources.File resource = org.sonar.api.resources.File.create(inputFile.relativePath()); if (fileCoverage != null) { for (Measure measure : fileCoverage.createMeasures()) { context.saveMeasure(resource, measure); } } else { // colour all lines as not executed LOG.debug("Default value of zero will be saved for file: {}", resource.getPath()); LOG.debug("Because: either was not present in LCOV report either was not able to retrieve associated SonarQube resource"); saveZeroValueForResource(resource, context); } } catch (Exception e) { LOG.error("Problem while calculating coverage for " + inputFile.absolutePath(), e); } } } First, it reads the lcov.info file given to know for which files we have coverage data (retrieved by parsing the file, done with LCOVParser class). After that, it takes the same file from the coveredFiles map to do the matching between metrics and code. If the file is not found (else part of the if (fileCoverage != null) {), then the code coverage is forced to 0. That's what happened on my project. So why is it happening? Simply because in my environment, inputFile is equals to d:\dev\my-application\app\scripts\app.js and in coveredFiles map…
has comment: http://stackoverflow.com/comment/45762133
upvote count: 6
has comment: http://stackoverflow.com/comment/45924483
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28702990
has comment: http://stackoverflow.com/comment/45927652

http://stackoverflow.com/q/28677866
has answer: http://stackoverflow.com/a/28677952
type: Question
has comment: http://stackoverflow.com/comment/45649278
score: 3
has body: If I use a server-side redirect in ASP.NET code, I know that it will raise a ThreadAbortException and so all processing on the page will immediately stop and the redirect will happen straight away (after "finally" clauses). However, Say I do a redirect inside a JavaScript block (by setting location.href or using location.replace), when does this redirect actually take effect? Reloading the page would obviously unload the current script block but based on a quick test, an alert statement after the redirect still works. Does the redirect take place only once processing of the current event has completed? More importantly is this behaviour standardized, or just a de-facto convention?
tagged with: javascript
has answer: http://stackoverflow.com/a/29558360
upvote count: 3
answer count: 2
favorite count: 0
has comment: http://stackoverflow.com/comment/45648885
type: UnansweredQuestion
tagged with: http-redirect
has title: When does a JavaScript redirect actually take effect?
downvote count: 0

http://stackoverflow.com/q/28719565
downvote count: 0
tagged with: javascript
tagged with: phonegap-plugins
has body: How can I pop the list of my clients on the screen, the list is coming from my database, I have 11 rows of clients and I want to create a listview of those and show them, this is my code: dbFactory.method = function findAll() { db.transaction( function(tx) { var sql = "SELECT (nome) as nomes FROM clientes"; log(sql); tx.executeSql(sql, [], function(tx, results) { var len = results.rows.length, clientes = [], i = 0; for (; i < len; i = i + 1) { clientes[i] = results.rows.item(i).nomes; } log(clientes + ' found'); } ); },txErrorHandler, function () { } ); }; Controller: .controller('ListaCtrl', function ($scope, dbFactory) { $scope.items = dbFactory.method(); console.log(dbFactory.method()); }); clientes.html: {{itens.nome}} The log: Promise {$$state: Object, then: function, catch: function, finally: function} $$state: Object status: 1 value: SQLResultSet insertId: [Exception: DOMException: Failed to read the 'insertId' property from 'SQLResultSet': The query didn't result in any rows being added.] rows: SQLResultSetRowList length: 11 __proto__: SQLResultSetRowList rowsAffected: 0
score: 2
accepted answer: http://stackoverflow.com/a/28734313
favorite count: 0
tagged with: cordova
tagged with: angularjs
upvote count: 2
has answer: http://stackoverflow.com/a/28719774
type: AnsweredQuestion
has title: Fetch and display data from database in AngularJs
possible better answer: http://stackoverflow.com/a/28719774
tagged with: ionic-framework
type: Question
has answer: http://stackoverflow.com/a/28734313
answer count: 2

http://stackoverflow.com/comment/45590688
type: Comment
has text: I can't use POST instead of GET, 'cause I am using POST for other purpose. Also I tried sending JSON : var postdata = { data: param }; $http.get('/Login/Login', postdata) But it also not working.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28646418

http://stackoverflow.com/q/28693852
has body: Trying to start strongloop as it prescribed on http://strongloop.com/ slc arc "arc" is not an slc command. See `slc --help` for more information. how should i do it now?
has comment: http://stackoverflow.com/comment/45748611
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45694832
tagged with: node.js
tagged with: strongloop
answer count: 0
downvote count: 0
has comment: http://stackoverflow.com/comment/45759119
score: 1
type: Question
has title: what should i use instead of "slc arc" in strongloop example?
tagged with: javascript
has comment: http://stackoverflow.com/comment/45721098
upvote count: 1
favorite count: 0

http://stackoverflow.com/q/28743686
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45770962
tagged with: node-webkit
has comment: http://stackoverflow.com/comment/45771193
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45771510
accepted answer: http://stackoverflow.com/a/28744551
has comment: http://stackoverflow.com/comment/45771092
has comment: http://stackoverflow.com/comment/45771358
has comment: http://stackoverflow.com/comment/45771323
answer count: 1
tagged with: javascript
has body: I try to make a stand-alone webapp by using Node-Webkit and AngularJS. I following the AngularJS.org tutorial but i encounter an error when i try to create the angular module. Error: [$injector:modulerr] Failed to instantiate module hecktelionApp due to: Error: [$injector:nomod] Module 'hecktelionApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. My project hierarchy is as follows: root-app-folder ├── index.html ├── package.json ├── js\ │ └── app.js └── node_modules\ └── angular\ And here are my files index.html Hecktelion : Legacy Hello world ! app.js 'use strict'; global.document = window.document; var angular = require('angular'); var hecktelionApp = angular.module('hecktelionApp', []); package.json { "name": "Hecktelion", "main": "index.html", "author": "Toxicat <marc.guilmard@gmail.com>", "window": { "toolbar": false, "width": 1280, "height": 1024 }, "dependencies": { "angular": "^1.3.14" } } Which i made wrong ?
score: 0
has comment: http://stackoverflow.com/comment/45770463
has comment: http://stackoverflow.com/comment/45779671
has answer: http://stackoverflow.com/a/28744551
tagged with: node.js
has comment: http://stackoverflow.com/comment/45771492
has title: Failed to instantiate module, AngularJS + NodeWebkit
has comment: http://stackoverflow.com/comment/45770649
has comment: http://stackoverflow.com/comment/45770913

http://stackoverflow.com/a/28770202
has body: Tern has both a CodeMirror plugin and a set of type definitions for jQuery. Putting those pieces together should give you the result you want, though some programming is required to integrate the Tern plugin.
accepted answer of: http://stackoverflow.com/q/28744535
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28744535
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45530533
type: Comment
has text: do you know how to use the `console`?
type: AnswerComment
comment on: http://stackoverflow.com/a/28610839
score: 0

http://stackoverflow.com/q/28696408
has comment: http://stackoverflow.com/comment/45683187
has body: I'm new to the AJAX and PHP. I'm currently facing a problem with calling an jQuery confirm box function and insert the data into the database. When i clicked submit button, the ajax should called the confirm box function in jquery then when user clicked "YES" only the data will be inserted into the database. (The data contain of text filed and image file upload). But when i clicked the submit button, it straight away lead me to the bannerItem.php which is wrong. Here is the AJAX code that i use to call the confirm box function and run the php code: //File and text upload with formDATA function $("form#form").confirm(function(){ var formData = new FormData($(this)[0]); confirm: function(){ $.ajax({ url:'bannerItem.php', type: 'POST', data: formData, async: false, success: function (data) { if(!alert('Banner Had Successfully Updated.')){location.reload();} }, cache: false, contentType: false, processData: false }); return false; } }); Here is the bannerItem.php code: <?php include 'dbConnection.php'; global $dbLink; $target_file = basename($_FILES['uploaded_file']['name']); $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); //Check image file type //Gather all required data $item_id = $dbLink->real_escape_string($_POST['banner_id']); $name = $dbLink->real_escape_string($_POST['bannerName']); $data = $dbLink->real_escape_string(file_get_contents($_FILES['uploaded_file']['tmp_name'])); if(!isset($mydata) || $mystring == null){ //Create the SQL query $query = "UPDATE banner_item SET banner_name='$name', banner_created=NOW() WHERE banner_item_id = '$item_id' "; //$query = "INSERT INTO banner_item (banner_item_id, banner_name,banner_data,banner_created) VALUES ('{$item_id}','{$name}','{$data}', NOW())"; } else if($name==''){ //Create the SQL query $query = "UPDATE banner_item SET banner_data='$data', banner_created=NOW() WHERE banner_item_id = '$item_id' "; //$query = "INSERT INTO banner_item (banner_item_id, banner_name,banner_data,banner_created) VALUES ('{$item…
has comment: http://stackoverflow.com/comment/45683848
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/45683307
tagged with: php
answer count: 0
type: UnansweredQuestion
type: Question
has title: Failed to call AJAX confirm function and insert text value and image into database
tagged with: javascript
has comment: http://stackoverflow.com/comment/45683624
score: 0
has comment: http://stackoverflow.com/comment/45683088

http://stackoverflow.com/comment/45501339
comment on: http://stackoverflow.com/a/28596255
score: 0
type: Comment
has text: Note that `Q.Promise` is often easier to use since you don't have to think about about promises and deferreds. ES6 standard promises and Bluebird also only provide the promise constructor, so I'd recommend using that.
type: AnswerComment

http://stackoverflow.com/q/28628288
tagged with: css
has answer: http://stackoverflow.com/a/28628302
score: 2
downvote count: 0
type: Question
tagged with: javascript
has title: How can i set multiple CSS class from JavaScript
tagged with: class
has body: I have the following CSS: .a { position: absolute; } .a .b { color: red } .a .c { color: green } How can i set the ".a .b" class for element with Java Script?
upvote count: 2
answer count: 1
has comment: http://stackoverflow.com/comment/45557094
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/45737973
comment on: http://stackoverflow.com/a/28724862
score: 0
type: Comment
has text: @Jamiec Thanks for the input, I wasn't aware of the differences between the two but will be sure to use this going forward.
type: AnswerComment

http://stackoverflow.com/q/28743161
tagged with: css
score: 0
has answer: http://stackoverflow.com/a/28743243
has body: I want to recreate a tab like this in the below link so when u for instance click on another tab it remove the content and loading the new with a loading image. In below link try and click under 21 in the tab and u see it slides the content out and show loading image and then show the new content? How can i achieve similar effect? So far i've tried by using pure css/html tabs however it seems like it cant be done that way. http://themes.goodlayers.com/realsoccer/fixtures-results/
tagged with: javascript
has title: Loading content when switching tab
type: UnansweredQuestion
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/45769371
type: Question
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28620300
answer count: 2
tagged with: function
has title: countBy Method into a Function using Javascript
has answer: http://stackoverflow.com/a/28620395
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28620395
type: Question
type: AnsweredQuestion
has body: I'm trying to write a countBy function, identical to the countBy method in Javascript. Here is what I have so far: var array = [1,2,4,4,5]; function countBy(collection, func) { var object = {} ; for (var i=0;i&lt;=0; i++) { for (var key in object) { if (func(collection[i]) === object.key) { object.key ++; } else { object.key = 1; } } } return object } alert(countBy(array, function(n) {return Math.floor(n);})); What the code intends to do is search through the collection array to see if a value there matches a key in object. If it has found a match in the collection array, increment that key value by one. If it has not found one, create a new key value. Therefore, the result that should be alerted is: {4:2, 1:1, 2:1, 5:1}. But it seems like my output is [object Object]. What am I doing wrong??
possible better answer: http://stackoverflow.com/a/76403826
tagged with: methods
has answer: http://stackoverflow.com/a/76403826

http://stackoverflow.com/q/28665277
score: 1
tagged with: jquery
favorite count: 0
type: Question
has body: I try to scroll a list made by dynamically. I've found this answer, but it did not help me. I guess that this is because my list is a dynamic list. How can I do? I want to scroll dynamic list on select value. This is a fiddle with my code: http://goo.gl/Tv7wvj and this is my code HTML CSS .scroll{ overflow-y: scroll; width:150px; height:80px; } Javascript $(document).ready( function() { var html = ''; for(i=0; i<10; i++){ if(i==6){ html += ' 0'+i+' '; continue; } html += ' 0'+i+' '; } $('ul').append(html); }); var $s = $('.scroll'); var optionTop = $s.find('[value="04"]').offset().top; var selectTop = $s.offset().top; alert("optionTop : "+optionTop+" / selectTop : "+selectTop); $s.scrollTop($s.scrollTop() + (optionTop - selectTop));
has answer: http://stackoverflow.com/a/29879714
has comment: http://stackoverflow.com/comment/45625807
tagged with: cordova
has title: Scroll dynamic listview in jquery
linked to: http://stackoverflow.com/q/7205702
upvote count: 1
answer count: 1
type: UnansweredQuestion
tagged with: jquery-mobile-listview
downvote count: 0
tagged with: jquery-mobile
tagged with: javascript

http://stackoverflow.com/comment/45772285
type: Comment
comment on: http://stackoverflow.com/q/28744562
has text: Sorry forgot to mention that the extension saves the random image as the one image to use for that day.
score: 0
type: QuestionComment

handsontable
tags question: http://stackoverflow.com/q/28616325
tags question: http://stackoverflow.com/q/28628251
type: Tag
tags question: http://stackoverflow.com/q/28719006
tag name: handsontable
tags question: http://stackoverflow.com/q/28718223

http://stackoverflow.com/q/28656956
has comment: http://stackoverflow.com/comment/45610703
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: angularjs-ng-route
has title: Passing parameters to a resolve function
type: Question
has comment: http://stackoverflow.com/comment/45610685
tagged with: javascript
has answer: http://stackoverflow.com/a/28657320
upvote count: 2
has comment: http://stackoverflow.com/comment/45610294
answer count: 2
has answer: http://stackoverflow.com/a/28657501
accepted answer: http://stackoverflow.com/a/28657501
has comment: http://stackoverflow.com/comment/45610790
possible better answer: http://stackoverflow.com/a/28657320
favorite count: 0
has body: I'm having trouble figuring out how I could pass a parameter to a function that is a part of resolve of ngRoute. In my case I'm doing stuff with tokens. These tokens are typed, so you cannot use the same token for confirming and email and reseting a password. Here's how my routes are defined: .when("/confirm/:token", { controller: "confirmEmailController", templateUrl: "/app/views/confirmEmail.html", resolve: { tokenStatus: getTokenStatus } }) .when("/reset/:token", { controller: "resetPasswordController", templateUrl: "/app/views/resetPasswordEmail.html", resolve: { tokenStatus: getTokenStatus } }) Here's the getTokenStatus function that's being called for both of them: var getTokenStatus = ["$q", "$route", "tokenService", function($q, $route, tokenService) { var deferred = $q.defer(); var tokenType = ???? //&lt;-- how do I pass this? tokenService .getTokenStatus($route.current.params.token, tokenType) .success(function(response) { deferred.resolve(true); }) .error(function() { deferred.resolve(false); }); return deferred.promise; }]; The problem is that in order to avoid code duplication I need to somehow pass the value of the token type, as marked in the code. How could I do that? I've been messing about with this for the last 2 hours, but can't seem to figure it out.
tagged with: angularjs

http://stackoverflow.com/comment/45691130
type: Comment
type: QuestionComment
has text: You should also learn a bit about arrays, since you're basically adding values to one, the behavior is expected.
comment on: http://stackoverflow.com/q/28700377
score: 0

http://stackoverflow.com/q/28750095
has answer: http://stackoverflow.com/a/35492942
tagged with: javascript
score: 0
tagged with: infovis
answer count: 1
tagged with: thejit
tagged with: jquery
favorite count: 0
tagged with: space-tree
type: UnansweredQuestion
has title: Space tree toggle functionality
upvote count: 1
has comment: http://stackoverflow.com/comment/45795757
downvote count: 1
type: Question
has body: I am working onspace tree provided on this link Space Tree Animation.For the past 3 hours I am trying to add toggle functionality in this tree. For example if I click a node and all of its childrens are opened then it should collapse and vice versa.So in simple I want sort of toggle functionality.How can I acheive this?.Secondly when I click on one node it's sibblings get collapsed how can I stop this?.It's a bit complex for me to sort it out.Any help will be appreciated.

http://stackoverflow.com/comment/84308415
score: 0
type: Comment
has text: I managed to get this working with the first and the last functions but I'm not sure I understand what the second-to-last function is for (the "idToDLET" code)...
comment on: http://stackoverflow.com/a/28620297
type: AnswerComment

http://stackoverflow.com/q/28720769
has body: This might be a novice question, but I wonder why React.js renders the component twice - once when the getInitialState() lifecycle method is called, and once after componentDidMount(). What are the specific cases where you might want to render something before componentDidMount()?
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45730025
type: Question
has comment: http://stackoverflow.com/comment/45728982
tagged with: javascript
has title: Rendering once from getInitialState, and again after componentDidMount
has answer: http://stackoverflow.com/a/28721148
tagged with: reactjs
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28721148
type: AnsweredQuestion

http://stackoverflow.com/comment/45791818
has text: Thank you. I overlooked the obvious.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28749006
type: AnswerComment

http://stackoverflow.com/comment/45603757
has text: @FelixKling isn't this an edge case? If I understand your code, in each step we pop up the last element of the array. At the end the array would be empty. Correct? Could we do the same for the scenario of OP ?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28653203
type: Comment

http://stackoverflow.com/a/28731687
answers question: http://stackoverflow.com/q/28731558
type: Answer
score: 0
has body: Maybe try looping through the array and every time you find a match sending out the alert alert(searchValue + " found with index(" + $.inArray(searchValue, array2) + ") in array"); (Sorry I couldn't put this as a comment, I don't have 50 reputation yet.

http://stackoverflow.com/comment/45582637
comment on: http://stackoverflow.com/q/28641959
has text: i think you don't need a regex for this.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28629628
type: Answer
has body: You just can't this would mean a big security leak. this would mean you could actually upload any files of some computer to a server. The only way you can do this is by uploading it trough a file element in html. HTML5 fileReader does allow you to work with local files,but only trough a file element. So the user select the file themselves or save the file in local storage instead of on the disc.
answers question: http://stackoverflow.com/q/28629545
score: 2
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/45556680
comment on: http://stackoverflow.com/a/28627395
score: 0
type: AnswerComment
type: Comment
has text: Like I said, you need to read the documentation of the framework. I don't know that function, I'm just guessing. Maybe you can give it multiple attribute arguments.

http://stackoverflow.com/q/28701399
answer count: 2
upvote count: 0
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
downvote count: 1
has answer: http://stackoverflow.com/a/28701717
has body: I am completely new to ANgularJs. As part of one project my page should show some content dynamically is changes in database. This changed vale can be obtained by a http get. Before I try the complete scenario, I just wanted to see if is working atleast locally by taking a local variable. But its not working please suggest me how do I handle this. angular.module('MyApp') .controller('HomeCtrl', function HomeCtrl($scope, $alert, $auth,$location) { Counter=10; Counter=Counter+1; $scope.user={}; $scope.user.counter=Counter; } HomeCtrl($scope,$alert,$auth,$location); );
has comment: http://stackoverflow.com/comment/45693241
type: Question
has answer: http://stackoverflow.com/a/28701605
tagged with: javascript
has title: Angular Js how to show dynamic content
score: -1

http://stackoverflow.com/a/28695473
type: Answer
answers question: http://stackoverflow.com/q/28695154
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28695154
upvote count: 1
has body: Compare answer to value in checkAnswer: if (checkAnswer.value == answer) { //correct }else{ //incorrect }
type: AcceptedAnswer

http://stackoverflow.com/comment/84722981
comment on: http://stackoverflow.com/a/28656242
score: 1
type: Comment
has text: @Tom Is this JSFiddle supposed to work? All I see is a white area where the output/click events should be occurring.
type: AnswerComment

http://stackoverflow.com/a/28739958
has comment: http://stackoverflow.com/comment/45772375
type: Answer
answers question: http://stackoverflow.com/q/28739848
score: 1
upvote count: 1
has body: Test is an object, not a "namespace" or a function, although sometimes people call objects that you put properties on namespaces (they aren't, really). I'm not sure why you'd want to, but you can use Test as the prototype of Test2 by doing this: var Test2 = Object.create(Test); Now things like this work: var c = new Test2.Car(); ...because Test2 inherits Car from Test. If you wanted to create a Car2, that's slightly more involved: var Car2 = function() { // Or `Test.Car2 = function` or whatever Test.Car.apply(this, arguments); // Or: `Test.Car.call(this, "specific", "arguments", "here");` // ...Car2 stuff... }; Car2.prototype = Object.create(Test.Car.prototype); Car2.prototype.constructor = Car2;
downvote count: 0

http://stackoverflow.com/a/28612856
type: Answer
upvote count: 1
has body: This can be converted into a one-liner: foo &amp;&amp; foo.baz === baz ? function2() : function1(); If foo is falsey then it will execute function1 and if foo is truthy but foo.baz !== baz then it will still execute function1. Otherwise, it will execute function2. The reason this works is because if foo is truthy and foo.baz !== baz is false then function2 is only executed if foo.baz === baz is true.
answers question: http://stackoverflow.com/q/28612737
score: 1
accepted answer of: http://stackoverflow.com/q/28612737
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28602712
has title: jQuery Form Validation Plugin's issue with only literal field
tagged with: regex
accepted answer: http://stackoverflow.com/a/28602888
type: AnsweredQuestion
type: Question
has body: I've got this issue: i created an additional rule that checks if a field match a regular expression. Everything works flawless with every other fields but when i validate one that has maxlength = 1, it just doesn't work. Here is the HTML FIELD And here is the Javascript code $('#form').validate({ rules: { field: { required: true, accept: '[a-zA-Z]+', maxlength: 1 }, }, messages: { field: { required: 'blablabla', accept: 'bububu', maxlength: 'not 1' } } });
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28602888
score: 0
tagged with: validation
tagged with: http://stackoverflow.com/tag/html
answer count: 1

intro.js
tags question: http://stackoverflow.com/q/28717206
type: Tag
tag name: intro.js

http://stackoverflow.com/q/28615950
has body: My model lop is contains a list of programs which I use for varying purposes. I want to use the name field as an argument for a javascript function. I modified some of my lops so the modified versions have a "ver2" at the end of its name. What the Javascript function does is that it checks for the suffix "ver2" of the program. The javascript was originally found from here. I read some similar questions and one of them said that I need to serialize the object EDIT: Expanded view of views.py, Javascript console started working and now is included. In my views.py (UPDATED) from django.core import serializers . . . . def loppage(request): jsondata = serializers.serialize('json', lop.objects.all(),fields=('name')); ## get programs data = [] types = Type.objects.all() for type in types: data.append([type.title, type.script_set.all()]) context = {'lop': Lop.objects.all(), 'cat': data, 'jsondata':jsondata} ## render list return render(request, 'loppage.html', context) In my templates file: Javascript/HTML (loppage.html): . . . . {% for lop in type %} {{lop.options}} {{lop.name}} {% endfor %} But for whatever reason, the script doesn't seem to load (it loads as if the script wasn't even though). As wardk suggested, I have now included my Javascript console which can be seen here SyntaxError: invalid property id loppage:56:28 It's a long repetition of this same error on the same line as shown below Debugger console highlights if (endsWithsuffix([{"pk": 2, "model": "programs.lop", I've been working on this way longer than I should but I can't get anywhere with it. Help.
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/28623344
type: UnansweredQuestion
tagged with: django
linked to: http://stackoverflow.com/q/280634
linked to: http://stackoverflow.com/q/16740546
has comment: http://stackoverflow.com/comment/45538790
tagged with: http://stackoverflow.com/tag/json
type: Question
has title: Using django variables in Javascript
tagged with: javascript
has comment: http://stackoverflow.com/comment/45546234

http://stackoverflow.com/comment/45593686
score: 0
comment on: http://stackoverflow.com/q/28634942
has text: You can easily test it by compiling and adding `define(['views'], function() {});` in your project. That should load the compiled views. If it does not work your paths are probably wrong.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45587574
comment on: http://stackoverflow.com/q/28644634
has text: √ Works for me - Node.js 0.12 and CoffeeScript 1.9.1 . Perhaps try to load it as `require('coffee-script/register')`. It should be the same, but perhaps there is some strangeness going on.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45700505
type: Comment
has text: @wessy: So I guess the comment in the code `//The alert box does not even show up.` was incorrect. It shows up but you are not getting the result you expected. If you ask a question, make sure you describe everything properly.
comment on: http://stackoverflow.com/a/28705351
score: 0
type: AnswerComment

http://stackoverflow.com/a/28620149
has comment: http://stackoverflow.com/comment/45543131
has comment: http://stackoverflow.com/comment/45543963
has comment: http://stackoverflow.com/comment/45543809
has comment: http://stackoverflow.com/comment/45543258
has comment: http://stackoverflow.com/comment/45543426
type: Answer
has comment: http://stackoverflow.com/comment/45543403
has body: Your HTML is invalid. You can't have as a child of The children of must be table elements like , , , or . When you give invalid HTML like this, the browser tries to fix it up, and different browsers do this differently. What's happening is that the submit button is not connected to the form properly, so it's not sending to the action URL. Instead of putting the form inside the table, put the table inside the form: ... Also, your and tags aren't matched up properly: you have 8 and 9 .
score: 0
answers question: http://stackoverflow.com/q/28619984

http://stackoverflow.com/comment/45573474
comment on: http://stackoverflow.com/a/28636628
has text: Could this line be omitted? `Rectangle.prototype.constructor = Rectangle;` What does it do?!
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45745759
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28726244
has text: What is url in initialize(url)? That won't be assigned by the onload call.

http://stackoverflow.com/q/28744756
answer count: 1
downvote count: 0
has body: Here is my problem I have declared my Collection outside MeteorisServer and MeteorisClient wrappers. var Items = new Meteor.Collection("items"); I then insert my Items Collection with array x and array z. Items.insert({ owner: x, post_id: z, draft: true }); When console.log(Items.find().fetch()) is outputted onto the screen server side I see this in the command line. Server { owner: [ 'Sneaker of the Week: \n\nThe women\'s Roshe Flyknit multi-color arrives soon. #roshe http://t.co/1Zfothclmz\n', 'Sneaker of the Week:\n\nThe men\'s Roshe Flyknit is now available: http://t.co/frqNCZQbS5 #roshe http://t.co/HOAbnKFUDZ\n', 'Modern comfort. The men\'s Roshe Flyknit is now available: http://t.co/zwTWPMpyYK #roshe http://t.co/l7ZLm67sNC\n', 'A full-fledged phenomenon, her destiny is to change tennis and the culture, one fallen rival at a time. #techpack http://t.co/TksxyQTUpr\n', 'Her youth conceals an aggressive game of precise strikes and high-tempo performances. #techpack http://t.co/khqgKdZsfv\n', 'Always ready, Genie Bouchard is steady crafting her legacy on the tennis court. #techpack http://t.co/U3WTP6Arax\n', 'Sneaker of the Week:\n\nThe men\'s Dunk CMFT is now available: http://t.co/WFFCBNxICZ http://t.co/OByzzLLdlL\n' ], post_id: [ 'http://pbs.twimg.com/media/B-f5AF0IcAAQkZY.jpg', 'http://pbs.twimg.com/media/B-eHJ8tIIAAFUgO.jpg', 'http://pbs.twimg.com/media/B-TZZx7IIAAH9EH.jpg', 'http://pbs.twimg.com/media/B-PBNPkCQAAJq0w.jpg', 'http://pbs.twimg.com/media/B-O_zjaCUAEb6Fj.jpg', 'http://pbs.twimg.com/media/B-O9HhQCAAAIxHM.jpg', 'http://pbs.twimg.com/media/B-ApJnQIgAQisgR.jpg' ], draft: true, _id: '3GW4oqzNHZw9p6yLQ' }, I then publish this on the server side // Publish the logged in user's posts Meteor.publish("posts-recent", function () { return Items.find({ owner: x }); }); Client To then receive it on the client-side. Meteor.subscribe('posts-recent'); var newItems = Items.find(); console.log(newItems); Console Unfortunately this just outputs an a reference to an e…
tagged with: insert
tagged with: meteor
has title: Unable to receive published Collection from Meteor server side
favorite count: 0
type: UnansweredQuestion
tagged with: publish-subscribe
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/28744916
tagged with: collections
type: Question
tagged with: javascript

http://stackoverflow.com/comment/45574693
type: AnswerComment
score: 0
has text: @rocket101 Yes, that means that your `Parse.Push.send()` is failing and that your error callback is being called. I wouldn't know why it is failing, but that's a completely separate matter from the issue in your question. I would suggest making use of the `error` parameter that you have there to get some idea of what went wrong: `status.error("Uh oh, something went wrong." + error);`
type: Comment
comment on: http://stackoverflow.com/a/28637041

http://stackoverflow.com/comment/45552655
type: AnswerComment
has text: Wonderful. Glad I was able to help. =)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28625868

http://stackoverflow.com/comment/45710601
comment on: http://stackoverflow.com/q/28710984
type: Comment
has text: You can't reliably get the IP address of a client machine. Even if you could, it wouldn't be useful. How many machines are there out there with an IP address of 192.168.1.1?
score: 1
type: QuestionComment

http://stackoverflow.com/q/28746698
has comment: http://stackoverflow.com/comment/45775720
tagged with: global-variables
has body: In the following code: var pie = []; function makeChart() { new Chart(document.getElementById("canvas").getContext("2d")).Doughnut( pie); }; var data = jQuery.getJSON('xxx', function(data) { pie = [{ value: data.company_live_ads, color: "#F7464A" }, { value: data.total_candidates, color: "#46BFBD" }, { value: data.company_ads_published_3days, color: "#FDB45C" }, { value: data.company_apps_today, color: "#4D5360" }]; makeChart(); }); The pie var is updated in the JSON function. Then the makeChart function is called. If I was to put console.log(pie) inside makeChart() it would print me the array Pie with figures. However, for some reason, it doesn't pass this var into the function that makes the chart. Moreover, if I put a var of pie inside this function with Dummy Data it generates the chart. I think this must have something to do with the scope, but I'm a little lost. Any help will be appreciated.
type: AnsweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/45776036
has answer: http://stackoverflow.com/a/28747938
type: Question
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45775931
tagged with: variables
tagged with: scope
has comment: http://stackoverflow.com/comment/45776239
accepted answer: http://stackoverflow.com/a/28747938
has comment: http://stackoverflow.com/comment/45775670
has comment: http://stackoverflow.com/comment/45776145
has comment: http://stackoverflow.com/comment/45776362
has title: Accessing vars inside functions

http://stackoverflow.com/q/28646684
has comment: http://stackoverflow.com/comment/45594582
has answer: http://stackoverflow.com/a/28651340
has comment: http://stackoverflow.com/comment/45593057
tagged with: promise
linked to: http://stackoverflow.com/q/22519784
linked to: http://stackoverflow.com/q/23803743
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/25751723
has body: I'm getting all the subwebs from a site in my app in SharePoint with: var getW = getWebs($q) .then(function (results) { console.log(results); // Object with results from the first execute. }); function getWebs($q) { var deferred = $q.defer(); //App context etc.. web = appContextSite.get_web(); subWebs = web.getSubwebsForCurrentUser(null); context.load(subWebs, 'Include(Url, Created, Title, Lists)'); context.executeQueryAsync(Function.createDelegate(this, function () { enumSubWebs = subWebs.getEnumerator(); var arraySubWebs = []; var list = []; while (enumSubWebs.moveNext()) { var subWeb = enumSubWebs.get_current(), subWebUrl = subWeb.get_url(); var _list = subWeb.get_lists().getByTitle('Custom List'); list.push({ 'listItem': _list.getItemById(1), 'webTitle': subWeb.get_title() }); context.load(list[list.length - 1].listItem); promises.push(list); } context.executeQueryAsync(Function.createDelegate(this, function () { for (var i = 0; i &lt; list.length; i++) { console.log(list[i].listItem.get_fieldValue()['Title']); } // Not sure what to put here, because the promise is returned to my .then above before it enters here. })); Q.allSettled(promises).then(function () { deferred.resolve(list); }); })); return deferred.promise; }; Then I would like to get a list item by ID (in 'Custom list') from each web. I'm not sure where I'm doing anything wrong, but the the webs (incl list array) is returned, but listItem doesn't seems to be executed. How should I use the promise to return everything after the last executeQuery?
type: Question
has answer: http://stackoverflow.com/a/28659430
tagged with: javascript
has comment: http://stackoverflow.com/comment/45593201
tagged with: sharepoint
has title: JavaScript/promise, multiple async calls to sharepoint
score: 0
answer count: 2

http://stackoverflow.com/comment/45642340
type: Comment
comment on: http://stackoverflow.com/q/28674459
type: QuestionComment
has text: On codepen. at the top of each language editor => do you see the small Gear icons next to HTML, CSS, and JS? Click those gears and it shows you external files the author is using. In this case, jQuery, bootstrap.js, and underscore.js. Your code is basically HTML that is being manipulated by JavaScript, so if you aren't sure why it isn't working I would include all of the references as you get started.
score: 0

http://stackoverflow.com/comment/45706091
score: 0
comment on: http://stackoverflow.com/q/28706144
type: Comment
type: QuestionComment
has text: It is definitely a setting on my browser. I deny geolocation.

http://stackoverflow.com/q/28665614
possible better answer: http://stackoverflow.com/a/28665710
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28665710
has title: jQuery get id of element that triggered event from nested function
has body: How do I get the id of the ".item" element from inside the getJSON function? jQuery(document).ready(function() { $(".item").tooltip({ items: "div", content: function(callback) { $.getJSON('mydata.json', function(data) { var country = event.target.id; console.log(country); }); } }); }); I've seen an explanation here, but I'm not sure how to pass the event(s) in my case.
answer count: 3
downvote count: 0
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/48239
favorite count: 0
has answer: http://stackoverflow.com/a/28665735
tagged with: jquery-ui-tooltip
has answer: http://stackoverflow.com/a/28665756
has comment: http://stackoverflow.com/comment/45627733
has comment: http://stackoverflow.com/comment/45626186
score: 1
upvote count: 1
accepted answer: http://stackoverflow.com/a/28665756
type: Question

http://stackoverflow.com/q/28717942
type: Question
has comment: http://stackoverflow.com/comment/45723810
tagged with: javascript
tagged with: jquery
has title: Append whole list in jquery
score: 0
has body: I am trying to implement lazy load in a hybrid app where in i am retrieving some value from database and storing it in a jquery template and displaying it in a list view. Now i added these below codes for lazyload function addMore(page) { $.mobile.loading("show", { text: "loading more..", textVisible: true, theme: "b" }); setTimeout(function () { //var items = $("#limsglist").val(); var items ='A'; $("#divName", page).append(items).listview("refresh"); $.mobile.loading("hide"); }, 500); } /* scroll event */ $(document).on("scrollstop", function (e) { var activePage = $.mobile.pageContainer.pagecontainer("getActivePage"); console.log("adding..."); addMore(activePage); }); Now my jquery template looks somewhat like this, $("#templateName").tmpl(result.Values).appendTo("#divName") List view some what looks like this. So Now in place of $("#divName", page).append(items).listview("refresh"); items,i want that entire list to be displayed. Any help appreciated.
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45724863
has comment: http://stackoverflow.com/comment/45725531
has comment: http://stackoverflow.com/comment/45725185
has comment: http://stackoverflow.com/comment/45724588
has comment: http://stackoverflow.com/comment/45725266
has comment: http://stackoverflow.com/comment/45724804

http://stackoverflow.com/q/28656284
accepted answer: http://stackoverflow.com/a/28656301
favorite count: 0
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28656301
has answer: http://stackoverflow.com/a/28656348
tagged with: javascript
tagged with: jquery
upvote count: 3
possible better answer: http://stackoverflow.com/a/28656348
has title: jQuery counting elements with attributes
has body: I have a jQuery code wich is counting some divs where certain Breakfast board are found as below var board_bb1 = $('div[data-board="Bed And Breakfast"]').length; var board_bb2 = $('div[data-board="Breakfast"]').length; var board_bb3 = $('div[data-board="Breakfast Buffet"]').length; var board_bb4 = $('div[data-board="Breakfast (Full Breakfast)"]').length; var board_bb5 = $('div[data-board="Continental Breakfast"]').length; var board_bb8 = $('div[data-board="Bed and Breakfast"]').length; var board_bb6 = $('div[data-board="Full Breakfast"]').length; var board_bb7 = $('div[data-board="Breakfast (Continental Breakfast)"]').length; var board_bb = board_bb1 + board_bb2 + board_bb3 + board_bb4 + board_bb5 + board_bb6 + board_bb7 + board_bb8; The attributes from data-board are coming from an API service, and sometimes is breakfast sometimes is Breakfast, bed And Breakfast etc. Is there a way to simply the above code to count all the divs who has the word Breakfast in data-board
type: AnsweredQuestion
score: 3
downvote count: 0

http://stackoverflow.com/comment/45828652
type: Comment
comment on: http://stackoverflow.com/a/28710802
has text: just for Chrome v40? Yeesh. Does not suprise me, that browser is all about doing funky optimizations for speed, naturally that would backfire and make something redraw slower than FF! Hope any of that code helped you out a little!
score: 0
type: AnswerComment

http://stackoverflow.com/comment/77958596
type: AnswerComment
comment on: http://stackoverflow.com/a/28650165
has text: anyone found a better solution? not a fan of `setTimeout()` :p
type: Comment
score: 0

http://stackoverflow.com/q/28611368
favorite count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: charts
answer count: 0
tagged with: jqplot
type: Question
score: 2
has title: jqPlot automatic height
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I have a serious problem with the canvas height of my jqplot graph. It is an horizontal bar graph. The number of bars is dynamic, so the height of the canvas SHOULD BE dynamic as well. What I get is that whatever is the number of bars, the height of the canvas is always the same. barWidth, barMargin, barPadding are ignored. Here is my code: $.jqplot(tip, data, { stackSeries : false, captureRightClick : true, seriesDefaults : { renderer : $.jqplot.BarRenderer, rendererOptions : { barDirection : 'horizontal', barWidth : 15, barPadding : 5, barMargin : 15, highlightMouseDown : true }, shadowAngle : 135, pointLabels : { show : true, location : 'e', edgeTolerance : -40 } }, title : { show : true }, series : [{ label:'aaa' }], axesDefaults : { tickRenderer: $.jqplot.CanvasAxisTickRenderer , }, axes: { yaxis: { renderer: $.jqplot.CategoryAxisRenderer, } }, }); Does someone understand why height doesn't adapt automatically?

http://stackoverflow.com/q/28641645
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/28641767
has body: I am newbie to Angular.js so i am facing a problem while calling the function in directives from index.html. When the user enter his phone number i have to call function in Directives.js which is to validate is the number is already exist or not. But i am not getting how to call the function. my html page ContactNo Enter a valid contactno. my Directive.js file: myAppDirectives. directive('phone', function() { return { restrice: 'A', require: 'ngModel', link: function(scope, element, attrs, ctrl) { console.log("test1"); angular.element(element).bind('blur', function() { var phnNum = this.value; $.ajax({ url: 'http://localhost:8989/users/'+phnNum, dataType: 'application/json', type: 'GET', success: function( data, status, headers, cfg ){ console.log("test2"); console.log("data" +data); console.log(jqXHR.responseText); }, error: function( jqXHR, textStatus, errorThrown ){ console.log("on success"); var result=jqXHR; //console.log("check" +result.responseText); console.log(jqXHR); console.log(result.responseText.length); if(result.responseText.length===0){ console.log("you can register now"); } else{ console.log("User with this number is already registered"); } } }); }); } } }); Can anyone please help me how to call phone() function in directives from my html page. Thanks in advance
downvote count: 0
has title: How to call a function in directives from index.html page in Angular.js
has answer: http://stackoverflow.com/a/28641718
accepted answer: http://stackoverflow.com/a/28641718
tagged with: angularjs-directive
type: AnsweredQuestion
score: 3
tagged with: javascript
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28641767
favorite count: 0
tagged with: ajax
upvote count: 3
tagged with: rest

http://stackoverflow.com/q/28731558
favorite count: 0
has comment: http://stackoverflow.com/comment/45751132
score: -1
has answer: http://stackoverflow.com/a/28732251
has title: Check if value exist in array
has answer: http://stackoverflow.com/a/28732543
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45749760
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28732349
has answer: http://stackoverflow.com/a/28731687
answer count: 6
has answer: http://stackoverflow.com/a/28732655
upvote count: 0
has comment: http://stackoverflow.com/comment/45749264
has answer: http://stackoverflow.com/a/28732513
tagged with: javascript
has body: I would like to check if values in Array1 exist in Array2. If it exist, then add the index for that value in a new array as a value. My solution below is doing almost that but it dosent alert me every same number, duplicates. For exampel the value 4355 in array1, its 3 of that value, but it only alert me 1 time. I would like to alert me every time. var array1 = []; array1.push(3545); array1.push(4355); array1.push(5435); array1.push(3457); array1.push(4355); array1.push(4355); var array2 = []; array2.push(1022); array2.push(4355); array2.push(2333); array2.push(5656); array2.push(1234); array2.push(5555); array2.push(7777); array2.push(3455); for(var i=0; i&lt;array2.length; i++){ checkIfExist(array2[i], array1); } function checkIfExist(searchValue, searchArray){ if ($.inArray(searchValue, searchArray) &lt; 0) { alert(searchValue + " not found"); } else { alert(searchValue + " found with index(" + $.inArray(searchValue, array2) + ") in array"); } }
tagged with: jquery

http://stackoverflow.com/q/28728083
score: 2
accepted answer: http://stackoverflow.com/a/28728276
has title: Set position background video html5
type: AnsweredQuestion
tagged with: video
has answer: http://stackoverflow.com/a/28728276
type: Question
upvote count: 2
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
has body: In full screen i would like to set my video on middle vertical position. I able to put the video on the Top or on the bottom by changing bottom: 0; or top: 0; on the video.fillWidth class but i can't set it on the middle position. I would like that : CSS : .header-unit { position: relative; height: 600px; } video { display: inline-block; } #video-container { z-index: -1; position: absolute; right: 0; left: 0; top: 0; bottom: 0; overflow: hidden; } video.fillWidth { bottom: 0; position: absolute; width: 100%; } @media (max-width: 1099px){ video.fillWidth{ height:100%; width:auto } } HTML : &lt;div class="header-unit"&gt; &lt;div id="video-container"&gt; &lt;video autoplay loop class="fillWidth"&gt; &lt;source src="movie.mp4" type="video/mp4"/&gt; &lt;/video&gt; &lt;/div&gt;&lt;!-- end video-container --&gt; &lt;/div&gt;&lt;!-- end .header-unit --&gt;
tagged with: css
favorite count: 0

http://stackoverflow.com/q/28735081
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45755176
tagged with: java
has title: Getting error While reading phone number from JSON in Angular.js
tagged with: mysql
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45755257
has answer: http://stackoverflow.com/a/28735318
score: 0
tagged with: rest
has comment: http://stackoverflow.com/comment/45755221
answer count: 1
has body: I am newbie to angular.js, I am developing a registration form, When the user fill the form and submits , getting the error as in the image I checked the error reference[org.vitti.bean.User] chain shown in error message, but i did not found any error there, in my mysql DataBat also i given my phone number type as BigInt.. But when i giving phone number as 9 digits it is accepting the form. Here is mu User.java class @Id @Column(name="phoneno", nullable=false) private Long phoneno; //---------------------------------------------------------------------- // GETTER &amp; SETTER FOR THE KEY FIELD //---------------------------------------------------------------------- public void setPhoneno( Long phoneno ) { this.phoneno = phoneno ; } public Long getPhoneno() { return this.phoneno; } Can anyone Please help me..
has comment: http://stackoverflow.com/comment/45755305
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45755315

angularjs
tags question: http://stackoverflow.com/q/28619894
tags question: http://stackoverflow.com/q/28671629
tags question: http://stackoverflow.com/q/28649395
tags question: http://stackoverflow.com/q/28749378
tags question: http://stackoverflow.com/q/28620479
tags question: http://stackoverflow.com/q/28637755
tags question: http://stackoverflow.com/q/28641645
tags question: http://stackoverflow.com/q/28732708
tags question: http://stackoverflow.com/q/28615998
tags question: http://stackoverflow.com/q/28735793
tags question: http://stackoverflow.com/q/28685344
tags question: http://stackoverflow.com/q/28730322
tags question: http://stackoverflow.com/q/28629432
tags question: http://stackoverflow.com/q/28749001
tags question: http://stackoverflow.com/q/28626746
tags question: http://stackoverflow.com/q/28680576
tags question: http://stackoverflow.com/q/28730090
tags question: http://stackoverflow.com/q/28632093
tags question: http://stackoverflow.com/q/28702986
tags question: http://stackoverflow.com/q/28750210
tags question: http://stackoverflow.com/q/28708121
tags question: http://stackoverflow.com/q/28628326
tags question: http://stackoverflow.com/q/28716433
tags question: http://stackoverflow.com/q/28651028
tags question: http://stackoverflow.com/q/28730502
tags question: http://stackoverflow.com/q/28604646
tags question: http://stackoverflow.com/q/28662917
tags question: http://stackoverflow.com/q/28654061
tags question: http://stackoverflow.com/q/28696960
tags question: http://stackoverflow.com/q/28674549
tags question: http://stackoverflow.com/q/28667366
tags question: http://stackoverflow.com/q/28746758
tags question: http://stackoverflow.com/q/28601409
tags question: http://stackoverflow.com/q/28620231
tags question: http://stackoverflow.com/q/28665264
tags question: http://stackoverflow.com/q/28747609
tags question: http://stackoverflow.com/q/28724945
tags question: http://stackoverflow.com/q/28745176
tags question: http://stackoverflow.com/q/28639715
tags question: http://stackoverflow.com/q/28688615
tags question: http://stackoverflow.com/q/28694759
tags question: http://stackoverflow.com/q/28596756
tags question: http://stackoverflow.com/q/28684735
tags question: http://stackoverflow.com/q/28733675
tags question: http://stackoverflow.com/q/28623031
tags question: http://stackoverflow.com/q/28725690
tags question: http://stackoverflow.com/q/28616618
tags question: http://stackoverflow.com/q/28626502
tags question: http://stackoverflow.com/q/28604475
tags question: http://stackoverflow.com/q/28637378
tags question: http://stackoverflow.com/q/28695776
tags question: http://stackoverflow.com/q/28635578
tags question: http://stackoverflow.com/q/28605350
tags question: http://stackoverflow.com/q/28690497
tags question: http://stackoverflow.com/q/28602911
tags question: http://stackoverflow.com/q/28636540
tags question: http://stackoverflow.com/q/28599203
tags question: http://stackoverflow.com/q/28656696
tags question: http://stackoverflow.com/q/28640047
tags question: http://stackoverflow.com/q/28701543
tags question: http://stackoverflow.com/q/28593750
tags question: http://stackoverflow.com/q/28743485
tags question: http://stackoverflow.com/q/28727380
tags question: http://stackoverflow.com/q/28602794
tags question: http://stackoverflow.com/q/28721024
tags question: http://stackoverflow.com/q/28638823
tags question: http://stackoverflow.com/q/28740050
tags question: http://stackoverflow.com/q/28695236
tags question: http://stackoverflow.com/q/28666452
tags question: http://stackoverflow.com/q/28642598
tags question: http://stackoverflow.com/q/28668592
tags question: http://stackoverflow.com/q/28610397
tags question: http://stackoverflow.com/q/28653391
tags question: http://stackoverflow.com/q/28679364
tags question: http://stackoverflow.com/q/28715901
tags question: http://stackoverflow.com/q/28703014
tags question: http://stackoverflow.com/q/28680604
type: Tag
tags question: http://stackoverflow.com/q/28619166
tags question: http://stackoverflow.com/q/28626700

http://stackoverflow.com/comment/45546739
type: Comment
has text: OP asking for vanilla
score: 0
comment on: http://stackoverflow.com/a/28622393
type: AnswerComment

http://stackoverflow.com/q/28655898
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: distinguish between two elements in html code
accepted answer: http://stackoverflow.com/a/28655953
has body: I am trying to understand how to distinguish between two buttons in my document, I want it to behave so that in addition to hiding the paragraphs, it also hides just the "Click Me!" button when clicking "Hide". Where am I going wrong? Click Me! Hide This is a paragraph with little content. This is another small paragraph.
type: AnsweredQuestion
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/28655948
has answer: http://stackoverflow.com/a/28655948
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28655953

http://stackoverflow.com/a/28616647
accepted answer of: http://stackoverflow.com/q/28616527
score: 0
type: AcceptedAnswer
has body: Sure, see this updated fiddle; Essentially you want to bind an event to the document using .on(), like: $(document).on('click', '.remove', function(e){ $(this).closest('.color-wap').remove(); }); I added the .color-wrap class to the #color div to avoid working with duplicated ID's via cloning, and added the .remove class to the remove button
type: Answer
answers question: http://stackoverflow.com/q/28616527

http://stackoverflow.com/comment/45542619
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28619914
has text: I've edited the code. The correct suggestion from the comments was to use a `google.maps.LatLng` instead of a `LatLngLiteral` (which will not be accepted by `containsLocation`). This was the only issue.
type: AnswerComment

http://stackoverflow.com/comment/45576321
type: Comment
comment on: http://stackoverflow.com/a/28637038
score: 0
type: AnswerComment
has text: What happened is it got translated into an HTML tag and is therefore not displayed. In ``sendAnswer.php`` you should convert the special characters into html special characters using ``htmlspecialchars()``.

global-variables
tags question: http://stackoverflow.com/q/28600279
tags question: http://stackoverflow.com/q/28746698
tags question: http://stackoverflow.com/q/28681168
tags question: http://stackoverflow.com/q/28640599
tag name: global-variables
type: Tag
tags question: http://stackoverflow.com/q/28748910

http://stackoverflow.com/q/28647492
possible better answer: http://stackoverflow.com/a/38511028
has answer: http://stackoverflow.com/a/40282914
has answer: http://stackoverflow.com/a/35928801
has answer: http://stackoverflow.com/a/48137193
linked to: http://stackoverflow.com/q/28278178
type: Question
tagged with: charts
type: AnsweredQuestion
tagged with: chart.js
has title: How to change colours for Angular-Chart.js
linked to: http://stackoverflow.com/q/28278096
has answer: http://stackoverflow.com/a/38511028
has body: I use Angular-Chart.js (the AngularJS Chart.js version) to create a bar chart. The Chart is working with the options except for the colours. Even if I set them it is indicated in the documentation, they stay grey. &lt;div class="graph-display" ng-controller="chartController"&gt; &lt;canvas class="chart chart-bar" data="bilans.data" labels="bilans.labels" series="bilans.series" options="{ scaleShowHorizontalLines: true, scaleShowVerticalLines: false, tooltipTemplate: '&lt;%= value %&gt; $', responsive: true }" colours="{ fillColor: 'rgba(47, 132, 71, 0.8)', strokeColor: 'rgba(47, 132, 71, 0.8)', highlightFill: 'rgba(47, 132, 71, 0.8)', highlightStroke: 'rgba(47, 132, 71, 0.8)' }" &gt;&lt;/canvas&gt; &lt;/div&gt; Actually, the options are working but the colours are not. Am I doing something wrong?
linked to: http://stackoverflow.com/q/37256487
tagged with: bar-chart
downvote count: 0
answer count: 7
tagged with: javascript
linked to: http://stackoverflow.com/q/37056480
score: 27
accepted answer: http://stackoverflow.com/a/28647813
favorite count: 0
has answer: http://stackoverflow.com/a/28654829
has answer: http://stackoverflow.com/a/42099859
upvote count: 27
has answer: http://stackoverflow.com/a/28647813
tagged with: angularjs

http://stackoverflow.com/a/28610509
has comment: http://stackoverflow.com/comment/45524868
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28610192
has comment: http://stackoverflow.com/comment/45532286
type: Answer
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/45524806
has body: You had a little typo in your focus code (you typed forms instead of form). Here's the correct code. function checkForm(form) { if(!form.terms.checked){ alert("Please indicate that you accept"); form.terms.focus(); // corrected "form" instead of "forms" return false; } return true; } Fiddle
upvote count: 3
answers question: http://stackoverflow.com/q/28610192

selenium-ide
tags question: http://stackoverflow.com/q/28670235
tags question: http://stackoverflow.com/q/28727882
tag name: selenium-ide
type: Tag

http://stackoverflow.com/comment/45629798
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28667515
has text: Sorry ... Editing...

http://stackoverflow.com/q/28679261
tagged with: jssor
has comment: http://stackoverflow.com/comment/45652859
score: 0
has title: Jssor-Slider - Change Thumb Text for Different Languages
answer count: 0
tagged with: javascript
type: UnansweredQuestion
has body: I am trying to change thumb Text with javascript. But I´m unable to select a Thumb-Div by giving it an ID and change the innerHTML. HTML &lt;img u=image src="../slideshow/img/03_SmartTurtle_Applications_Phone_Phonecall.jpg" /&gt; &lt;div u="thumb" id="test"&gt;&lt;/div&gt; Javascript var switchText = document.getElementById("test"); switchText.innerHTML = "new Text"; Also tried: &lt;img u=image src="../slideshow/img/03_SmartTurtle_Applications_Phone_Phonecall.jpg" /&gt; &lt;div u="thumb"&gt;&lt;div id="test"&gt;&lt;/div&gt;&lt;/div&gt; Could somebody help us, how can I change this dynamically. Thanks.
tagged with: jquery
type: Question
has comment: http://stackoverflow.com/comment/45653925

http://stackoverflow.com/a/28609374
upvote count: 3
answers question: http://stackoverflow.com/q/28609348
has body: $$('[id^=ajax_step]').on('submitted', function(e) { mainView.router.loadPage('transfer'+this.id.slice(9)); }); '[id^=ajax_step]' selects all elements whose id starts with "ajax_step".
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 3
accepted answer of: http://stackoverflow.com/q/28609348

http://stackoverflow.com/a/28740223
answers question: http://stackoverflow.com/q/28737274
has body: There can be many alternatives depending on the situations. I have made few minor changes to avoid the double click issue (comments amended). Basically we need to bind the mousedown event on the button object. There we will set a temporary flag variable to true. In the same time if input's change event gets fired then you can skip the checking if the temporary flag variable is true. Reason behind the double click for triggering the button's click event is better explained here: How to get jQuery click event after append in change event handler Your updated js code below: var mouseevent_var = false; function ValidateOnChange(e) { // Skip validation if the change event is fired due to user's click on submit button if(mouseevent_var){ return false; } var input = $('#txtInput').val(); if (input == 0) { $('#divError').hide(); } else { $('#divError').show(); } } function ValidateOnClick(e){ mouseevent_var = false; // Reset mouseevent_var to false alert("Hurray!!! You got it right!"); } $('#btnSubmit').mousedown(function (e) { mouseevent_var = true; }); jQuery(document).ready(function(){ $('#btnSubmit').click(function(e){ ValidateOnClick(e); }); $('#txtInput').change(function(e){ ValidateOnChange(e); }); //User don't want error when they are typing in. //$('#txtInput').keyup(function() { //$('#txtInput').trigger("change"); //}); }); The above code is just a fix as per your need. But there are other better alternatives too. Ideally you should not have two different validation functions for validating same fields on different events. You must think of managing it with a single function.
type: Answer
score: 0

http://stackoverflow.com/a/28620237
has body: The reason you only get the last href is because while iterates and call fineOne which is an asyc operation. while wont wait till the findOne finishes it just continue running by the time the findOne finishes while got to the end of the loop and that's why you're getting the same href. there are several ways you could do that, 1 promises(prefered in my opinion) - you will have to read about promisses to learn more. however checkout: https://github.com/petkaantonov/bluebird http://www.html5rocks.com/en/tutorials/es6/promises/ and http://promise-nuggets.github.io/articles/03-power-of-then-sync-processing.html Wrapping your async function in another function and binding whatever you want to it ( not a good option but possible) // wrapping your async function. var asyncFunction = function(title,href, successCb, failCb){ db.news.findOne({ title: title }, function(err, result){ if (err) { failCb(); } else { successCb() } }); }; var re = new RegExp("&lt;a href=\"(news[^?|\"]+).*?&gt;([^&lt;]+)&lt;/a&gt;", "g"); var match; while (match = re.exec(body)){ var href = match[1]; var title = match[2]; asyncFunction.call(this,title, href, function success(){}, function fail(){} ); }
has comment: http://stackoverflow.com/comment/45544520
upvote count: 1
has comment: http://stackoverflow.com/comment/45545030
score: 1
answers question: http://stackoverflow.com/q/28620161
downvote count: 0
type: Answer

http://stackoverflow.com/q/28748212
tagged with: password-recovery
has title: Invalid email when resetting password on Parse.com (JS SDK)
type: Question
tagged with: javascript
tagged with: ionic-framework
has body: I am trying to reset password on my angularjs App. I am using Parse (js SDK) as a backend. I am using Parse.User.requestPasswordReset as said in the doc, but I am always getting an error 125 invalid email address. Here is my html form : &lt;input type="email" ng-model="resetData.email" required&gt; &lt;button ng-click="resetPassword(resetData)"&gt; Ok &lt;/button&gt; Here is my controller : app.controller('userCtrl', function($scope, loginService){ $scope.resetPassword = function(resetData){ loginService.resetPassword(resetData,$scope); }; }); And finally here is my factory : app.factory('loginService', function(){ return{ resetPassword:function(resetData,scope){ console.log(resetData.email); Parse.User.requestPasswordReset(resetData.email,{ success:function(){ alert('You'll receive an email to reset your password'); }, error:function(error){ if (error.code === 205) { scope.msg_erreur='User not found'; console.log("error "+error.code+" "+error.message); } else{ scope.msg_erreur='Oops ! Something wrong happened'; console.log("error "+error.code+" "+error.message); }; } }) } } }); Good to know : the console.log(resetData.email) show the good email address. the email address I used are really in the User Class (if not there is an "error 205 user not found") I tried to put an email address directly in my code in the Parse.User.requestPasswordReset instead of resetData.email I tried with several email address, all are real ones. In every case I always have this error 125 invalid email address. Does anyone have an idea ? Thanks
downvote count: 0
answer count: 1
favorite count: 0
tagged with: parse-platform
tagged with: angularjs
type: UnansweredQuestion
score: 2
has answer: http://stackoverflow.com/a/29437524
upvote count: 2

recursion
type: Tag
tags question: http://stackoverflow.com/q/28667515
tags question: http://stackoverflow.com/q/28638187
tags question: http://stackoverflow.com/q/28673069
tags question: http://stackoverflow.com/q/28678092
tag name: recursion
tags question: http://stackoverflow.com/q/28734801
tags question: http://stackoverflow.com/q/28615822
tags question: http://stackoverflow.com/q/28738558
tags question: http://stackoverflow.com/q/28652950
tags question: http://stackoverflow.com/q/28655651
tags question: http://stackoverflow.com/q/28654767
tags question: http://stackoverflow.com/q/28607082
tags question: http://stackoverflow.com/q/28644673
tags question: http://stackoverflow.com/q/28656474
tags question: http://stackoverflow.com/q/28643604
tags question: http://stackoverflow.com/q/28632649

http://stackoverflow.com/comment/45750994
has text: Is `#content` inside `#nav` ?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28732355

http://stackoverflow.com/comment/45776664
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28726881
score: 0
has text: @alecxe Of course they have a test for it! :) maybe you should open an issue in jasminewd. And we could also ask jmr or hankduan

http://stackoverflow.com/comment/45588594
has text: I've tried but I don't know why this won't work. (PS. all content is reloaded by ajax)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28645242
score: 0

http://stackoverflow.com/comment/45685708
score: 1
type: AnswerComment
has text: It is object notation so you need to add a comma.
type: Comment
comment on: http://stackoverflow.com/a/28697593

http://stackoverflow.com/q/28737842
score: -1
has comment: http://stackoverflow.com/comment/45764716
has answer: http://stackoverflow.com/a/28741836
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45764631
has title: Series using javascript or jquery
has body: There is a start and end number.divide the number between start and end by 4 equal parts, and print its 10s power. Example if start =110, end=1234 the result should be 300 600 900 1000 start and end variable may change. Is that possible to do in jquery or javascript? i have done the coding start=43; end=194299; range=5; diff=(end-start)/range; value=start; while (value &lt; end) { value += diff; log_10 = parseInt(Math.log(value) / Math.log(10)); basePower = Math.pow(10, log_10); result = parseInt((value/basePower) * basePower); alert(result); } but its output is like 38898 77749 116599 155449 194299 it is not rounded to 10s or 100s or 1000s place
tagged with: javascript
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28741836
upvote count: 0
tagged with: jquery
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/45759748
has comment: http://stackoverflow.com/comment/45759683

http://stackoverflow.com/comment/45609259
has text: It will break the recursiveness of the function
comment on: http://stackoverflow.com/q/28656474
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28740918
score: 1
linked to: http://stackoverflow.com/q/5082632
type: Question
answer count: 2
linked to: http://stackoverflow.com/q/18713716
tagged with: canvas
upvote count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28741246
tagged with: http://stackoverflow.com/tag/html
has title: Different font widths in html5-canvas
has body: i have a pretty simple but very annoying problem. I try to read the width of a string in a canvas. I know how to do this, and it works. But the results differ from browser to browser. ctx.font = "10px Arial"; var txt = "This is a text demonstration. Why is the width of this text different in every browser??"; ctx.fillText("width:" + ctx.measureText(txt).width, 10, 50); ctx.fillText(txt, 10, 100); Here a little fiddle: http://jsfiddle.net/83v7c4jv/ Chrome: 390px, IE: 375px, Firefox: 394px. Only IE is accurate, since C# gives me the same result if i try this there. Does anybody know why and how i can get Chrome and Firefox to render and calculate the same values like IE?
downvote count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28741713

http://stackoverflow.com/a/28749006
answers question: http://stackoverflow.com/q/28733976
score: 0
type: AcceptedAnswer
has body: Look at the "Execution Transcript" under "View" in the Script Editor, immediately after receiving the error. It should show the file &amp; line number where the exception occurred.
type: Answer
has comment: http://stackoverflow.com/comment/45791818
accepted answer of: http://stackoverflow.com/q/28733976

http://stackoverflow.com/q/28730153
tagged with: nodes
type: Question
tagged with: graph
has answer: http://stackoverflow.com/a/28730217
has title: Find all paths in a directed, unweighted graph for a selected node
tagged with: javascript
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/28730217
type: AnsweredQuestion
has body: There have been a few similar questions around this topic but I am having trouble finding something that matches my requirements. I am working on a food web program (in Javascript) and am interested in finding all the possible food chains (paths) that involve a selected species (node). In other words, when someone selects a species in the graph, I want to list or highlight each of the individual food chains that involve the selected species. See an EOL Food Web for an example of the type of graph I am working on. I'm hoping this shouldn't be too complicated because the edges are unweighted (have no value) but do have a direction. I don't need shortest or longest path - just all possible variations involving the species in question. I was thinking that a clever solution might involve finding all the "down" (towards prey) paths from the selected node first and then do the same for "up" (towards predators) paths. Then just concatenate the downs and ups for all possible combinations. But that likely isn't very elegant. Many thanks for your ideas!

http://stackoverflow.com/q/28631068
score: 0
answer count: 1
tagged with: angularjs
has answer: http://stackoverflow.com/a/28631157
accepted answer: http://stackoverflow.com/a/28631157
type: AnsweredQuestion
has title: Array not updating when using JQuery
has body: I'm trying to splice an array in order to delete an object from my array. I'm using angular-formly to display the forms and AngularJs and JQuery in order to handle the data. The JQuery $(document).on("click", ".delete-me", function () { var id = $(this).parent().find('input, select, textarea').attr('id'); var splitid = id.split("_")[3]; angular.element(document.getElementById('View2Ctrl')).scope().removeField(splitid); $(this).closest('.formly-field').remove(); }); The reason for the split and is that formly wraps an id like formly_1_input_textField-1_0. The Angular Function $scope.removeField = function (id) { for(var i=0;i&lt;$scope.formFields.length;i++){ if($scope.formFields[i].key == id){ $scope.formFields.splice(id, 1); console.log($scope.formFields.length); $scope.currentId = i; } } }; The console log is displaying the actual length of the array however I have {{formFields.length}} on the template and it does not update, as well as {{formFields}} still showing the data in the array. I suspect that JQuery updating the DOM isn't being watched by Angular and have tried calling $scope.$apply() manually to no avail.
type: Question
tagged with: arrays
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28750425
has body: The following code will give you the base64 encoded image, which you can set as the source of an img tag, where a user can save the image, or send it via AJAX to your server side code which can write the image to a folder. //save canvas image as data url (png format by default) var dataURL = canvas.toDataURL(); //Set it as the source of an img tag $('#img').attr('src', dataURL); //Send it via AJAX $.post('handlerUrl', { image: dataURL }, function(response) { //Do something }); You cannot save it to a folder just via JavaScript.
has comment: http://stackoverflow.com/comment/45783766
has comment: http://stackoverflow.com/comment/45783498
answers question: http://stackoverflow.com/q/28750297
has comment: http://stackoverflow.com/comment/45783624
has comment: http://stackoverflow.com/comment/45811352
score: 0
type: Answer

http://stackoverflow.com/a/28697213
has comment: http://stackoverflow.com/comment/45842361
upvote count: 1
type: Answer
has body: You can use the callbacks, they usually provide a reason parameter. E.g Meteor.call("some_random_non_existent_method", function(err, result) { if(err) return alert(err.reason) }); Most meteor callbacks have a error param. With the logout its Meteor.logout(function(err) { ... }) You should be able to catch most types of errors like this. If you want to capture all errors you can use try..catch. Everything in the try block will try to run until it throws an error. You can catch this and provide feedback to the user. try { //This will throw an error this.run_something.go_make_error() }catch(e) { alert("There was an error running this"); }
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28696387
has comment: http://stackoverflow.com/comment/45687874
has comment: http://stackoverflow.com/comment/45842153

http://stackoverflow.com/comment/45728941
score: 0
type: AnswerComment
has text: Thank you dfsq. I updated my post with more info. I am actually coding scripts for Firefox, However, to be more compatible, I stay with ES5 for the time being. ;) Good to know though for when I am coding a Firefox addon.
type: Comment
comment on: http://stackoverflow.com/a/28720591

http://stackoverflow.com/comment/45690845
comment on: http://stackoverflow.com/q/28697270
score: 0
has text: Sure, you can put radio buttons in the cells of a table. no problem
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28668277
accepted answer: http://stackoverflow.com/a/28668304
answer count: 4
has answer: http://stackoverflow.com/a/28669098
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45632316
possible better answer: http://stackoverflow.com/a/28668305
tagged with: javascript
has answer: http://stackoverflow.com/a/28668305
has answer: http://stackoverflow.com/a/28668304
score: 2
downvote count: 0
tagged with: jquery
favorite count: 0
has body: A "str" variable in JavaScript return by a backend contains a string with a few paragraphs separated by line breakers.. When I do this: console.log(str); the Firefox console displays: "This is paragraph 1. This is paragraph2. This is paragraph3" The problem is, this str is NOT separated by a "\n" character. It's just separated by invisible linebreaks, as you can see in the console output. Is there any way to detect this line break? What I'm eventually trying to do is replace these invisible line breaks with a "br" tag so that I can append it inside the html document.. Is there a way to do this? Thanks (Unfortunately, there is no way to change the backend..)
upvote count: 2
has title: JQuery detect newline in a string
has answer: http://stackoverflow.com/a/28668867

http://stackoverflow.com/comment/45693166
has text: use documentation either, and stick to the basic rather than finding a best practice approach for DOM.
score: 0
comment on: http://stackoverflow.com/q/28701550
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28717609
tagged with: jquery
has comment: http://stackoverflow.com/comment/45722437
answer count: 1
has body: is there a way to be notified when a function is registered via the jQuery $(document)ready() functionality and get a reference to that? The background: Im using a parent theme on a wordpress site, which uses ajax page transitions and document ready is only called on the first load. Now i want a reference to each function previously registered to call them again if my page changes. The goal: is to restore the functionality of $(document).ready() as not only me, but many other plugins out there are using it and i obviously dont want to rewrite them all. Yes, i could call MY registered function with no efford but this feels kind of lackluster while destroying the underlying functionality. By the way: it is the parent themes transitions, so overriding this wouldn't be the best solution either. What i want is to provide an addition, that intercepts every registration and calls the registered functions again manually after the transition. Is that a good idea? (notice calling ready() manually doesn't work if it was called already automatically on the initial page load)
has comment: http://stackoverflow.com/comment/45722442
has comment: http://stackoverflow.com/comment/45722445
favorite count: 0
has answer: http://stackoverflow.com/a/28717693
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45722406
has comment: http://stackoverflow.com/comment/45722407
has comment: http://stackoverflow.com/comment/45723069
upvote count: 1
has comment: http://stackoverflow.com/comment/45723321
score: 1
tagged with: wordpress
type: Question
has title: Notification when function is registered on e.g. $(document).ready()
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/45537304
type: Comment
has text: Do you know if React.js can handle such a task?
comment on: http://stackoverflow.com/a/28615152
score: 0
type: AnswerComment

http://stackoverflow.com/q/28615768
tagged with: http://stackoverflow.com/tag/svg
has title: Load a symbol in SnapSVG
has answer: http://stackoverflow.com/a/31273285
type: UnansweredQuestion
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45535311
score: 0
has body: So I just came across Snap SVG and I see it has support to load .svg files via AJAX. Does SnapSVG have any support for loading pre-defined symbols? For example, I have the following code at the top of my document: &lt;svg xmlns="http://www.w3.org/2000/svg" style="display: none;"&gt; &lt;symbol id="idbar-menu-button" viewbox="0 0 31 23"&gt; &lt;rect id="topRect" y="0" width="32" height="5"/&gt; &lt;rect id="midRect" y="9" width="32" height="5"/&gt; &lt;rect id="botRect" y="18" width="32" height="5"/&gt; &lt;/symbol&gt; &lt;/svg&gt; Yes, it's a simple hamburger button. I want to animate it. The whole reason I'm switching to SVG is to avoid unnecessary HTTP requests for things. Snap.svg's documentation and every example I can find says that you need to load the SVG via http request, rather than using any kind of symbol already defined somewhere. Is there a function somewhere that I can't find in the docs, or is this not possible using the current implementation?
answer count: 1

http://stackoverflow.com/a/28718850
type: Answer
has body: You can do this my accessing the key event of keyboard. $('input[type="radio"]').keydown(function(e) { var arrowKeys = [37, 38, 39, 40]; if (arrowKeys.indexOf(e.which) !== -1) { if (e.which == 38) { //jquery code to move right or left // set the element you want to focus on } else if (e.which == 40) { //jquery code to move top or down // set the element you want to focus on } return false; } });
score: 0
has comment: http://stackoverflow.com/comment/45724978
has comment: http://stackoverflow.com/comment/45725805
answers question: http://stackoverflow.com/q/28718744
has comment: http://stackoverflow.com/comment/45811288

http://stackoverflow.com/q/28618711
has comment: http://stackoverflow.com/comment/45540514
has title: Hide all divs and show ones with same class of checkbox checked
has answer: http://stackoverflow.com/a/28618897
type: UnansweredQuestion
tagged with: css
type: Question
has answer: http://stackoverflow.com/a/28618969
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28618948
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has body: Trying to build a filter. There is an item list with a static item class, and dynamically generated item class. There is also a filter menu in a sidebar with dynamically generated id's whatever label whatever label whatever label The idea is to match filter id's with item classes and once a checkbox is checked, only divs with the matching class should be visible. Here is a js code i came up with $(".lifilter").each(function(){ var filter1 = $(this).find('.filtercheck').attr('id'); if ( $(this).find('input.filtercheck').attr('checked') ) { $(".itemswrap .item").hide(); $('.' + filter1).show(); } }); And nothing happens...

http://stackoverflow.com/comment/45705659
score: 0
has text: I thought Firefox kept this kind of stuff in a SQLlite database?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28708096

http://stackoverflow.com/q/28609076
tagged with: pouchdb
type: UnansweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/28874714
has title: How can I put a document inside a document with PouchDB
type: Question
score: -1
has answer: http://stackoverflow.com/a/28882970
has body: Pretty simple question: How can I put a document inside a document? Or how can I connect documents to other documents?
answer count: 2
downvote count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/28619626
type: Question
tagged with: jersey
tagged with: javascript
tagged with: iot
has body: I have a fully working Jersey/Rest application server on an embedded device and am in the process of converting it to websockets with atmosphere-jersey to make it available through a firewall. I've just run into some design questions. I have around 125 different rest call endpoints. I setup a websocket to a few of them and transferred data back and forth, similar to rest, but with live pushes. Since I built a socket with a subscriber for each endpoint, does this mean I'm actually maintaining a websocket on the browser side for each connecting endpoint? Or is the browser smart enough to hold a single socket open to the same domain and send requests back and forth to each endpoint? If I am maintaining a lot of websockets, then is there a particular strategy to do all communication with multiple endpoints, using a single websocket? As well, my project is going to require an intermediary service to match up a login to a device of registered socket listeners. Is there a container that takes care of matching up logins to a websocket broker, that I could host with my own webservices (must be free)? Since all of my backend services look like rest, I don't want to have to subscribe each endpoint to the intermediary; so I'm wondering if I need to setup a single websocket broker to handle the traffic and push it out to the endpoints, or if the jersey-atmosphere service is smart enough to handle this? Edit: added a design question: In order to communicate between a web browser and a back end server using a single websocket interface; Is there a clean and easy way to generate a POJO for each receiving broker, or will I have to do a JSON conversion as the first step in each class that receives an object? If I build a javascript message with some sort of key to determine the broker, then I could map the key to a class and do a pojo generation for passing back the object to the handler: but it seems like this is a bit clunky and coupled.
has title: Internet of Things design for jersey and atmosphere
downvote count: 0
tagged with: websocket
favorite count: 0
tagged with: atmosphere
type: UnansweredQuestion
answer count: 0
score: 1
upvote count: 1

http://stackoverflow.com/comment/45769837
has text: If the callback wants to use `this`, yes. But usually it wouldn't.Go for `deferred.resolve(this);` if you expect your callbacks to deal with the whole request object.
type: Comment
comment on: http://stackoverflow.com/q/28741980
score: 0
type: QuestionComment

http://stackoverflow.com/q/28697966
favorite count: 0
answer count: 0
type: UnansweredQuestion
score: 1
type: Question
has comment: http://stackoverflow.com/comment/46600821
tagged with: jquery-mobile
has title: How to get click event when libraries like fastclick, jQuery mobile and ngTouch (angular) are loaded in page for touch devices?
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I need to capture all the clicks happened in document using pure JavaScript. For that I have attached this listener in page at runtime. document.addEventListener('click', function(){ console.log('clicked!') }, true); But when some libraries like fastclick is loaded in page, it prevents the following click event from propagating. So for such cases click callback function won't be fired. There are so many libraries like ngTouch for angular, jQuery mobile and so on who do the same.. Now my question is is there any way through which i came to know that any element is clicked. I can bind touchstart or touchend event on document. But that is not sufficient for me. I want to make sure about element click. As sometimes it may be possible that I get touchend event but not click.
upvote count: 1

http://stackoverflow.com/comment/45555813
comment on: http://stackoverflow.com/a/28624362
score: 0
type: AnswerComment
type: Comment
has text: `example` will get called again but it is just a getter for a variable with no computation inside it so it is equal to just passing a value. Moreover, if value of `A` changes multiple times in a page's lifecycle (just in case), this solution will handle it.

http://stackoverflow.com/q/28666729
type: AnsweredQuestion
score: 0
possible better answer: http://stackoverflow.com/a/28666780
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28666810
tagged with: javascript
has body: I am a newbie to javascript and made a mistake somewhere with the following code to find the string "Craig" and push it into a new array "Hits". var text = "Hey, how are you \ doing? My name is Emily.\ My other friends name is Craig. My friend Craig is learning JavaScript"; var myName = "Craig" var hits = []; for(var i = 0; i &lt; text.length; i++){ if(text[i]=== "C"){ for(var j = i; j &lt; myName.length; j++ ){ hits.push(j); } } }
accepted answer: http://stackoverflow.com/a/28666810
has title: Cannot push certain string into to an array
has answer: http://stackoverflow.com/a/28666780

http://stackoverflow.com/a/28630484
downvote count: 0
has body: Yes, that is exactly what happens. Unless your code does not execute any asynchronous operations, it will precisely execute in order. However, it is considered as bad practice to inline Javascript code like that. You might want to use an unobtrusive solution by using .addEventListener for instance.
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28630449
upvote count: 2

http://stackoverflow.com/comment/45704258
score: 0
comment on: http://stackoverflow.com/a/28706409
type: Comment
has text: Thank you, Im now closer to the solution :) I did what you said, but… I assume I have to do something else before the 'sencha app build', because it throws me an _[ERR] BUILD FAILED [ERR] com.sencha.exceptions.ExBuild: Mixed-Mode x-compile and microload markup is currently unsupported_ . I thought it could be the 'sencha app refresh' which is supposed to re-generate the metadata (right?) but it also gives me the same error. My question now is: it is probably the app.json, which is almost empty, because it comes from the newly generated app, right?
type: AnswerComment

http://stackoverflow.com/a/28651610
has body: The localStorage (object) was always an object-like construct. That means, we were always be able to access data in a way like localStorage.foo = 42; to retrieve that data, we could call localStorage.foo or use the offered helper functions like localStorage.getItem('foo'); But that the localStorage in fact is not an Object, you can easily call Object.prototype.toString.call(localStorage); // === [object Storage]
has comment: http://stackoverflow.com/comment/45600963
type: Answer
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/28651576
score: 0

http://stackoverflow.com/a/31901463
type: Answer
answers question: http://stackoverflow.com/q/28716464
has comment: http://stackoverflow.com/comment/51863958
upvote count: 4
has body: Solved it with overriding y-axis labels width Chart.Scale.prototype.buildYLabels = function () { this.yLabelWidth = 0; };
downvote count: 0
score: 4

http://stackoverflow.com/a/28709490
has comment: http://stackoverflow.com/comment/45734223
has comment: http://stackoverflow.com/comment/45795296
has comment: http://stackoverflow.com/comment/45793141
score: 0
has comment: http://stackoverflow.com/comment/45828815
has comment: http://stackoverflow.com/comment/45747197
type: Answer
has body: To fix the loading issue with your div's showing before your images, you need to load your images using imagesLoaded. This prevents just the div's from showing before isotope is called. Since you are using isotope v1.56, not v2, it is included in that version of isotope. Change your custom.js (at line 107) isotope call to this: var $container = $('#portfolio-container'); $container.imagesLoaded( function(){ $container.isotope({ resizable: false, itemSelector : ".item", masonry : { columnWidth : 1, gutterWidth: 1, } }); }); To fix your layout issue is more complicated since I'm not sure you can fit all your images in a seamless grid using isotope v1.56 and masonry ( most often you need to rearrange them for sizes to fit without white space). You would need to update to isotope v2 and load the packery layout option after isotope and then set your code up as so, for them to fit together. var $container = $('#portfolio-container'); $container.imagesLoaded( function(){ $container.isotope({ layoutMode: 'packery', itemSelector: '.item' }); }); You will also have to change line 349: $(window).resize(function(){ $('#portfolio-container').isotope('layout'); });
answers question: http://stackoverflow.com/q/28707820
has comment: http://stackoverflow.com/comment/45743898
has comment: http://stackoverflow.com/comment/45793119
has comment: http://stackoverflow.com/comment/45831097
has comment: http://stackoverflow.com/comment/45795361

http://stackoverflow.com/a/28740130
answers question: http://stackoverflow.com/q/28740065
type: Answer
has body: I suggest you to use hidden field instead if you don't want to show. The property of radio buttons is to show only true / false value. It may be on / off or yes / no, according to your uses. Use like &lt;input type = 'hidden' name = 'whatever' class ='radio' value =&lt;?php echo $row['fee_id']; ?&gt;&gt;
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/q/28629545
score: 1
duplicate of: http://stackoverflow.com/q/6923707
type: Question
tagged with: angularjs-directive
has title: Read json file from my local file system in AngularJS
tagged with: javascript
upvote count: 1
linked to: http://stackoverflow.com/q/6923707
answer count: 1
has body: I am new to angularJS ,i want to read a json file from my local system, when i try to read the file it throws a exception Error: Access to restricted URI denied XMLHttpRequest. My code var deferred = q.defer(); http.get('file:///C:/configjson.json').success(function(data) { angular.extend(this, data); deferred.resolve(data); }).error(function() { deferred.reject('could not find File'); }); please help me
favorite count: 0
has comment: http://stackoverflow.com/comment/45559545
has answer: http://stackoverflow.com/a/28629628
tagged with: angularjs
type: UnansweredQuestion
downvote count: 0

http://stackoverflow.com/a/28670459
type: Answer
has comment: http://stackoverflow.com/comment/45640058
has body: Why don't you use javaScript objects to store your data at the frontend. You may directly pass this object by encoding with json on the server to store it to database. Example : var g_obj = new Object(); g_obj.level = new Object(); g_obj.level.diff = "Beginner"; g_obj.level.injury = "50"; g_obj.answers = new Array(); g_obj.answers[0] = new Object(); g_obj.answers[0].id = "1"; g_obj.answers[0].correct = "1"; g_obj.answers[0].marks = 10; g_obj.answers[1] = new Object(); g_obj.answers[1].id = "2"; g_obj.answers[1].correct = "0"; g_obj.answers[1].marks = 10; g_obj.answers[2] = new Object(); g_obj.answers[2].id = "3"; g_obj.answers[2].correct = "1"; g_obj.answers[2].marks = 15;
answers question: http://stackoverflow.com/q/28669303
score: 0
has comment: http://stackoverflow.com/comment/45640128
has comment: http://stackoverflow.com/comment/45636090

http://stackoverflow.com/comment/45612994
comment on: http://stackoverflow.com/q/28658589
type: Comment
type: QuestionComment
has text: why you complicate the python stuff, just `list(zip(data[0:],data[1:]))` will do the job.
score: 0

http://stackoverflow.com/q/28671984
has comment: http://stackoverflow.com/comment/45637644
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/45637667
upvote count: 1
has title: how to get value of inner ,which does not have id or class slectors except parent div value?
type: Question
has comment: http://stackoverflow.com/comment/45637595
has comment: http://stackoverflow.com/comment/45637677
tagged with: javascript
answer count: 6
has answer: http://stackoverflow.com/a/28672121
has comment: http://stackoverflow.com/comment/45637608
downvote count: 0
has answer: http://stackoverflow.com/a/28673417
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28672106
has answer: http://stackoverflow.com/a/28672201
tagged with: http://stackoverflow.com/tag/html
has body: I am working on customization of a wordpress theme ,there was a situation that,When ever user resizes the browser window text content on the page should change its color.I successfully done with this using javascript in some standalone html page .Coming to the wordpress theme,I posted the code of the block from which i want to get the text and changes its color dynamically on resize below this post.The thing is that inner span and elements of the following with class name "wpb_wrapper"did not have either ,'id' or 'class' selector.Without selector my function is not identifying the inner html elements and i'm not getting the values.I even tried some of the following things: Firefox Xpath finder. (JS not rendering it!!) document.select("span.wp_wrapper").get(0).nextElementSibling().text(); document.getElementById("item1").nextElementSibling.innerHTML Theme Original Code: | Some Text Some Text Some Text
has answer: http://stackoverflow.com/a/28672078
tagged with: css
has answer: http://stackoverflow.com/a/28672187

http://stackoverflow.com/q/28689822
has comment: http://stackoverflow.com/comment/45671319
type: AnsweredQuestion
downvote count: 1
type: Question
answer count: 2
upvote count: 0
has body: I am attempting to define an array of objects, each of which contains an object within text in javascript. I have the following code testState={id : 'blahdu3', states: [{ simulation : { num_devices: 14, num_networks: 6, simulation_name: 'Jeffs sim', id : 'blahdu3', config_map : { 'Partition1': { 'networka' : { 'devicea' : '1', 'deviceb@mun.ca': '2', 'devicec@mun.ca':'3'}, 'networkb' : { 'deviced': '4', 'devicee': '5'}, }, 'Partition2':{ 'networkc' :{ 'devicef': '6', 'deviceg@mun.ca' : '7', 'deviceh@mun.ca': '8'}, 'networkd' :{'devicei@mun.ca':'9', 'device@mun.ca': '10'}, 'networkTest' :{}, }, 'Partition3':{ 'networke' : { 'devicek':'11'} }, 'freelist' : {'devicew': '13', 'evicex' : '14'} } }, timestamp: '2015-01-012:44:00', }] } The problem is that when I attempt to call this "configMap" with states[i].simulation.configMap; I am told that the configMap is a null object. Can anyone clarify what's going on here for me? Thanks a ton for the help!
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45671322
has answer: http://stackoverflow.com/a/28689911
has answer: http://stackoverflow.com/a/28689954
possible better answer: http://stackoverflow.com/a/28689954
has title: Javascript not creating object
favorite count: 0
accepted answer: http://stackoverflow.com/a/28689911

http://stackoverflow.com/comment/45542865
type: QuestionComment
comment on: http://stackoverflow.com/q/28620049
score: 0
has text: Also, don't replace the prototype with another object, you will end up overwriting things that need to be kept.
type: Comment

http://stackoverflow.com/a/28746474
answers question: http://stackoverflow.com/q/28746323
type: Answer
has body: You are doing the same action twice, the code is: HTML CSS3 Buttons Showcase Click Me! JavaScript $(document).ready(function() { $("#btn-1").click(function(){ $("body").fadeOut(1000); }) }
score: 0

http://stackoverflow.com/a/28614861
has body: Two things: In JavaScript, there is no guaranteed "order" of properties in and Object . . . only in Arrays, so, by far, the simplest way to make your data sequentially structured, is to use an Array. If the only use of the id attributes is to indicate that order, you would be much better off using the indeces of an Array in to identify the different items, than a property within the object, since those indeces are more easily accessed. I'd suggest updating your structure to this: var games = [ { name : 'ABC Games', games : ['ABC 1', 'ABC 2', 'ABC 3'] }, { name : 'XYZ', games : ['XYZ 1', 'XYZ 2', 'XYZ 3'] } ]; With that structure, you can still use a loop to iterate through the array structure, but you can also, very easily, access specific elements, using the indeces. Some examples: games[0].games[0] ---&gt; "ABC 1" games[1].games[0] ---&gt; "XYZ 1" games[1].games[2] ---&gt; "XYZ 3"
answers question: http://stackoverflow.com/q/28614035
score: 0
type: Answer

http://stackoverflow.com/comment/45558110
type: AnswerComment
has text: Thanks for the answer, but the map is not loaded again.
comment on: http://stackoverflow.com/a/28628160
type: Comment
score: 0

http://stackoverflow.com/a/28604725
has comment: http://stackoverflow.com/comment/45515268
has body: Do you want to display a partial view in a modal pop up? If so, you could use the JQuery AJAX method as you've already done but combine it with a JQuery pop up/lightbox plugin to display the resulting HTML. So, in your code where "/Home/SomeAction" is the PartialView for your pop up return a "PartialView" from your Controller and when you receive the HTML back in the JQuery "success:" event, maybe use (for example) "Jquery Colorbox" to display it (see here: http://www.jacklmoore.com/colorbox/)
score: 0
answers question: http://stackoverflow.com/q/28604610
type: Answer
has comment: http://stackoverflow.com/comment/45515355

http://stackoverflow.com/comment/45733463
score: 0
type: AnswerComment
type: Comment
has text: i am bit confused, after checking the offset and setting the flag to true, i still have loop through the data . Could you provide a bit of more explanation, thnxs for the response
comment on: http://stackoverflow.com/a/28723128

http://stackoverflow.com/comment/45675624
type: QuestionComment
type: Comment
has text: Almost *everyone* knows why it happens. Read up on what a "floating point number" means.
comment on: http://stackoverflow.com/q/28692154
score: 0

http://stackoverflow.com/a/65540740
type: Answer
upvote count: 1
score: 1
has body: You first need to convert your image into base64 and then you can use it in image property, Like this { image: 'data:image/jpeg;base64,...encodedContent...', width: 75, height: 75, alignment : 'left' } Here is a Reference - https://pdfmake.github.io/docs/0.1/document-definition-object/images/
answers question: http://stackoverflow.com/q/28647253
downvote count: 0

http://stackoverflow.com/comment/45539528
score: 0
has text: Using your code and native code, I was unable to reproduce your error. I hit both the Windows key, and the context menu key, to no avail. This was tested in Chrome, what browser are you using? Are you certain that what you think is happening is actually happening?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28618091

http://stackoverflow.com/a/28726273
has comment: http://stackoverflow.com/comment/45739472
score: 0
has body: First you should never manipulate DOM in controller, and if you want to set the value like; &lt;input type="number" value="100"&gt; everything else remains same just set the value attribute to your desired value
type: Answer
answers question: http://stackoverflow.com/q/28725554

http://stackoverflow.com/q/28593529
favorite count: 0
tagged with: islandora
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
has body: Background I have a form created using the Islandora XML Form builder module. This form dynamically adds fields using AHAH. For a given fields set, the first fieldset will have a name like foo[0], the second foo[1], etc. Within this fieldset can be additional fields. So the bar field on the first would be named foo[0]bar, the bar field on the second is foo[1]bar, etc. If the bar field is itself a fieldset then the baz field on the 1st instance of the bar set in the second foo would be foo[1]bar[0]baz. Question I need to modify this form to use the Drupal form states so that the visibility of foo[x]bar[y]baz is based on the value of foo[x]bar[y]qux. If I were writing pure jQuery, I could set the state based on $this().prev(&quot;:input[name$=qux]&quot;). Can I use this type of reference for the Drupal Forms States or can I only use absolute selectors?
tagged with: drupal-7
tagged with: javascript
has title: Drupal Forms API #States
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/50846167
has answer: http://stackoverflow.com/a/31438321
tagged with: drupal-forms
accepted answer: http://stackoverflow.com/a/31438321
tagged with: jquery

http://stackoverflow.com/comment/45783563
score: 1
has text: @Pointy good point, I suppose he could have them stored as strings and then call parseInt, but if he has access to the data source then he might as well remove the leading 0.
type: AnswerComment
comment on: http://stackoverflow.com/a/28750523
type: Comment

http://stackoverflow.com/comment/45700976
has text: If you downvote this will you please explain why?
comment on: http://stackoverflow.com/q/28705613
type: Comment
type: QuestionComment
score: 4

http://stackoverflow.com/q/28670720
type: Question
has comment: http://stackoverflow.com/comment/45636100
tagged with: javascript
tagged with: browser
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28677436
tagged with: jquery
has title: JavaScript Sounds on ClickEvent works only on google chrome
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45636782
tagged with: audio
has body: I have a problem with play sound on ie,ff and safari. Only chrome works. I want to play sounds when click in canvas. I have two sounds for it. But the sounds are only working on google chrome. index.php &lt;div style="display:none"&gt; &lt;audio id="soundTrue" class="soundTrue" controls preload="none"&gt; &lt;source src="fx/true.ogg" type="audio/ogg"&gt; &lt;source src="fx/true.wav" type="audio/wav"&gt; &lt;source src="fx/true.mp3" type="audio/mpeg"&gt; &lt;/audio&gt; &lt;audio id="soundFalse" class="soundFalse" controls preload="none"&gt; &lt;source src="fx/false.ogg" type="audio/ogg"&gt; &lt;source src="fx/false.wav" type="audio/wav"&gt; &lt;source src="fx/false.mp3" type="audio/mpeg"&gt; &lt;/audio&gt; &lt;/div&gt; game.js: var playSound = function (sound) { sound.trigger('play'); } var stopSound = function (sound) { sound.trigger('pause'); sound.prop("currentTime", 0); } $('#gameCanvas').click(function (e) { document.getElementById('soundTrue').play(); var clickedX = e.pageX - this.offsetLeft; var clickedY = e.pageY - this.offsetTop; var found = false; for (var i = 0; i &lt; circles.length; i++) { if (clickedX &lt; circles[i].right &amp;&amp; clickedX &gt; circles[i].left &amp;&amp; clickedY &gt; circles[i].top &amp;&amp; clickedY &lt; circles[i].bottom) { if (coordinates[i][2] === 0) { coordinates[i][2] = 1; drawFoundCupcake(coordinates[i][0], coordinates[i][1]); stopSound(soundTrue); playSound(soundTrue); countOfFound++; } found = true; } } if (!found) { stopSound(soundTrue); playSound(soundFalse); } else{ $('#countCupcakes').val(countOfFound); } });
has comment: http://stackoverflow.com/comment/45635368

http://stackoverflow.com/comment/45750985
has text: is this what you want? http://stackoverflow.com/questions/1091661/detect-element-content-changes-with-jquery
comment on: http://stackoverflow.com/q/28731566
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28666569
tagged with: javascript
has answer: http://stackoverflow.com/a/28695627
has body: I want to combine multiple json data into a single vm. I read that you can map from js into the model multiple times and it should be merging but on my case, it's not. It's replacing the data. function Item(ID, Name, Description) { this.ID = ko.observable(ID); this.Name = ko.observable(Name); this.Description = ko.observable(Description); } var MasterViewModel = { model: ko.observableArray([]) }; $.getJSON(url, function (response) { ko.mapping.fromJS(response["TM1.Cube"], Item, MasterViewModel.model); ko.mapping.fromJS(response["TM1.Dimension"], Item, MasterViewModel.model); }) ko.applyBindings(MasterViewModel); And here is my json data { "LogicalName": "TM1.Model", "ID": "12345", "Name: "Sample", "TM1.Cube": [ { "LogicalName": "TM1.Cube", "ID": "111111", "Name": Assets" }, { "LogicalName": "TM1.Cube", "ID": "111112", "Name": Finance" } ], "TM1.Dimension": [ { "LogicalName": "TM1.Dimension", "ID": "222221", "Name": Assets" }, { "LogicalName": "TM1.Dimension", "ID": "222222", "Name": Finance" } ] } and the outcome I expected is like this { "LogicalName": "TM1.Cube", "ID": "111111", "Name": Assets" }, { "LogicalName": "TM1.Cube", "ID": "111112", "Name": Finance" }, { "LogicalName": "TM1.Dimension", "ID": "222221", "Name": KPI" }, { "LogicalName": "TM1.Dimension", "ID": "222222", "Name": Default" } I have added a jsFiddle http://jsfiddle.net/e1ppj3qc/1/
answer count: 1
has title: Knockout combining multiple json data into single vm
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28695627
tagged with: knockout-mapping-plugin
has comment: http://stackoverflow.com/comment/45654212
score: 2
type: AnsweredQuestion
upvote count: 2
tagged with: http://stackoverflow.com/tag/json
tagged with: knockout.js
type: Question
has comment: http://stackoverflow.com/comment/45627863

http://stackoverflow.com/comment/45563670
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28602662
has text: Add a wrapper with JS. Toggle a class on the wrapper with JS?
score: 0

http://stackoverflow.com/a/28713332
has comment: http://stackoverflow.com/comment/45715022
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28713315
upvote count: 3
type: Answer
has body: Try this $.ajax({ type: "POST", url: '../Doctor/RemoveDoctor', data: $('#form').serialize(), success: function (data) { alert(data.Message); }, error: function () { alert("Error!!!"); } }); It will serialize your form. Use only $('#form').serialize() for serialization. Edit If you don't want to refresh page then you should use type="button" instead type="submit" And You should do this also [HttpPost] public ActionResult RemoveDoctor(DoctorModel doctor) { //................... return Json(new { Message = displayMessage } , JsonRequestBehavior.AllowGet); } And change ajax error function to this (For getting error ) error: function(jqXHR, textStatus, errorThrown) { alert("Error: "+errorThrown+" , Please try again"); }
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/45715183
accepted answer of: http://stackoverflow.com/q/28713315

jquery
tags question: http://stackoverflow.com/q/28635549
tags question: http://stackoverflow.com/q/28727466
tags question: http://stackoverflow.com/q/28670370
tags question: http://stackoverflow.com/q/28749882
tags question: http://stackoverflow.com/q/28705503
tags question: http://stackoverflow.com/q/28659577
tags question: http://stackoverflow.com/q/28699868
tags question: http://stackoverflow.com/q/28667681
tags question: http://stackoverflow.com/q/28651700
tags question: http://stackoverflow.com/q/28652512
tags question: http://stackoverflow.com/q/28739800
tags question: http://stackoverflow.com/q/28680400
tags question: http://stackoverflow.com/q/28594445
tags question: http://stackoverflow.com/q/28638273
tags question: http://stackoverflow.com/q/28678548
tags question: http://stackoverflow.com/q/28615068
tags question: http://stackoverflow.com/q/28689897
tags question: http://stackoverflow.com/q/28741941
tags question: http://stackoverflow.com/q/28614899
tags question: http://stackoverflow.com/q/28611011
tags question: http://stackoverflow.com/q/28693913
tags question: http://stackoverflow.com/q/28746348
tags question: http://stackoverflow.com/q/28603329
tags question: http://stackoverflow.com/q/28593579
tags question: http://stackoverflow.com/q/28611502
tags question: http://stackoverflow.com/q/28621042
tags question: http://stackoverflow.com/q/28742319
tags question: http://stackoverflow.com/q/28664152
tags question: http://stackoverflow.com/q/28651832
tags question: http://stackoverflow.com/q/28617443
tags question: http://stackoverflow.com/q/28687603
tags question: http://stackoverflow.com/q/28616704
tags question: http://stackoverflow.com/q/28697203
tags question: http://stackoverflow.com/q/28639645
tags question: http://stackoverflow.com/q/28713793
tags question: http://stackoverflow.com/q/28598648
tags question: http://stackoverflow.com/q/28605609
tags question: http://stackoverflow.com/q/28663245
tags question: http://stackoverflow.com/q/28621734
tags question: http://stackoverflow.com/q/28674110
tags question: http://stackoverflow.com/q/28683910
tags question: http://stackoverflow.com/q/28622587
tags question: http://stackoverflow.com/q/28720216
tags question: http://stackoverflow.com/q/28641745
tags question: http://stackoverflow.com/q/28729259
tags question: http://stackoverflow.com/q/28653528
tags question: http://stackoverflow.com/q/28730750
tags question: http://stackoverflow.com/q/28723106
tags question: http://stackoverflow.com/q/28624076
tags question: http://stackoverflow.com/q/28609870
tags question: http://stackoverflow.com/q/28668607
tags question: http://stackoverflow.com/q/28709507
tags question: http://stackoverflow.com/q/28733418
tags question: http://stackoverflow.com/q/28623607
tags question: http://stackoverflow.com/q/28662000
tags question: http://stackoverflow.com/q/28636785
tags question: http://stackoverflow.com/q/28685645
tags question: http://stackoverflow.com/q/28638667
tags question: http://stackoverflow.com/q/28639480
tags question: http://stackoverflow.com/q/28732645
tags question: http://stackoverflow.com/q/28688925
tags question: http://stackoverflow.com/q/28661705
tags question: http://stackoverflow.com/q/28709011
tags question: http://stackoverflow.com/q/28609420
tags question: http://stackoverflow.com/q/28602852
tags question: http://stackoverflow.com/q/28632608
tags question: http://stackoverflow.com/q/28675835
tags question: http://stackoverflow.com/q/28648640
tags question: http://stackoverflow.com/q/28649542
tags question: http://stackoverflow.com/q/28673489
tags question: http://stackoverflow.com/q/28601048
tags question: http://stackoverflow.com/q/28603291
tags question: http://stackoverflow.com/q/28602971
tags question: http://stackoverflow.com/q/28687143
tags question: http://stackoverflow.com/q/28627780
tags question: http://stackoverflow.com/q/28727683
tags question: http://stackoverflow.com/q/28696787
tags question: http://stackoverflow.com/q/28632997
tags question: http://stackoverflow.com/q/28645725
tags question: http://stackoverflow.com/q/28712272

http://stackoverflow.com/q/28624982
has comment: http://stackoverflow.com/comment/45551354
tagged with: express
has title: File upload with nodejs, express, mean stack
type: AnsweredQuestion
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/28625175
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28626018
type: Question
has comment: http://stackoverflow.com/comment/45551157
tagged with: node.js
possible better answer: http://stackoverflow.com/a/28626018
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/28625175
has body: I am new to Mean and nodejs. I have a old project with old dependencies. And I am trying to upload image file to server using angular js. But it does not work. I don't know how to retrieve image file data, name, type, etc at both client and server side. Client js $scope.uploadFile = function(files,index) { console.log("uploading file"); console.log("sticker index:" + index); console.log("StickerGroupID:"+ $scope.stickergroup._id); console.log("file:"+ files[0].name); console.log("sticker : " + $scope.stickergroup.stickers[index].stickername ); $scope.stickergroup.stickers[index].stickerFileName = files[0].name ; console.log("sticker path now:" +$scope.stickergroup.stickers[index].stickerFileName); var fd = new FormData(); fd.append("file", files[0]); fd.append("filename", files[0].name); //put an upload file to temp location. $http.post("/stickergroups/uploadstickers", fd, { // withCredentials: true, headers: {'Content-Type': undefined }, transformRequest: angular.identity}); Server js exports.uploadTempFile = function(req, res) { console.log("uploading start"); console.log("file required :" +req.files); var imagefile = req.files.file; var tempDirectorySticker = tempDirectory + imagefile.originalFilename; console.log("temp directory" + tempDirectorySticker ); fs.readFile(imagefile.path, function (err, data) { fs.writeFile(tempDirectorySticker, data, function (err) { res.redirect("back"); }); });}; req.files is resulting "undefined". Thanks
tagged with: mean-stack
tagged with: javascript

dynamic
tags question: http://stackoverflow.com/q/28704433
tags question: http://stackoverflow.com/q/28608981
tags question: http://stackoverflow.com/q/28727457
tag name: dynamic
tags question: http://stackoverflow.com/q/28646571
tags question: http://stackoverflow.com/q/28747864
tags question: http://stackoverflow.com/q/28600431
tags question: http://stackoverflow.com/q/28616527
tags question: http://stackoverflow.com/q/28634502
type: Tag

http://stackoverflow.com/q/28668030
has answer: http://stackoverflow.com/a/34585460
has answer: http://stackoverflow.com/a/29056764
type: AnsweredQuestion
score: 1
type: Question
tagged with: reactjs
answer count: 2
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29056764
tagged with: express
has comment: http://stackoverflow.com/comment/46851019
has title: Use React and Express
favorite count: 0
upvote count: 1
possible better answer: http://stackoverflow.com/a/34585460
has body: I'm using Express framework on NodeJS (hosted by Heroku) to create my web site. I'm also using the React framework to create my components. I have several HTML files with divs inside and React components which can be rendered in those divs. When a user chooses a route (e.g. /movies) I want to be able to associate one HTML file with a component and return it back to the user. I already looked for a solution, but all of them talk about server-side rendering and sending back HTML files. Is there another solution?
tagged with: node.js

http://stackoverflow.com/comment/50705303
has text: @JörnBerkefeld Done, though it's probably not elegant, and not tested.
type: Comment
comment on: http://stackoverflow.com/a/28765872
score: 1
type: AnswerComment

http://stackoverflow.com/comment/45557453
type: Comment
score: 0
has text: @NateDiemer No problem. Please **upvote** and mark this answer as accepted if you are satisfied with it. Also, from next time onwards make sure to check the Javascript console for errors and include it in your question here on StackOverflow so we can help better. :)
comment on: http://stackoverflow.com/a/28628431
type: AnswerComment

http://stackoverflow.com/q/28706278
has comment: http://stackoverflow.com/comment/45703855
tagged with: regex
has title: JavaScript/jQuery case indifferent RegEx replace
has answer: http://stackoverflow.com/a/28720052
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28706562
has answer: http://stackoverflow.com/a/28706562
has body: I'm trying to figure out how to do a RegEx search on a string that ignores case, but when it does a replacement it should preserve the original case. i.e. Searching for "adv" should match "Adv", but the replacement should match "Adv" not "adv" The purpose is to 'highlight' text in a string. Obviously if there is something easier I'm all ears. Current code... $("#SearchResults").append(appendString.replace( new RegExp($("#SearchInput").val(), "g"), "&lt;strong&gt;" + $("#SearchInput").val() + "&lt;/strong&gt;") );
tagged with: javascript
tagged with: replace
accepted answer: http://stackoverflow.com/a/28720052
has comment: http://stackoverflow.com/comment/45702223
type: AnsweredQuestion
tagged with: jquery
type: Question

http://stackoverflow.com/q/28662111
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/45919407
upvote count: 1
has body: So, here's what happens. I was trying to get this to work (jQuery working in dreamweaver but not in browser), so I was checking all the command lines at a time. $(document).ready(function () { $("nav ul ul").each(function () { var navWidth = $(this).width(); var liWidth = $(this).closest("li").width(); var gaps = navWidth - liWidth; alert(gaps); }); }); After using this code, I realised that it gives me different values. Like, in dreamweaver I would get 25, -86 and -163, but in chrome, I get 54, -34 and -88. What can I do?
tagged with: google-chrome
type: Question
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has title: Javascript giving different values in dreamweaver/IE and chrome/firefox
favorite count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/28652595
tagged with: dreamweaver

http://stackoverflow.com/comment/45603470
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28653203
type: AnswerComment
has text: @DavidThomas thank you. One question. Is this possible at all? How can he loop through an array and in the same way remove values of this array? I don't think that this is possible. Correct?

http://stackoverflow.com/q/28726024
has body: I do this very frequently: var customer = people.filter(function(person) { return person.id === customerId; })[0]; Semantically, I'm simplying saying "give me the unique element in the array that matches this predicate." Now that I'm using lodash, what's the closest equivalent?
has comment: http://stackoverflow.com/comment/45751023
has answer: http://stackoverflow.com/a/28726827
tagged with: underscore.js
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28726073
has title: Replacing array.filter(x => x.n === n)[0] with lodash
tagged with: javascript
score: 0
tagged with: lodash
type: UnansweredQuestion

http://stackoverflow.com/q/28642499
tagged with: less
answer count: 1
tagged with: javascript
has title: LESS property loading inconsistently in Firefox
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28642519
tagged with: jquery
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I am compiling my LESS file by adding the less.js in my index.html. My code is something as follows: Hello //style.less .blue-text { color: blue; } //script.js (function(){ $('.blue-background').css('background', $('.blue-text').css('color')); })(); Now when I render this page in the browser it renders fine in the Chrome browser. But in Firefox the blue-background does not get the colour everytime. It comes sometimes and sometimes it does not. What can I do to fix this?
accepted answer: http://stackoverflow.com/a/28642519
score: 0

http://stackoverflow.com/q/28606796
downvote count: 0
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
upvote count: 1
score: 1
has body: I know that the broadcast and emit event happens like : broadcast : from parent to child (Top to bottom ) To communicate from ctrl2 to ctrl1, use emit, To communicate from ctrl1 to ctrl2, use broadcast, Then How the events are passed when there is no nesting kind of controllers , I mean when there are routes $routeProvider.when(..., controller :ctrl) $routeProvider.when(..., controller: ctr2) And How the Communication between this kind of structure happens. Hope I many is valid and make sense, please provide me the explanation. along with answers, Thanks a lot
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28607018
has comment: http://stackoverflow.com/comment/45517669
has title: Need to Know How the Event is passed between sibling controllers in angularJS
answer count: 1

http://stackoverflow.com/a/28652372
downvote count: 0
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28651878
type: Answer
has body: Not sure how your JSON exaclty looks like. But _.pluck() from UnderscoreJS should work for you. See the demo below and here at jsFiddle. var obj = { post1 : { category: "News" }, post2 : { category: "Articles" }, post3 : { category: "Case Studies" }, post4: { category: "Nice Exhibit Case Studies" }, post5: { category: "Events" } }; console.log(_.pluck(obj, 'category'));

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

http://stackoverflow.com/comment/45523963
comment on: http://stackoverflow.com/a/28603563
type: AnswerComment
score: 0
type: Comment
has text: No, if you read the docs it states that it only stops the animation that is currently running. If you want to clear the entire queue use `.stop(true)`

http://stackoverflow.com/comment/45737660
type: Comment
type: QuestionComment
has text: Banana, if you post that as an answer. I'll mark it as a solution. Thanks again!
comment on: http://stackoverflow.com/q/28725467
score: 0

http://stackoverflow.com/comment/45648427
has text: @PriyaViji, As Jonathan said, we need more code. Supply your HTML as well as the references from the arrays you use.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28677445

http://stackoverflow.com/q/28725221
has answer: http://stackoverflow.com/a/28725469
accepted answer: http://stackoverflow.com/a/28725469
tagged with: php
type: AnsweredQuestion
has title: How to get all data by `echo json_encode($data);`
tagged with: http://stackoverflow.com/tag/json
type: Question
has answer: http://stackoverflow.com/a/28725488
answer count: 2
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28725488
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/45737356
has body: I want to update user wall by my below script if new data added in sql within last 15 second. It's update fine if I just use only one data $data = $row['description']; in server.php file. When I am going to array all data in server.php file to display full post and make my script as below, It's display [object Object] continuously. So I want to display newly added full post with user img, name, detail etc. But I have no idea about how to do it. Please give me a guideline. server.php include("../db.php"); global $dbh; header('Content-Type: application/json; charset=utf-8'); while (true) { date_default_timezone_set('Asia/Dhaka'); //fetch data $datetime = date('Y-m-d H:i:s', strtotime('-15 second')); $results = mysqli_query($dbh,"SELECT * FROM comments WHERE qazi_id='1012' AND date &gt;= '$datetime' ORDER BY date DESC LIMIT 1") or die(mysqli_error($dbh)); $rows = mysqli_fetch_assoc($results); $data = array(); $data['id'] = $rows['id']; $data['qazi_id'] = $rows['qazi_id']; $data['likes'] = $rows['likes']; $data['username'] = $rows['username']; $data['img'] = $rows['img']; $data['description'] = $rows['description']; $data['url'] = $rows['url']; $data['parent_id'] = $rows['parent_id']; $data['date'] = $rows['date']; //has data if (!empty($data)) { echo json_encode($data); flush(); exit(0); } sleep(5); } JS Script: function addmsg(type, msg){ $("#messages").append( "&lt;div class='msg "+ type +"'&gt;"+ msg +"&lt;/div&gt;" ); } function waitForMsg(){ $.ajax({ type: "GET", url: "server.php", async: true, cache: false, timeout:15000, success: function(data){ addmsg("new", data); setTimeout( waitForMsg, 1000 ); }, error: function(XMLHttpRequest, textStatus, errorThrown){ setTimeout( waitForMsg, 15000); } }); }; $(document).ready(function(){ waitForMsg(); }); Html: &lt;div id="messages"&gt; &lt;/div&gt;

http://stackoverflow.com/q/28739065
tagged with: html5-canvas
has title: Canvas auto resize height
tagged with: javascript
has comment: http://stackoverflow.com/comment/45761956
has body: I have a canvas that i'm using to print a thermal receipt. It works great when defining the width and height with exact pixels and the content fits within the defined height. The problem comes when there is too much content for the defined height. The canvas doesn't adjust its height to the content and so everything below the defined height is cut off. How do i adjust to the height of the content? First time using canvas so any suggestions are welcome. Please let me know if any sample code is required here as i'm not sure what would be relevant? Cheers
has comment: http://stackoverflow.com/comment/45763154
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 0
has comment: http://stackoverflow.com/comment/45795072
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/17211920
duplicate of: http://stackoverflow.com/q/17211920
type: Question
score: 0
tagged with: canvas

http://stackoverflow.com/comment/45675507
comment on: http://stackoverflow.com/q/28690777
score: 0
type: Comment
type: QuestionComment
has text: yes it did. thanks a lot. why don't you put it in answer.

http://stackoverflow.com/a/36515011
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28647253
type: Answer
upvote count: 6
score: 6
has body: Its Simple, 1) Convert your Image into base64 here 2) copy your base64 code and replace into , image : 'base64', // use your base64 instead image.jpg 3) Done. this method is if your image is not worked by link means use base64 instead
answers question: http://stackoverflow.com/q/28647253

http://stackoverflow.com/comment/45602216
comment on: http://stackoverflow.com/a/28652183
score: 0
type: AnswerComment
has text: innerHTML -> undefined innerHTML() -> TypeError: Object #<Object> has no method 'innerHTML' same for HTML
type: Comment

http://stackoverflow.com/comment/45667952
type: AnswerComment
has text: @ArunPJohny - read my answer for **comprehension**, the test is only done **once** in my answer, **it can NEVER "change" because it is NEVER tested twice!**, thus my **lament about the up votes** doubting the `if .. else` construct. Geez.
comment on: http://stackoverflow.com/a/28687668
type: Comment
score: 0

http://stackoverflow.com/comment/45589950
has text: Please use some basic punctuation in your question text.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28646113

http://stackoverflow.com/comment/45571345
has text: Also do I need to change all array elements to {} as mentioned in other answers?
comment on: http://stackoverflow.com/a/28635723
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45782226
has text: There aren't any errors in the console. I get HTML that I clone from a hidden template, and then append it to a container that is empty when the document is ready.
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28750146

http://stackoverflow.com/q/28599820
has title: Update only one file via application cache
has body: Here is my manifest.appcache file. CACHE MANIFEST app.js theme.css logo.png How can I force browser renew the app.js file only?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28600041
tagged with: html5-appcache
type: Question
possible better answer: http://stackoverflow.com/a/52179098
has answer: http://stackoverflow.com/a/52179098
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28600041
score: 0
answer count: 2

http://stackoverflow.com/comment/45576964
score: 0
type: Comment
type: QuestionComment
has text: @Teemu - Please check the comment, that is what i meant by not working.
comment on: http://stackoverflow.com/q/28638669

http://stackoverflow.com/q/28700932
tagged with: leiningen
has title: Run ClojureScript using nodejs while using another lein project
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46016504
downvote count: 0
favorite count: 0
tagged with: clojurescript
upvote count: 2
type: UnansweredQuestion
tagged with: node.js
score: 2
answer count: 0
has comment: http://stackoverflow.com/comment/45692393
has body: I am writing a clojurescript program called "gpqgame" that evolves pieces of code; it evaluates the "accuracy" of a piece of code by running it on a simulator, called "qgame", which is a leiningen project in another directory. So far, I have been manually loading all qgame code into a repl, and then testing my evolution code using that. However, I want to be able to run the code from the terminal, so I set up my gpqgame as a lein project, and have been trying to use nodejs. I promptly started running into trouble. Gpqgame can't seem to load qgame and I don't know why, I've included the project.clj files for both. I've tried loading the full project as a lib and foreign-lib inside the cljs-build, and I've tried copying the "src" of qgame into the "src" of gpqgame while including the libraries that qgame needs inside the resources of gpqgame. My gpqame.core has the following ns declaration: (ns gpqgame.core (:require [clojure.string :as st] [qgame.simulator.interpreter :as inter] [qgame.gp.evaluator :as ev] [qgame.simulator.qgates :as qg] [clojure.browser.repl :as repl])) and it contains (enable-console-print!) and (set! *main-cli-fn* -main). Each time, the compilation will succeed but will give warnings about: 1) use of undeclared vars in the qgame code 2) keywords and reserved words are not allowed as unquoted property names in older javascript When I run node out/gpqgame.js, I get a reference error saying "mathjs is not defined". One thing I noticed is that qgame uses 0.0-2156, while my gpqgame uses 0.0-2913. If I change the version of one of them to be the same as the other, they don't work anymore. Is there an easy way to have gpqgame load the whole qgame project without me having to include it inside the gpqgame project? Is this the best way to do it, or should I include it in the src of qgame? Why didn't it work when I did this, even though I included the libraries it needed? I'm not sure how much of this has to do with nodejs, and how much is due to bad setup …

http://stackoverflow.com/comment/81095466
has text: This was some time ago, out of interest i ended up using the .ogg format, which works fine for voice.
comment on: http://stackoverflow.com/q/28667918
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45684099
score: 0
type: Comment
has text: Does form change when you push serialized string? I'm not sure about you logic, so you might want to add some details to the question about when you push this strings to array.
type: AnswerComment
comment on: http://stackoverflow.com/a/28696600

http://stackoverflow.com/q/28665924
has title: Counting unknown/dynamic array length of class element
has answer: http://stackoverflow.com/a/28665963
answer count: 1
tagged with: arrays
tagged with: javascript
score: 0
has body: I wrote a simple code/userscript to notify me about changes on a webiste: function notifier(){ setTimeout(function () { location.reload(true); },60000) } function notiCounter() { console.log("Counting notifications"); var noti = document.getElementsByClassName("notification"); for(var i = 0; i &lt; 2; i++) { if(noti[i].innerHTML != undefined) { console.log(noti[i].innerHTML); notifications++; console.log("Notifications: " + notifications); } } } function notification(){ setTimeout(function () { notiCounter(); if(notifications &gt; 0){ document.title = "(" + notifications + ") new notifcations"; sound.play(); } notifier(); },50) } notification(); The problem is, that the actual final number of noti[i] is unknown/dynamic and changes all the time, so if i &lt; 2 is replaced with a higher number the for loop ends up in an infinite loop - and if I pick it too low (2 for example), data will gets lost if the actual number is above 2. Any idea about that problem? Maybe it's really obvious and I can't see, as it is really late haha.
type: UnansweredQuestion
tagged with: getelementsbyclassname
type: Question

http://stackoverflow.com/q/28738881
has answer: http://stackoverflow.com/a/28739145
tagged with: javascript
has comment: http://stackoverflow.com/comment/45761681
has title: Radio buttons and checkboxes. Prevent changing of the value attribute
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has comment: http://stackoverflow.com/comment/45761784
favorite count: 0
accepted answer: http://stackoverflow.com/a/28739896
has answer: http://stackoverflow.com/a/28739287
has body: So you have a checkbox or a radio button with a predifined value to be sent to the database: &lt;input name="statement" type="radio" value="AWENSOME"&gt; But someone or a script, with bad intention can easily change the value of your checkbox/radio button with for example a basic "browser page inspect" and then send other value to the databse. For example: &lt;input name="statement" type="radio" value="NOT SO AWENSOME! STUPID"&gt; How can one prevent that guys? Thank you.
tagged with: php
tagged with: client-side-attacks
answer count: 4
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/28738983
upvote count: 1
has answer: http://stackoverflow.com/a/28738983
type: Question
has answer: http://stackoverflow.com/a/28739896
has comment: http://stackoverflow.com/comment/45761527
has comment: http://stackoverflow.com/comment/45761649

http://stackoverflow.com/q/28616618
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45537083
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45536703
accepted answer: http://stackoverflow.com/a/28617348
has body: I am building a large application using AngularJS. The user lands on the login page, and upon login I open up one or two windows. Once open, based on various criteria, the windows will resize, close, or spawn more children. My issue is managing these! My Angular app can only reference either its direct parent window or windows it has spawned, but not all since the scope is limited to its window. I have tried storing the window objects in localStorage/cookies but that doesn't work due to circular references in the JSON.stringify. I'm at a bit of a loss here on how to structure in a programatic way without hard-coding everything which will not work long term. I have tried the below obviously, but it won't work because I need to be able to reference any window from any window. And I can't seem to store the var x anywhere. var x = window.open(...) How can I programmatically store and manage (close, open, resize, reposition) multiple windows in my app. If an elegant solution does not exist, how can I store &amp; retrieve window objects? UPDATE Okay looks like I figured out a way to solve this. I'm storing an array of window IDs in localStorage. Then any time I need to mess with one I read it in, call window.open(null, id).function() Since window.open returns a reference to the already open window it seems like this should work. Still would love any additional opinions...
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
has title: How to manage (open, close, resize) multiple windows
has answer: http://stackoverflow.com/a/28617348

http://stackoverflow.com/comment/45674848
comment on: http://stackoverflow.com/q/28690021
type: Comment
type: QuestionComment
has text: i think google analytics already provide statistics about the mobile and desktop
score: 0

http://stackoverflow.com/q/28593854
has answer: http://stackoverflow.com/a/49157441
favorite count: 0
has answer: http://stackoverflow.com/a/38569701
has comment: http://stackoverflow.com/comment/45494481
has comment: http://stackoverflow.com/comment/45494522
tagged with: datatables
has body: I have 2 tables that are using DataTable jQuery Plug-in. I wondering if there is a way to hide my pagination on the bottom right of my table. Note: Only show the pagination when I need one. Hide the pagination when the query results is less than 10.
has answer: http://stackoverflow.com/a/38853805
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/45995189
has answer: http://stackoverflow.com/a/28594013
has comment: http://stackoverflow.com/comment/45494818
has comment: http://stackoverflow.com/comment/45494344
has title: DataTable : How to hide the pagination and only show it as need?
type: Question
score: 20
upvote count: 20
linked to: http://stackoverflow.com/q/17832742
downvote count: 0
tagged with: javascript
answer count: 6
tagged with: jquery
has answer: http://stackoverflow.com/a/47766790

http://stackoverflow.com/q/28650447
has answer: http://stackoverflow.com/a/35895736
has body: I have a simple reactJS component like this : var LikeCon = React.createClass({ render: function() { return ( &lt;span&gt;Like&lt;/span&gt; ); } }); This is placed in a file called Common.jsx. Im trying to use this LinkeCon component from antoher jsx file like this var FeedTopic = React.createClass({ render: function() { var test = false; return ( &lt;div className="topic"&gt; {LikeCon} &lt;/div&gt; ); } }); The problem is that this exception is thrown Error while rendering "FeedBox" to "react1": ReferenceError: LikeCon is not defined This is how the import looks like on the Layoutpage &lt;script src="@Url.Content("~/Scripts/Common.jsx")"&gt;&lt;/script&gt; &lt;script src="@Url.Content("~/Scripts/Grid.jsx")"&gt;&lt;/script&gt; &lt;script src="@Url.Content("~/Scripts/Feed.jsx")"&gt;&lt;/script&gt; My thought was that if Common.jsx that contains the shared component was first, then the var would also be available to the other react components? Edit : this is placed on the Layout.cshtml &lt;script type="text/jsx" src="@Url.Content("~/Scripts/JSXTransformer.js")"&gt;&lt;/script&gt; &lt;script type="text/jsx" src="@Url.Content("~/Scripts/Common.jsx")"&gt;&lt;/script&gt; &lt;script type="text/jsx" src="@Url.Content("~/Scripts/Grid.jsx")"&gt;&lt;/script&gt; &lt;script type="text/jsx" src="@Url.Content("~/Scripts/Feed.jsx")"&gt;&lt;/script&gt; The component is now refered to with &lt;LikeCon like="0" /&gt; instead of {LikeCon}. Edit 2 : This is how I use the LikeCon var TopicComments = React.createClass({ render: function() { var comment = this.props.data.map(function(com, i) { return ( &lt;article key={i}&gt; &lt;div className="commentCon"&gt; &lt;div className="tUImgLnk"&gt; &lt;a title={com.UserName} target="_blank" href={com.UserInfoUrl}&gt; &lt;img className="tUImg" src={com.UserPicSrc} /&gt; &lt;/a&gt; &lt;/div&gt; &lt;b&gt;&lt;a href="#" title={"Visit " + com.UserName} target="_blank"&gt;{com.UserName}&lt;/a&gt;&lt;/b&gt;&amp;nbsp;:&amp;nbsp; &lt;span className="cont…
has comment: http://stackoverflow.com/comment/45599585
downvote count: 0
tagged with: asp.net
favorite count: 0
type: UnansweredQuestion
tagged with: components
has comment: http://stackoverflow.com/comment/45598676
has comment: http://stackoverflow.com/comment/46120035
has answer: http://stackoverflow.com/a/28654602
has comment: http://stackoverflow.com/comment/45599051
upvote count: 10
type: Question
has comment: http://stackoverflow.com/comment/45598766
has comment: http://stackoverflow.com/comment/45599508
tagged with: reactjs
answer count: 2
has title: How to use react components from other files
linked to: http://stackoverflow.com/q/944273
has comment: http://stackoverflow.com/comment/45598406
score: 10
has comment: http://stackoverflow.com/comment/45598827
tagged with: javascript

http://stackoverflow.com/q/28750526
tagged with: kendo-ui
score: 0
has comment: http://stackoverflow.com/comment/45787149
has comment: http://stackoverflow.com/comment/45786506
has title: Properly Initialize Client Side Model
tagged with: angularjs
has answer: http://stackoverflow.com/a/28751299
type: UnansweredQuestion
tagged with: entity-framework
type: Question
tagged with: kendo-grid
has body: My issue is very simple. I am using ASP Web API, Entity Framework, Angular, and Kendo UI. I have 2 classes, FREQUENCY and FREQ_TYPE_. Class FREQUENCY has a navigation property to class FREQ_TYPE. I have a kendo ui grid that loads 10 class FREQUENCY models. Each class FREQUENCY model has it's FREQ_TYPE data loaded properly. My problem is that when I create a new row in my kendo ui grid and try to save the row to the server, I get an error saying the navigation property FREQ_TYPE needs to be initialized. This is expected of course since kendo doesn't know how to auto=initialize my nav properties. What is the best practice for giving my angular JS client the knowledge it needs to create a new class FREQ_TYPE so I can properly initialize class FREQUENCY and save it to the server? My models only exist as code-first entity models, so I can't just create a new model in my client side JS as it doesn't know about these models. Is there some framework that can generate local model classes from an EF database? Or do I just have to manually set all the json fields for my class FREQ_TYPE navigation property? Or is there an easier way for me to use Web API so that I can make a request to "figure out" what the model info is and create a client side JS model without needing to have a "local model"? Here is the client side grid and datasource: $(document).ready(function () { var crudServiceBaseUrl = "http://localhost:29858/"; var NIICDDS = new kendo.data.DataSource({ transport: { read: { url: crudServiceBaseUrl + "api/NIICDFreq", dataType: "json" }, update: { url: function (data) { console.log("DATA TEST"); console.log(data); return crudServiceBaseUrl + "api/NIICDFreq/"; }, // url: crudServiceBaseUrl + "api/VHFMasterLists", dataType: "json", data: function (data) { console.log("returning data in update TEST"); console.log(data.models[0]); return data.models[0]; }, type: "PUT", contentType: "application/json; charset=utf-8", }, destroy: { url: crudServiceBaseUrl + "api/NIICDFreq", da…
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/45614249
score: 0
type: Comment
type: QuestionComment
has text: i.e elementFromPoint, like here (it gives me IFRAME or HTML obj, instead of DIV): http://jsfiddle.net/u51Lguyn/5/
comment on: http://stackoverflow.com/q/28659354

http://stackoverflow.com/comment/45547824
type: Comment
has text: Ok, let me implement and check
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28623000

http://stackoverflow.com/q/28608378
tagged with: javascript
score: 0
answer count: 2
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28608441
tagged with: twitter-bootstrap
tagged with: http://stackoverflow.com/tag/html
has title: Paginaton Can't Select Original
has body: I have a problem with my webpage, my main problem is with Bootstrap and JQuery working together. $("ul.pagination li:not(.active) a").on("click",function(){ $(".pagination li.active").removeClass("active"); $(this).parent().addClass("active"); $(".page").hide(); $("#"+$(this).text().toLowerCase()+"Page").show(); }); Home Outside Fort Settings As you can see, it works fine. Until you attempt to move back to the page that was initially active. I also have the code I use for switching pages in the snipped, does anyone has a fix for this?
possible better answer: http://stackoverflow.com/a/28608510
has answer: http://stackoverflow.com/a/28608510
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28608441

http://stackoverflow.com/q/28717004
answer count: 1
downvote count: 0
has body: I am trying to make the selectize.js input in the navbar bigger, but the selectize's css is applied and it ignores input-large classes. I tried to set even manually the style width for the element but it gets overwritten. navbar and buttons are standard bootstrap: Toggle navigation brand Home Browse Go Account <a >Settings Logout then I just fire up selectize.js : $(document).ready(function(){ $('#searchBox').selectize({ valueField: 'tagName', labelField: 'tagName', searchField: 'tagName', maxItems: 1, load: function(query, callback) { }}); }); A problem that the input shows higher than the button was fixed by commenting out the overflow as suggested in selectize's github as follows: .selectize-input { border: 1px solid #cccccc; padding: 6px 12px; display: inline-block; width: 100%; /* overflow: hidden;*/ position: relative; z-index: 1; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-box-shadow: none; box-shadow: none; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } but I am not sure what property I should change to make the input bigger. you can take a look at the jsfiddle here: http://jsfiddle.net/arisalexis/rncujmnk/
favorite count: 0
upvote count: 2
tagged with: twitter-bootstrap
tagged with: selectize.js
accepted answer: http://stackoverflow.com/a/28720380
tagged with: css
score: 2
type: AnsweredQuestion
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28720380
has title: bootstrap input in navbar with selectize.js not expanding

http://stackoverflow.com/comment/45690391
score: 0
comment on: http://stackoverflow.com/q/28700137
type: Comment
type: QuestionComment
has text: Well you have to quote that string, but I can assure that you will need to more than just echo out the tweet. There will be quotes and junk in there that will cause JavaScript errors.

http://stackoverflow.com/comment/45774819
type: Comment
type: QuestionComment
has text: So whenever I create a Model, mongoose will know? What is the point of requiering it then?
comment on: http://stackoverflow.com/q/28746229
score: 0

http://stackoverflow.com/q/28597821
answer count: 2
tagged with: javascript
linked to: http://stackoverflow.com/q/21832869
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/28597872
has answer: http://stackoverflow.com/a/28597902
tagged with: cordova
type: UnansweredQuestion
tagged with: intel-xdk
has body: Trying to get the data from a div inside onclick event dynamically Buy Print
type: Question
has title: Add div data inside onclick dynamically

http://stackoverflow.com/comment/45547641
type: AnswerComment
has text: Thanks Jai! I found Arun's answer to be suitable for me.
type: Comment
comment on: http://stackoverflow.com/a/28622812
score: 0

http://stackoverflow.com/q/28740898
has body: I want to change the position of div with for loop .. I made an animation .. When i click a div ( circle ) it moves to a position that is being determined with Math.random() .. I dont want to click the div to move to another position . I want to use for loop method and i want div to move another position in every 2 seconds or some seconds .. Do you have any advise .. Thanks Click to see how it is $(document).ready(function () { $("#circle").click(function () { var width = Math.random(); var yeniwidth = width * 500; margin = Math.round(yeniwidth); $("#circle").css("margin-top", margin + "px"); var height = Math.random(); var yeniheight = height * 1000; margin2 = Math.round(yeniheight); $("#circle").css("margin-left", margin2 + "px"); }); }); Codepen
has title: How to use math.random() with for loop
score: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28741144
accepted answer: http://stackoverflow.com/a/28741144
linked to: http://stackoverflow.com/q/13784686
has comment: http://stackoverflow.com/comment/45766695
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28747052
has body: IE cannot eval functions (Presumably for security reasons). The best workaround is to put the function in an array, like this: var func = eval('[' + funcStr + ']')
score: 0
answers question: http://stackoverflow.com/q/28746050
type: Answer

http://stackoverflow.com/q/28644209
has comment: http://stackoverflow.com/comment/45586497
answer count: 2
has comment: http://stackoverflow.com/comment/45586491
linked to: http://stackoverflow.com/q/8577762
tagged with: javascript
linked to: http://stackoverflow.com/q/5404839
tagged with: jquery
favorite count: 0
duplicate of: http://stackoverflow.com/q/5404839
has comment: http://stackoverflow.com/comment/45586556
has answer: http://stackoverflow.com/a/28644404
score: 2
has comment: http://stackoverflow.com/comment/45586573
upvote count: 3
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28644373
has body: How to deep refresh window in jQuery like you press F5 twice. Currently I'm using this. &lt;script&gt; window.onload = function() { if (!window.location.hash) { window.location = window.location + '#loaded'; window.location.reload(); } } &lt;/script&gt; Thanks! And it should not take much time to refresh. My webpage is in PHP.
has comment: http://stackoverflow.com/comment/45586676
tagged with: php
downvote count: 1
has comment: http://stackoverflow.com/comment/45586664
has comment: http://stackoverflow.com/comment/45586815
has comment: http://stackoverflow.com/comment/45586618
has title: Ctrl + F5 in jquery to clear browser cache
has comment: http://stackoverflow.com/comment/45586820
type: Question

http://stackoverflow.com/comment/45553231
type: QuestionComment
comment on: http://stackoverflow.com/q/28626037
score: 1
has text: in my understanding if you have a table in your JSON object it means you have an array of arrays. To get the number of "rows" just do myJsonObject.length. Or did I misunderstand you?
type: Comment

http://stackoverflow.com/a/70391194
type: Answer
score: 2
has body: const res1 = await db.collection("some-db").find() Here, res1 will contain a "cursor" which has a circular structure, hence the given error is thrown. Try adding const res2 = await res1.toArray() to the code. Here, res2 will now contain an array of documents, pointed by cursor res1, which is the documents you were querying for.
upvote count: 2
answers question: http://stackoverflow.com/q/28715859
has comment: http://stackoverflow.com/comment/138887110
downvote count: 0

http://stackoverflow.com/a/28696870
has comment: http://stackoverflow.com/comment/45683912
has comment: http://stackoverflow.com/comment/45685026
has comment: http://stackoverflow.com/comment/45684011
has comment: http://stackoverflow.com/comment/45711858
has body: First Method Url string var strURL="yourfilepath?string1="+string1+"&amp;string4="+string4 Then use window.open() var mywindow = window.open(strURL,'','width=690,height=1000,scrollbars=1,resizable=1,top=10,left=200'); Second method using jquery $('#dialog').load('yourpath', function() { $(this).dialog({ modal: true, height: 200 }); }); third Method protected void Button_Click(object sender, EventArgs e) { string string1 = "pagename.aspx" ; string newWindow ="window.open('" + string1+ "');"; ClientScript.RegisterStartupScript(this.GetType(), "pop", newWindow, true); }
has comment: http://stackoverflow.com/comment/45684096
has comment: http://stackoverflow.com/comment/45684839
has comment: http://stackoverflow.com/comment/45685574
score: 0
has comment: http://stackoverflow.com/comment/45683975
has comment: http://stackoverflow.com/comment/45684152
has comment: http://stackoverflow.com/comment/45684525
type: Answer
has comment: http://stackoverflow.com/comment/45685391
has comment: http://stackoverflow.com/comment/45712532
has comment: http://stackoverflow.com/comment/45684169
answers question: http://stackoverflow.com/q/28696656
has comment: http://stackoverflow.com/comment/45684771
has comment: http://stackoverflow.com/comment/45684248
has comment: http://stackoverflow.com/comment/45684910

http://stackoverflow.com/q/28633264
type: Question
tagged with: javascript
has title: Javascript Game Betting
has comment: http://stackoverflow.com/comment/45566730
downvote count: 10
score: -9
has comment: http://stackoverflow.com/comment/45566506
answer count: 2
favorite count: 0
has answer: http://stackoverflow.com/a/28641905
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: Simple game just figuring out code for the player bank The HTML/CSS is: Bank Plant! The JavaScript is function Plant(){ var betAmount = document.getElementById("betAmount").value; var bank = document.getElementById("bank").value; document.getElementById('bank').innerHTML = bank - betAmount; } Ive also tried passing the code through another variable but it doesn't seem to work either.
has answer: http://stackoverflow.com/a/28633781
upvote count: 1
has comment: http://stackoverflow.com/comment/45566676

http://stackoverflow.com/q/28635493
has comment: http://stackoverflow.com/comment/45621765
tagged with: google-maps
tagged with: javascript
score: 0
upvote count: 1
downvote count: 1
has title: Google Maps API FusionTablesLayer alter styles based on user input
favorite count: 0
answer count: 0
type: UnansweredQuestion
tagged with: css
has body: This is my first question on SO, so apologies if I leave anything out, but I have searched and haven't been able to come up with an answer. I am trying to build a small map app using Fusion Tables and the Maps API for local authority level data in England. The table has a number of columns which can then be combined into an overall score using user-inputted weights. It is this overall score that I would like to be able to map by local authority. So something like 0.5 * Col1 + 0.25 * Col2 + 0.25 * Col3, or however they like. I can make this info show up in the infoWindow pretty easily, as below: google.maps.event.addListener(layer, 'click', function(e) { infoWindow.setContent((e.row['Col1'].value*weight1 + e.row['Col2'].value*weight2 + weight3*e.row['Col3'].value )) ; infoWindow.setPosition(e.latLng); infoWindow.open(map); }) However, I would also like to be able to colour the local authority polygons on a gradient according to this calculated score. I have seen this technique for using conditionals to format the colour of polygons: http://w3facility.org/question/in-fusion-tables-can-a-gradient-be-set-via-the-google-maps-javascript-based-api/ styles: [{ where: "'Col1' &gt; 200", polygonOptions: { fillColor: '#FFF000', fillOpacity: 1 } }, {where: "'Col1' &lt; 200", polygonOptions: { fillColor: '#FFFFFF', fillOpacity: 1 } } ] However, I have tried and can't seem to use the "weight1" etc variables in here (presumably because it's a request to Fusion Tables, not something calculated at the browser level). What I would like to know is whether anyone knows any way around this, to be able to dynamically combine columns to affect style according to user-input? I guess one other way to do it would be to send a column to the Fusion Table based on the user input and then call it back and compare, but I can't find how to do this either. Thanks so much for your help. C
has comment: http://stackoverflow.com/comment/45601755
tagged with: google-fusion-tables
type: Question

global
type: Tag
tags question: http://stackoverflow.com/q/28633824
tags question: http://stackoverflow.com/q/28726366
tag name: global
tags question: http://stackoverflow.com/q/28707907

http://stackoverflow.com/a/29051367
upvote count: 1
has body: According to my experience you have to use History API to achieve your goal. Thus, when you open your dialog you should push new state to history stack. And hence when user will hit back you can capture 'popstate' event and hide/close it from there. You should also note that when dialog is closed in one of the designed ways (like clicking on backdrop) you should manually pop all the states you've pushed to the history stack.
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28594555
type: Answer

http://stackoverflow.com/q/28629163
type: Question
has comment: http://stackoverflow.com/comment/45558740
tagged with: http://stackoverflow.com/tag/html
score: 1
possible better answer: http://stackoverflow.com/a/28630675
tagged with: fileapi
accepted answer: http://stackoverflow.com/a/28630416
has answer: http://stackoverflow.com/a/28630675
upvote count: 2
answer count: 2
has body: I am trying to upload multiple images with File API. I want to show picture thumbnails and their names as title tag. The problem is I am not getting correct picture name as title tag. All pictures are showing same name. Here is my Original code... jQuery, CSS and HTML var output = document.getElementById("result"); $(document).ready(function () { //Check File API support if (window.File && window.FileList && window.FileReader) { $('#files').on("change", function (event) { var files = event.target.files; //FileList object var iCount = files.length; for (var i = 0, f; i < iCount; i++) { var file = files[i]; //Only pics if (file.type.match('image.*')) { var picReader = new FileReader(); picReader.addEventListener("load", function (event) { var picFile = event.target; var div = document.createElement("div"); div.innerHTML = " "; output.insertBefore(div, null); }); //Read the image $('#clear, #result').show(); picReader.readAsDataURL(file); } else { alert("You can only upload image file."); $(this).val(""); } } }); } else { console.log("Your browser does not support File API"); } $("#upload").on('submit',(function() { var data = new FormData(this); var iUploaded = 0; setTimeout(function() { var iCount = document.getElementById('files').files.length; for (var i = 0; i < iCount ; i++) { data.append("Index", i); $.ajax( { url: "upload.php", type: "POST", data: data, contentType: false, cache: false, processData:false, async: false, success: function(response) { var sRes = response.split("|-|"); if(sRes['0'] == 'success') { iUploaded = iUploaded + 1; $("#message").html(iUploaded + " of " + sRes['1'] + " Pictures Uploaded") } } }); } }, 500); })); $("#files").change(function() { $("#submit").trigger("click"); }); $('#clear').on("click", function () { $('.thumbnail').parent().remove(); $('#result').hide(); $('#files').val(""); $(this).hide(); }); }); body{ font-family: 'Segoe UI'; font-size: 12pt; } header h1{ font-size:12pt; color: #fff; background-color: #1BA1E2; padding: 20…
downvote count: 1
has comment: http://stackoverflow.com/comment/45560241
has comment: http://stackoverflow.com/comment/45558543
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28630416
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: HTML5 File API Upload Multiple Images with Ajax

http://stackoverflow.com/q/28714942
has comment: http://stackoverflow.com/comment/45717850
type: Question
has comment: http://stackoverflow.com/comment/45722365
has answer: http://stackoverflow.com/a/28715156
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45717491
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: How am I getting the scope wrong? Unable to access this function from jQuery ".on"
type: UnansweredQuestion
has body: Morning all, I'm using the following code to somewhat imitate setInterval with AJAX: // Poll for ALERTs (function pollForAlerts() { var params = { "send": 1, "poll": 1 }; // Set up the correct patch for sending AJAX data ALERTS = {}; ALERTS.Auth = { site: data_site, uuid: data_uuid }; ALERTS.API = function(app,data) { var url = "//myurl.com/alerts/"+ app +"/?"; var data = $.extend({}, ALERTS.Auth, data); return url + jQuery.param(data || "") + '&amp;timestamp='+$.now(); } // Run the AJAX request $.getJSON( ALERTS.API( 'touchscreen', params ) , function (response) { if( typeof response === "object" ) { for( var i = 0; i &lt; response.length; i++ ) renderAlert(response[i]); } else { setTimeout( pollForAlerts, 3000 ); } }); }()); The function runs repeatedly until it finds a response. I'd like to then set a jQuery ".on" to restart this loop if a certain element is clicked on: // Respond to ALERT $('#alerts').on('click', 'td.initials span', function(event) { $(this).closest('tr').removeClass("active abs cri"); pollForAlerts(); }); However, when I do that, I get the following error in Firebug: ReferenceError: pollForAlerts is not defined http://myurl.com/alerts/static/js/touchscreen.js Line 14 I can't work out why pollForAlerts() can't be accessed. Is it because of the self-executing function, or is it just because it's being used within jQuery's on function? I'm not JavaScript expert, especially when it comes to self-executing functions and closures, so please be gentle with me! Duncan
downvote count: 0
score: 1
tagged with: closures

http://stackoverflow.com/a/28732898
answers question: http://stackoverflow.com/q/28732846
has body: A couple of problems: First, change these lines var plus = eval(Natures.nature['pos']); var minus = eval(Natures.nature['neg']); base.plus = Math.floor(base.plus*1.1); base.minus = Math.floor(base.minus*0.9); to var plus = eval(Natures[nature]['pos']); var minus = eval(Natures[nature]['neg']); base[plus] = Math.floor(base[plus]*1.1); base[minus] = Math.floor(base[minus]*0.9); Secondly, eval('Atk') or eval('SpA') will not work unless these are defined somewhere else.
has comment: http://stackoverflow.com/comment/45774709
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45778773
has comment: http://stackoverflow.com/comment/45775146

vb.net
tags question: http://stackoverflow.com/q/28749779
tags question: http://stackoverflow.com/q/28706300
type: Tag
tags question: http://stackoverflow.com/q/28676323
tag name: vb.net
tags question: http://stackoverflow.com/q/28685266
tags question: http://stackoverflow.com/q/28677491

http://stackoverflow.com/q/28608750
type: Question
accepted answer: http://stackoverflow.com/a/28609502
tagged with: javascript
tagged with: browser-history
has body: I have a requirement within my Angular app which uses the Angular UI Router, to go back from one screen (URL) to a previously visited screen (URL). There are several screens (URLs) where it's possible to visit the destination page. It's not quite as straight forward as a simple history.back() operation though` because I have several interim states that can occur in any order and any number. To get around this I have implemented a wrapper around the Angular $location service, like so: (function () { 'use strict'; angular .module('myApp') .factory('locn', ['$location', '$state', function ($location, $state) { var states = []; return { go: function (url) { $location.path(url); }, pushandgo: function (state, params) { states.push({ name: $state.current.name, params: $state.params }); $state.go(state, params); }, push: function (url) { states.push(url); }, pop: function () { var state = states.pop(); $state.go(state.name, state.params); }, search: function (searchDict) { $location.search(searchDict); } }; }]); })(); As you can see, this stores the state in a javascript local variable of the locn service. I can call pushandgo and that means when I subsequently call pop I can return to the page I came from (regardless of what page that was). This works OK, until the user refreshes the page when they are on the destination page. The states array is recreated loosing all previously pushed states. I'm struggling to come up with a nice solution to this other than using cookies or local storage (yuck).
has answer: http://stackoverflow.com/a/28609154
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/41943217
possible better answer: http://stackoverflow.com/a/28609154
tagged with: angularjs
has answer: http://stackoverflow.com/a/28609502
tagged with: html5-history
type: AnsweredQuestion
has title: History API/Angular: how to go back to predetermined URL

http://stackoverflow.com/comment/45565771
has text: This worked great! I was able to modify it a bit to work inside _.filter(). Thanks!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28632359
type: AnswerComment

http://stackoverflow.com/comment/45665454
type: Comment
comment on: http://stackoverflow.com/a/28670059
has text: It says Failed to load resource: the server responded with a status of 404 (Not Found) But I am very sure of my location of file. Thanks for the response.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45570550
score: 1
comment on: http://stackoverflow.com/q/28635337
has text: I don't think you can achieve this using only PHP.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45601100
comment on: http://stackoverflow.com/a/28651614
type: AnswerComment
type: Comment
score: 2
has text: @Bergi I am leaving this as the answer because the internal optimisations of JS VMs should not IMO affect my conceptual understanding of the language.

http://stackoverflow.com/a/28691148
has comment: http://stackoverflow.com/comment/45698293
accepted answer of: http://stackoverflow.com/q/28689939
has comment: http://stackoverflow.com/comment/45760074
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28689939
has comment: http://stackoverflow.com/comment/45682601
type: Answer
score: 1
has body: Most likely you're getting a value of 0 because you're printing the information before the page has completed loading, try the following snippet: window.onload = function(){ setTimeout(function(){ var t = performance.timing; console.log(t.loadEventEnd - t.responseEnd); }, 0); } That will make sure the numbers are printed after the page is actually ready. Got that snippet from here. Other information from that page you might find interesting: Data from the API really comes to life when events are used in combination: Network latency (): responseEnd-fetchStart. The time taken for page load once the page is received from the server: loadEventEnd-responseEnd. The whole process of navigation and page load: loadEventEnd-navigationStart.
upvote count: 1
downvote count: 0

http://stackoverflow.com/a/75560282
type: Answer
answers question: http://stackoverflow.com/q/28654091
has body: const string = 'acbbaeekzzkeee'; function letterCount(str) { return [...str].reduce((acc, letter, index) =&gt; { if (index === 0 || letter !== str[index - 1]) { acc.push([letter, 1]); } else { acc[acc.length - 1][1]++; } return acc; }, []); } const count = letterCount(string); console.log(count); ...spread string into array Loop through it with reduce, which initial value is empty array if it is first letter or previous letter is not same as letter Make an array with [letter, 1] and push it into accumulator array (1 is initial count/value) else increment previous array's value in accumulator's array. Since previous array will have same letter as our current letter So whenever we have new value (non-consecutively) we add an array into array. Else we increment last array's value (it will be same letter)
score: 0

http://stackoverflow.com/q/28740721
has body: I have a link shared to some sites, clicking on that will execute a Web API and will 1.redirect by a custom URL schema, 2.That in turn will up my app/ if not installed will display an image. My problem is that this works perfectly fine on iOS 7, but not working in iOS 8:( We are using a java script to redirect this document.location () method ? Any possibilities how I could solve this issue? I was searching for any errors since last one week, no idea about whats happening in iOS 8.0. I have checked whether custom URL schema working on iOS 8.0 or not, but it worked just fine when I typed directly to browser. So I came to a conclusion that the java script code document.location() used for redirecting not working on iOS 8.0(Assumption). Any help would be appreciated.
has comment: http://stackoverflow.com/comment/51483835
type: Question
has comment: http://stackoverflow.com/comment/51491942
tagged with: ios
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
has title: document.location() used for redirection in javascript not working for iOS8.0
answer count: 0
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/a/28605457
score: 6
has comment: http://stackoverflow.com/comment/45516078
answers question: http://stackoverflow.com/q/28605393
has comment: http://stackoverflow.com/comment/45516614
accepted answer of: http://stackoverflow.com/q/28605393
has body: Nope, there is no size upload limit. here is the spec and here is a related question on how to check the file size, so that you can add limits if you like. It's worth pointing out that if you are looking to store the file on the server, you might hit file upload limits/restrictions there. But you should be able to configure them. i.e. php/wordpress default upload limit
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45516300
downvote count: 0
type: Answer
upvote count: 6

http://stackoverflow.com/comment/45720827
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28716024
has text: thats solved now its only returning 25 records i also tried to put limit like /feed?limit=50, my problem is i need more than 25 records, how can do that?
score: 0

http://stackoverflow.com/q/28707691
has answer: http://stackoverflow.com/a/28707945
has title: How do I create a function that checks if a date is a palindrome?
has comment: http://stackoverflow.com/comment/45705088
possible better answer: http://stackoverflow.com/a/28707945
has body: My question has two parts. I'm trying to check whether a date is a palindrome or not. In the following code, I continuously get the result of "Not a palindrome" even if the string is in fact a palindrome. function isPalindrome(str){ var rev = str.reverse; if(str === rev){ console.log("This is a palindrome."); } else{ console.log("Not a palindrome"); } } isPalindrome("2002"); The second part to my question is: if I wanted the function to take two arguments function isPalindrome(start_date, end_date)and have it check the dates between for palindrome years and then return those years chronologically, how do I do that? I'm not asking for anyone to actually do it for me. I'm just asking for an explanation on how to accomplish it. Thanks in advance.
has answer: http://stackoverflow.com/a/28707739
has answer: http://stackoverflow.com/a/28707778
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/28707739
tagged with: javascript
has comment: http://stackoverflow.com/comment/45704814
linked to: http://stackoverflow.com/q/958908
score: 0
answer count: 3

css
tags question: http://stackoverflow.com/q/28647726
tags question: http://stackoverflow.com/q/28725431
tags question: http://stackoverflow.com/q/28631034
tags question: http://stackoverflow.com/q/28682643
tags question: http://stackoverflow.com/q/28704253
tags question: http://stackoverflow.com/q/28690031
tags question: http://stackoverflow.com/q/28722330
tags question: http://stackoverflow.com/q/28745529
tags question: http://stackoverflow.com/q/28642558
tags question: http://stackoverflow.com/q/28652726
tags question: http://stackoverflow.com/q/28635199
tags question: http://stackoverflow.com/q/28700589
tags question: http://stackoverflow.com/q/28676750
tags question: http://stackoverflow.com/q/28694959
tags question: http://stackoverflow.com/q/28598223
tags question: http://stackoverflow.com/q/28669465
tags question: http://stackoverflow.com/q/28671984
tags question: http://stackoverflow.com/q/28660242
tags question: http://stackoverflow.com/q/28712561
tags question: http://stackoverflow.com/q/28667565
tags question: http://stackoverflow.com/q/28692345
tags question: http://stackoverflow.com/q/28697963
tags question: http://stackoverflow.com/q/28717102
tags question: http://stackoverflow.com/q/28685492
tags question: http://stackoverflow.com/q/28614791
tags question: http://stackoverflow.com/q/28632053
tags question: http://stackoverflow.com/q/28655126
tags question: http://stackoverflow.com/q/28705018
tags question: http://stackoverflow.com/q/28735497
tags question: http://stackoverflow.com/q/28603588
tags question: http://stackoverflow.com/q/28746216
tags question: http://stackoverflow.com/q/28663377
tags question: http://stackoverflow.com/q/28715182
tags question: http://stackoverflow.com/q/28664217
tags question: http://stackoverflow.com/q/28741089
tags question: http://stackoverflow.com/q/28743424
tags question: http://stackoverflow.com/q/28677363
tags question: http://stackoverflow.com/q/28600776
tags question: http://stackoverflow.com/q/28702870
tags question: http://stackoverflow.com/q/28651282
tags question: http://stackoverflow.com/q/28622553
tags question: http://stackoverflow.com/q/28674046
tags question: http://stackoverflow.com/q/28679198
tags question: http://stackoverflow.com/q/28723225
tags question: http://stackoverflow.com/q/28736832
tags question: http://stackoverflow.com/q/28749519
tags question: http://stackoverflow.com/q/28736681
tags question: http://stackoverflow.com/q/28668025
tags question: http://stackoverflow.com/q/28691994
tags question: http://stackoverflow.com/q/28750188
tags question: http://stackoverflow.com/q/28719378
tags question: http://stackoverflow.com/q/28625843
tags question: http://stackoverflow.com/q/28649986
tags question: http://stackoverflow.com/q/28667975
tags question: http://stackoverflow.com/q/28625094
tags question: http://stackoverflow.com/q/28664098
tags question: http://stackoverflow.com/q/28655385
tags question: http://stackoverflow.com/q/28609539
tags question: http://stackoverflow.com/q/28749104
tags question: http://stackoverflow.com/q/28691766
tags question: http://stackoverflow.com/q/28610927
tags question: http://stackoverflow.com/q/28626128
tags question: http://stackoverflow.com/q/28681077
tags question: http://stackoverflow.com/q/28746908
tags question: http://stackoverflow.com/q/28748684
tags question: http://stackoverflow.com/q/28706520
tags question: http://stackoverflow.com/q/28734585
tags question: http://stackoverflow.com/q/28671867
tags question: http://stackoverflow.com/q/28623304
tags question: http://stackoverflow.com/q/28722951
tags question: http://stackoverflow.com/q/28748410
tags question: http://stackoverflow.com/q/28624092
tags question: http://stackoverflow.com/q/28749989
tags question: http://stackoverflow.com/q/28667070
tags question: http://stackoverflow.com/q/28619300
tags question: http://stackoverflow.com/q/28658512
tags question: http://stackoverflow.com/q/28726298
tags question: http://stackoverflow.com/q/28614760
tags question: http://stackoverflow.com/q/28697240
tags question: http://stackoverflow.com/q/28635103

http://stackoverflow.com/comment/45619463
has text: Here are the instructions I was given: (Removing Negatives) Given an array X of multiple values (e.g. [-3,5,1,3,2,10]), write a program that removes any negative values in the array. Once your program is done X should be composed of just positive numbers. Do this without creating a temporary array and only using pop method to remove any values in the array.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28653203

node.js
tags question: http://stackoverflow.com/q/28722102
tags question: http://stackoverflow.com/q/28630432
tags question: http://stackoverflow.com/q/28731992
tags question: http://stackoverflow.com/q/28705866
tags question: http://stackoverflow.com/q/28657119
tags question: http://stackoverflow.com/q/28619582
tags question: http://stackoverflow.com/q/28700022
tags question: http://stackoverflow.com/q/28737671
tags question: http://stackoverflow.com/q/28601204
tags question: http://stackoverflow.com/q/28661575
tags question: http://stackoverflow.com/q/28654767
tags question: http://stackoverflow.com/q/28733046
tags question: http://stackoverflow.com/q/28703872
tags question: http://stackoverflow.com/q/28709809
tags question: http://stackoverflow.com/q/28729447
tags question: http://stackoverflow.com/q/28624982
tags question: http://stackoverflow.com/q/28595198
tags question: http://stackoverflow.com/q/28642494
tags question: http://stackoverflow.com/q/28669114
tags question: http://stackoverflow.com/q/28739098
tags question: http://stackoverflow.com/q/28643775
tags question: http://stackoverflow.com/q/28667505
tags question: http://stackoverflow.com/q/28745080
tags question: http://stackoverflow.com/q/28733840
tags question: http://stackoverflow.com/q/28619262
tags question: http://stackoverflow.com/q/28643916
tags question: http://stackoverflow.com/q/28742052
tags question: http://stackoverflow.com/q/28603799
tags question: http://stackoverflow.com/q/28723713
tags question: http://stackoverflow.com/q/28680911
tags question: http://stackoverflow.com/q/28622467
tags question: http://stackoverflow.com/q/28747808
tags question: http://stackoverflow.com/q/28651534
tags question: http://stackoverflow.com/q/28605925
tags question: http://stackoverflow.com/q/28619982
tags question: http://stackoverflow.com/q/28685092
tags question: http://stackoverflow.com/q/28748337
tags question: http://stackoverflow.com/q/28749801
tags question: http://stackoverflow.com/q/28638591
tags question: http://stackoverflow.com/q/28625257
tags question: http://stackoverflow.com/q/28696203
tags question: http://stackoverflow.com/q/28657153
tags question: http://stackoverflow.com/q/28671174
tags question: http://stackoverflow.com/q/28636506
tags question: http://stackoverflow.com/q/28598286
tags question: http://stackoverflow.com/q/28618502
tags question: http://stackoverflow.com/q/28656780
tags question: http://stackoverflow.com/q/28731664
tags question: http://stackoverflow.com/q/28693852
tags question: http://stackoverflow.com/q/28648929
tags question: http://stackoverflow.com/q/28655385
tags question: http://stackoverflow.com/q/28650935
tags question: http://stackoverflow.com/q/28725052
tags question: http://stackoverflow.com/q/28645434
tags question: http://stackoverflow.com/q/28724169
tags question: http://stackoverflow.com/q/28644634
tags question: http://stackoverflow.com/q/28742684
tags question: http://stackoverflow.com/q/28686138
tags question: http://stackoverflow.com/q/28658576
tags question: http://stackoverflow.com/q/28651663
tags question: http://stackoverflow.com/q/28616584
tags question: http://stackoverflow.com/q/28598193
tags question: http://stackoverflow.com/q/28664758
tags question: http://stackoverflow.com/q/28668434
tags question: http://stackoverflow.com/q/28683647
tags question: http://stackoverflow.com/q/28620259
tags question: http://stackoverflow.com/q/28644202
tags question: http://stackoverflow.com/q/28732253
tags question: http://stackoverflow.com/q/28745785
tags question: http://stackoverflow.com/q/28683638
tags question: http://stackoverflow.com/q/28705050
tags question: http://stackoverflow.com/q/28745468
tags question: http://stackoverflow.com/q/28683194
tags question: http://stackoverflow.com/q/28660013
tags question: http://stackoverflow.com/q/28606443
tags question: http://stackoverflow.com/q/28749471
tags question: http://stackoverflow.com/q/28680741
tags question: http://stackoverflow.com/q/28674771
tags question: http://stackoverflow.com/q/28678764
tags question: http://stackoverflow.com/q/28717725

http://stackoverflow.com/a/28743854
answers question: http://stackoverflow.com/q/28737992
has body: Solved it using this. chart.addListener("clickGraphItem", function(e){ if(e.item.index == 0) { var tester1 = document.getElementById('button-1'); $(tester1).click(); }
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28737992
score: 0

http://stackoverflow.com/q/28641850
has answer: http://stackoverflow.com/a/28643029
tagged with: gruntjs
score: 0
answer count: 1
tagged with: jasmine
has title: Unable to Create Jasmine Concurrent Grunt Task
has body: I have set up a bunch of taks that all work but I am having trouble configuring my tests task. I have Jasmine-node up and running and I am able to run my tests from the command line, but I can't seem to get the grunt task working. GruntFile.js: module.exports = function(grunt) { 'use strict'; require('time-grunt')(grunt); require('load-grunt-config')(grunt, { jitGrunt: true }); }; aliases.yaml: (shortened to show only the test task) test: - 'concurrent:test' test.js module.exports = { jasmine: { all: { src: '.', options: { specs: ['../tests/sms/textReceiver-spec.js'] } } } }; Folder Structure: grunt concurrent.js test.js etc GruntFile.js tests sms textReceiver-spec.js The task loads but it just sits there, and nothing happens. No further information, not even an error. It makes me think it's just not finding my test files? But I've tried linking to a file directly, with the same result. Result: ben_cripps$ grunt test Running "concurrent:test" (concurrent) task but that's it
accepted answer: http://stackoverflow.com/a/28643029
tagged with: grunt-concurrent
tagged with: node.js
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45585823
tagged with: javascript

http://stackoverflow.com/q/28670131
downvote count: 5
has answer: http://stackoverflow.com/a/28670383
has title: What is wrong with following javascript code
answer count: 2
has answer: http://stackoverflow.com/a/28670417
tagged with: javascript
has comment: http://stackoverflow.com/comment/45634288
favorite count: 0
has comment: http://stackoverflow.com/comment/45634388
has comment: http://stackoverflow.com/comment/45634584
score: -3
has comment: http://stackoverflow.com/comment/45634229
has body: what is wrong with the following code? I had problem to mix double quotes, with single quotes. so, I defined separate method for onclick. Some how it seems syntax is not right &lt;table style='border-style:none; cursor:pointer;' onclick="myFunc()" &gt; function myFunc() { width1= getWindowDim().width; height1= getWindowDim().height; opt23='resizable=yes,fullscreen=yes,location=no,toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,fullscreen=yes,width='+width1 +',height='+heigh1; window.open('http://ibm.com','popupwin',opt23); }
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45634227
type: Question
has comment: http://stackoverflow.com/comment/45634339
has comment: http://stackoverflow.com/comment/45634575
has comment: http://stackoverflow.com/comment/45634443
has comment: http://stackoverflow.com/comment/45634281

http://stackoverflow.com/comment/45778222
has text: ok So i have placed this code here element.live('click', function (e) { ShowPopUp(ActionAppendData, this); e.stopPropagation(); }); it has stopped the bubble, but it is appending it to tr rather than the a tag
comment on: http://stackoverflow.com/a/28747873
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28599139
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/45504628
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45504666
score: -2
tagged with: css
has comment: http://stackoverflow.com/comment/45504450
has answer: http://stackoverflow.com/a/28599199
has answer: http://stackoverflow.com/a/28600182
downvote count: 2
has comment: http://stackoverflow.com/comment/45504889
has title: on click hide list style
has body: hello to all i want to hide list style when i click anywhere on body. In code by default it hide ,when i clicked on button it shows a list. But it can't hide when i click on anywhere. Can anyone please tell me how do i this ?? .dss { background: #FFF; color: #0086EE; display: none; padding: 25px; position: absolute; top: 10px; z-index: 10; -moz-box-shadow: rgba(0,0,0,0.45) 0 0 9px; -webkit-box-shadow: rgba(0,0,0,0.45) 0 0 9px; box-shadow: rgba(0,0,0,0.45) 0 0 9px; } Also see the js code:- function show() { document.getElementById("demo").style.display = "block"; } Also see the html:- a b c d
type: Question
has comment: http://stackoverflow.com/comment/45504590
tagged with: javascript
answer count: 2
upvote count: 0

http://stackoverflow.com/a/28616097
has body: You could do alot of dom manipulation, but what it seems you are trying to do is provide a new template for each item inside the directive. No reason you can't make each item a directive too. compiles to:
downvote count: 0
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/49982313
score: 1
answers question: http://stackoverflow.com/q/28613966

http://stackoverflow.com/q/28628656
has comment: http://stackoverflow.com/comment/45557952
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28628862
upvote count: 0
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/28628960
answer count: 3
has title: Compare 2 arrays and create a new one based on if exist
linked to: http://stackoverflow.com/q/1723168
has answer: http://stackoverflow.com/a/28629043
has comment: http://stackoverflow.com/comment/45557691
favorite count: 0
duplicate of: http://stackoverflow.com/q/1723168
linked to: http://stackoverflow.com/q/11076067
type: UnansweredQuestion
score: -1
has body: How can i compare this two arrays and create a new array (filtered) based on if any number in Array1 exist in Array2. Both arrays is dynamic and can have different lengths. Array1 = 3796, 3831, 3858, 3860 Array2 = 3796, 4566, 2932, 3831, 3290, 3858, 4599, 3293 etc etc.. In this case i want my output to be: Array3 = 4566, 2932, 3290, 4599, 3293

http://stackoverflow.com/q/28666672
has body: I have a bit of code where I'm trying to pass the id value of a div to a function, the function then fadeout the first div then fade in the second one. I know that the function takes in objects, because when I try to display the values given to it with $alert() I get [Object object]. When one of the button is clicked it will try to find the id of the div that is visible and then pass it to the fade function, however it finds the id and keeps it in a string, I would need to convert it into an object. Here is my code: &lt;script type="text/javascript"&gt; $(function() { $('#step1').fadeIn("slow"); $('#btn1').addClass("btn-primary active"); $('#btn1').click(function() { var id = $(".editor .steps").filter(function () { //this gets the value of the active div and saves it into id. if ($(this).css('display') == 'block') { return true; } }).attr('id'); fade(id, $('#step1')) //tyring to send id and the the step1 to the fade function }); $('#btn-step2-video').click(function() { fade($('#step1'), $('#step2-video')); $('#btn1').addClass("btn-primary"); $('#btn2').addClass("btn-primary active"); }); $('#btn-step2-picture').click(function() { fade($('#step1'), $('#step2-picture')); btn2.addClass("btn-primary active"); }); var fade = function(fadeout, fadein){ $(fadeout).fadeOut("slow"); $(fadein).fadeIn("slow"); } }); &lt;/script&gt; Here is the HTML of the page: &lt;!-- begin snippet: js hide: false --&gt; &lt;div id="steps"&gt; &lt;button id="btn1" type="button" class="btn btn-primary btn-lg btn-step"&gt;1&lt;/button&gt; &lt;a class="btn-description"&gt;Choose type of ad&lt;/a&gt; &lt;button id="btn2" type="button" class="btn btn-primary btn-lg btn-step"&gt;2&lt;/button&gt; &lt;a class="btn"&gt;Confirmation &amp;amp; Payment&lt;/a&gt; &lt;/div&gt; &lt;!-- Begining of editor --&gt; &lt;div class="editor"&gt; &lt;!-- Step 1 of the editor --&gt; &lt;div id="step1" class="steps" style="display:none;" &gt; &lt;a id="btn-step2-video" style="position:fixed; top: 45%; left: 25%; curs…
answer count: 1
has answer: http://stackoverflow.com/a/28666734
accepted answer: http://stackoverflow.com/a/28666734
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
score: 2
downvote count: 0
has title: Jquery Converting string to Object
type: AnsweredQuestion
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/45628044

http://stackoverflow.com/q/28670799
has answer: http://stackoverflow.com/a/28672515
answer count: 1
has title: How to handle click event on AmCharts Stock graph?
score: 2
accepted answer: http://stackoverflow.com/a/28672515
downvote count: 0
tagged with: javascript
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/12668482
has body: I'm trying to do it using amStockCharts v3. I've seen this question: here, but it doesn't seems to work with Stock charts. How can I handle click event for this chart - http://www.amcharts.com/demos/multiple-data-sets/? I need to be able to get date and value corresponding to a clicked point.
favorite count: 0
tagged with: amcharts
type: Question
upvote count: 2

http://stackoverflow.com/comment/45508776
has text: Unable to get key value pair in java script. The sample pdf looks like above.but the pdf may vary (both key and value). How can i get this?
comment on: http://stackoverflow.com/q/28601350
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45762467
has text: Thanks! I cannot access to ng-include html, it throws me 404. Is there another way to pass a variable to ng-include?
type: AnswerComment
comment on: http://stackoverflow.com/a/28738852
score: 0
type: Comment

http://stackoverflow.com/comment/45766004
has text: How about you explain what you want your validation to do?
score: 1
comment on: http://stackoverflow.com/q/28741363
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28686906
possible better answer: http://stackoverflow.com/a/78530779
has answer: http://stackoverflow.com/a/28692914
has answer: http://stackoverflow.com/a/78530779
has body: I am writing a test for a function that returns a promise, and am not able to run assertions on resolving or rejecting the promise. I cannot use ES6 on this project so I am using the rsvp.js library which claims to implement the Promises/A+ specification. I am using the latest qunit version 1.17.1 The function under test: var loadGroups = function(data) { return new RSVP.Promise(function(resolve, reject) { var groups = []; // ... some code to populate the groups array if(groups.length &gt; 0) { resolve(groups); } else { reject("No groups were loaded"); } }); }; The success test: test('success test', function(assert) { assert.expect(1); var promise = loadGroups(testData); promise.then(function(groups) { assert.deepEquals(groups.length, 1); }); return promise; }); This fails with "Expected 1 assertions, but 0 were run" The failure test: test('failure test', function(assert) { assert.expect(1); var promise = loadGroups([]); promise.then(null, function(message) { assert.equals(message, "No groups were loaded"); }); return promise; }); This fails with "Promise rejected during get promise when loading empty groups: No groups were loaded"
tagged with: qunit
type: AnsweredQuestion
score: 4
tagged with: rsvp-promise
tagged with: rsvp.js
type: Question
accepted answer: http://stackoverflow.com/a/28692914
upvote count: 4
has title: How to run qunit assertions on resolving a Promise
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: promise

http://stackoverflow.com/comment/45694993
comment on: http://stackoverflow.com/q/28702333
score: 0
has text: Have you checked to confirm that the function is not being called, not that it is failing? I have encountered issues similar to this where I was attempting to access the DOM through jQuery prior to jQuery or the document being ready. To resolve that, I would wrap my call to `init` with a check to see if jQuery was defined and the document was ready. Once both of those conditions are met, then I would call `init`.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28789832
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28669042
has body: Currently there is no method to destroy a heatmapjs instance, but we can do that manually. First we have to remove the canvas element from DOM and than unset or destroy the heatmapjs instance. Example: //find corresponding canvas element var canvas = heatmapInstance1._renderer.canvas; //remove the canvas from DOM $(canvas).remove(); //than unset the variable heatmapInstance1 = undefined; //or heatmapInstance1 = null;
type: Answer
score: 8
upvote count: 8
answers question: http://stackoverflow.com/q/28669042

http://stackoverflow.com/q/28701545
score: 0
has answer: http://stackoverflow.com/a/28701665
type: Question
has answer: http://stackoverflow.com/a/28701602
possible better answer: http://stackoverflow.com/a/28701627
has title: Finding the Previous Sibling Element in Javascript
has answer: http://stackoverflow.com/a/28701765
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45693152
accepted answer: http://stackoverflow.com/a/28701602
answer count: 4
type: AnsweredQuestion
has body: While writing some code I came across two ways of doing the same thing. I am looking for the most efficient way to find a previous sibling, in order to extract a string from it. My project does currently use jQuery, so both options are available to me. https://developer.mozilla.org/en-US/docs/Web/API/Node/previousSibling http://api.jquery.com/prev/ What is the better option to use and why?
has answer: http://stackoverflow.com/a/28701627

http://stackoverflow.com/a/28613062
answers question: http://stackoverflow.com/q/28612743
has comment: http://stackoverflow.com/comment/45531589
has comment: http://stackoverflow.com/comment/45531073
has comment: http://stackoverflow.com/comment/45530713
accepted answer of: http://stackoverflow.com/q/28612743
type: Answer
has body: This will fail most likley due to the same-origin-policy. It restricts JavaScript access from one protocol and domain to another. For more information about this you can check out the wiki entry To achieve cross origin communication you can use the messaging API defined here. With this api you can define an event listener on one file and a trigger in the other. Listen to messages: window.addEventListener("message", receiveMessage, false); function receiveMessage(event) { if (event.origin !== "http://example.org:8080") return; // ... } Post a message to another document: var parentWindow = window.parent; // When the popup has fully loaded, if not blocked by a popup blocker: // This does nothing, assuming the window hasn't changed its location. parentWindow.postMessage("The user is 'bob' and the password is 'secret'", "https://secure.example.net"); You can checkout the complete example in the MDN Documentation
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45531708
downvote count: 0
type: AcceptedAnswer

http://stackoverflow.com/a/28733863
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/28733762
score: 1
has body: this may not answer your question directly but I have done login modal dialog using ngDialog (https://github.com/likeastore/ngDialog) with similar functionality as the Medium site. You may want to look into ngDialog.
upvote count: 1

http://stackoverflow.com/a/28636812
has body: Your array already has default keys. So try something in the manner of: var obj = jQuery.parseJSON(data); $.each(obj, function(key,value) { console.log(value.latitude, value.longitude); });
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28636774
downvote count: 0
type: Answer

http://stackoverflow.com/a/28692824
has comment: http://stackoverflow.com/comment/45689292
upvote count: 40
type: Answer
has body: Well, this is about the promise resolution source. Q and a bunch of other libraries offer two APIs: The legacy defer API - in which you create a deferred that you can .resolve(value) and it has a promise you can return. The promise constructor - which is the modern API in which you create the promise from a completion source. Roughly doing: var d = Q.defer(); setTimeout(function(){ d.resolve(); }, 1000); return d.promise; Is the same as: return new Promise(function(resolve, reject){ setTimeout(resolve, 1000); }); so you might be asking Why do we need two APIs? Well, the defer API came first. It's how some other languages deal with it, it's how the papers deal with it and it's how people used it first - however - there is an important difference between the two APIs. The promise constructor is throw safe. Throw safety Promises abstract exception handling and are throw safe. If you throw inside a promise chain it will convert that exception into a rejection, quoting the spec: If either onFulfilled or onRejected throws an exception e, promise2 must be rejected with e as the reason Let's assume you're parsing JSON from an XHR request: function get(){ var d = Q.defer(); if(cached) { // use cached version user edited in localStorage d.resolve(JSON.parse(cached)); } else { // get from server myCallbackApi('/foo', function(res){ d.resolve(res); }); } } Now, let's look at the promise constructor version: function get(){ return new Promise(function(resolve, reject){ if(cached) { // use cached version user edited in localStorage resolve(JSON.parse(cached)); } else { // get from server myCallbackApi('/foo', resolve); } }); } Now, assume somehow your server sent you invalid JSON (or the user edited it to an invalid state) and you cached it. In the defer version - it throws synchronously. So you have to generally guard against it. In the bottom version it does not. The top version usage would look like: try{ return get().catch(function(e){ return handleException(e); // can also j…
has comment: http://stackoverflow.com/comment/45689197
downvote count: 0
has comment: http://stackoverflow.com/comment/45689064
score: 40
accepted answer of: http://stackoverflow.com/q/28687566
has comment: http://stackoverflow.com/comment/45689227
has comment: http://stackoverflow.com/comment/67140862
answers question: http://stackoverflow.com/q/28687566
type: AcceptedAnswer

http://stackoverflow.com/comment/47224675
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28694230
has text: Did you find a solution to this? In your link, it shows the data bars changing when you click each region. Was this what you wanted to achieve with the click event?
score: 0

http://stackoverflow.com/comment/45576444
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/28638273
has text: @JCOC611 While what you say is true, the browser can factor in these decimals if you zoom the screen. And in fact, chrome at least does take this into consideration. bryan's example fiddle is the same width at 100% zoom but becomes 1 pixel different when zoomed in.
type: Comment

http://stackoverflow.com/a/28728123
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28728018
type: Answer
answers question: http://stackoverflow.com/q/28728018
score: 0
has body: Unfortunately you cannot style an alert box, there are alternative projects out there however, SweetAlerts being my personal favourite, that make alert boxes look good

http://stackoverflow.com/q/28593925
score: 0
type: Question
has comment: http://stackoverflow.com/comment/45495225
has comment: http://stackoverflow.com/comment/45494459
tagged with: javascript
has comment: http://stackoverflow.com/comment/45494579
has comment: http://stackoverflow.com/comment/45494526
has body: I want to change the URL of image attribute. Below is my RSS feed doc.I just want to replace the path of image URL attribute with other. <?xml version="1.0" ?> Debug https://images/image This forum is focused on the Test service. You can post questions, answers, bugs or ideas for improvement. en-US ActiveForums 5.0 Copyright [year] by GLOBO Plc. Fri, 24 Oct 2014 03:44:18 GMT http://images/image1 GO!AppZone GO!AppZone Debug https://Community/Developer-Forum/aff/5/afv/topicsview lalalala oioioioiooi https://Community/Developer-Forum/aff/5/aft/12/afv/topic <dc:creator>ant lia</dc:creator> Fri, 24 Oct 2014 03:44:18 GMT https://Community/Developer-Forum/aff/5/aft/12/afv/topic <slash:comments>1</slash:comments> </rss> Is there any why to replace URL path using javascript or jQuery. Please help to resolve this. Thanks.
has comment: http://stackoverflow.com/comment/53620521
tagged with: http://stackoverflow.com/tag/xml
tagged with: rss
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/17998446
has title: How to edit Image URL from RSS feed using javascript
has comment: http://stackoverflow.com/comment/45495162
answer count: 0

http://stackoverflow.com/comment/45734259
type: Comment
type: QuestionComment
has text: Pls help @RoryMcCrossan
score: 0
comment on: http://stackoverflow.com/q/28719797

http://stackoverflow.com/a/28733077
has comment: http://stackoverflow.com/comment/45751966
score: 2
answers question: http://stackoverflow.com/q/28732641
upvote count: 2
has body: For your first question: The problem is you need to use ko.observable for each array item. For example: jsfiddle function CVViewModel(data) { var self = this; //list view model self.title = ko.observable(data.title); self.companies = ko.observableArray(data.companies.map(Company)); } function Company(data) { if (!(this instanceof Company)){ return new Company(data); } this.companyName = ko.observable(data.companyName || ''); this.jobTitle = ko.observable(data.jobTitle || ''); this.description = ko.observable(data.description || ''); this.startDate = ko.observable(new Date(data.startDate) || ''); this.endDate = ko.observable(new Date(data.endDate) || ''); } Now when you bind the company observables to the UI each array element on the viewmodel will stay synced. Regarding your second question I recommend using an ORM like breeze.js which does the change tracking for you. Breeze.js has a tutorial that uses knockout.js.
has comment: http://stackoverflow.com/comment/45752667
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28732641

http://stackoverflow.com/comment/45823425
type: QuestionComment
comment on: http://stackoverflow.com/q/28749258
score: 0
has text: solved by members below :D
type: Comment

http://stackoverflow.com/a/38800457
downvote count: 0
has comment: http://stackoverflow.com/comment/65081013
answers question: http://stackoverflow.com/q/28595437
upvote count: 2
has body: This is an old question, but I believe still relevant, so I'm going to throw in my 2 cents. Ideally, you want to separate out any ajax calls into an actions file instead of doing it right inside a component. Without going into using something like Redux to help you manage your state (which, at this point in time, I would recommend redux + react-redux), you could use something called "container components" to do all of the heavy state lifting for you and then use props in the component that's doing the main layout. Here's an example: // childComponent.js import React from 'react'; import axios from 'axios'; // ajax stuff similar to jquery but with promises const ChildComponent = React.createClass({ render: function() { &lt;ul className="posts"&gt; {this.props.posts.map(function(post){ return ( &lt;li&gt; &lt;h3&gt;{post.title}&lt;/h3&gt; &lt;p&gt;{post.content}&lt;/p&gt; &lt;/li&gt; ) })} &lt;/ul&gt; } }) const ChildComponentContainer = React.createClass({ getInitialState: function() { return { posts: [] } }, componentWillMount: function() { axios.get(this.props.url, function(resp) { this.setState({ posts: resp.data }); }.bind(this)); }, render: function() { return ( &lt;ChildComponent posts={this.state.posts} /&gt; ) } }) export default ChildComponentContainer;
type: Answer
score: 2

http://stackoverflow.com/comment/45715366
type: Comment
type: QuestionComment
has text: If I had to ask you, you better add this precision in your post in order to let us know how to quickly solve your issue.
comment on: http://stackoverflow.com/q/28713510
score: 0

http://stackoverflow.com/q/28642570
has answer: http://stackoverflow.com/a/28642904
accepted answer: http://stackoverflow.com/a/28642648
type: Question
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45585047
has body: Start my problem is... recharge() contains a setInterval() that contains a function printA() this function that does is print whit a document.write a variable that sum one every time that recharge is called.. but just print 1 and doesnt print the next number. I tried whit a alert instead of document.write and its work so I don't know what i am doing wrong. i am a noob. Thanks for your help.
answer count: 2
upvote count: 0
tagged with: setinterval
favorite count: 0
has title: Inappropriate use of setInterval
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28642648
possible better answer: http://stackoverflow.com/a/28642904
downvote count: 1

http://stackoverflow.com/comment/45650382
has text: So what happens when you do `location.reload` in a test? ....why aren't you doing a `driver.navigate.refresh` (or it's equivalent in your language)?....
comment on: http://stackoverflow.com/a/28673410
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28725445
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has answer: http://stackoverflow.com/a/28725917
linked to: http://stackoverflow.com/q/14220321
type: UnansweredQuestion
has body: I have a form for user to register new account. I use jquery + ajax to check availability of email address on blur. In Jquery code I used e.preventDefault(); to prevent form submission if there is any error occurs. I tried the existed email address in the email input and click submit the form. It allows form to submit. It should not do this because ajax reponseText return false. Please anyone tell me what should I fix this code to work? I also read similiar article, i tried but still does not work. Please help me to point out what i need to fix my current code? Here is my form: Full Name Email Address Password Register Here my jquery code: $(document).ready(function(){ $('#regname').focus(); $('#regemail').blur(emailCheck); $('#signupForm').submit(function(e) { var regname = $('#regname'); var regemail = $('#regemail'); var regpass = $('#regpass'); var register_result = $('#register_result'); register_result.html('Loading..'); if(regname.val() == ''){ regname.focus(); register_result.html(' * Full name can not be blank'); e.preventDefault(); } else if ($.trim(regemail.val()).length == 0) { regemail.focus(); register_result.html('* Email address can not be blank'); e.preventDefault(); } else if (emailCheck()==false) { regemail.focus(); register_result.html(' This email address is already existed. Please choose another one '); e.preventDefault(); } else if(regpass.val() == ''){ regpass.focus(); register_result.html('* Password can not be blank'); e.preventDefault(); } }); }); function emailCheck() { var regemail = $('#regemail'); var emailcheck = $('#emailcheck'); emailcheck.html(''); var UrlToPass = {regemail:regemail.val()} ; $.ajax({ type : 'POST', cache: false, data : UrlToPass, url : 'emailcheck.php', success: function(responseText){ if(responseText == 0){ return true; } else{ emailcheck.html(' This email is existed.'); return false; } } }); }
has title: Can not return ajax responseText from a function in jquery
type: Question
answer count: 1

http://stackoverflow.com/comment/45621829
type: Comment
has text: Side: yes, that's the only difference.
comment on: http://stackoverflow.com/a/28663030
type: AnswerComment
score: 1

http://stackoverflow.com/comment/45608370
type: AnswerComment
has text: @RobG Yes, of course. The key point is what I included in bold. Without `with`, many variable references can be performed statically since everything is lexically scoped. Using `with` effectively introduces dynamic scope for *all* possible variable references, which throws all that potential optimization away.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28652781

http://stackoverflow.com/comment/45712718
score: 0
comment on: http://stackoverflow.com/q/28711947
has text: i've added info to question
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28711381
answer count: 2
downvote count: 2
linked to: http://stackoverflow.com/q/7929428
has body: I'm trying to convert a total amount of seconds into time elapsed using jQuery and struggling. I have as an example : {"expires": "254254"} response from an external source, I want to convert this into 2days Xhours Xminutes left, I have tried using something like this : function timeDifference(elapsed) { var msPerMinute = 60 * 1000; var msPerHour = msPerMinute * 60; var msPerDay = msPerHour * 24; var msPerMonth = msPerDay * 30; var msPerYear = msPerDay * 365; if (elapsed &lt; msPerMinute) { return Math.round(elapsed/1000) + ' seconds ago'; } else if (elapsed &lt; msPerHour) { return Math.round(elapsed/msPerMinute) + ' minutes ago'; } else if (elapsed &lt; msPerDay ) { return Math.round(elapsed/msPerHour ) + ' hours ago'; } else if (elapsed &lt; msPerMonth) { return 'approximately ' + Math.round(elapsed/msPerDay) + ' days ago'; } else if (elapsed &lt; msPerYear) { return 'approximately ' + Math.round(elapsed/msPerMonth) + ' months ago'; } else { return 'approximately ' + Math.round(elapsed/msPerYear ) + ' years ago'; } }
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28711860
has title: Seconds into time elapsed in JS
has answer: http://stackoverflow.com/a/28711860
has comment: http://stackoverflow.com/comment/45711867
type: AnsweredQuestion
upvote count: 0
favorite count: 0
type: Question
tagged with: time
has answer: http://stackoverflow.com/a/28711468
score: -2
accepted answer: http://stackoverflow.com/a/28711468

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

http://stackoverflow.com/comment/45607175
comment on: http://stackoverflow.com/a/28654842
score: 0
type: Comment
has text: I said, Their are just two inputs one with name='multiple[] and other with name='multiple[]Phone.. So why are you using $.each?
type: AnswerComment

http://stackoverflow.com/a/28604385
answers question: http://stackoverflow.com/q/28603940
score: 0
type: Answer
has body: use done method function Loading(callback) { jQuery("#loading").fadeToggle(500).done(callback); }
has comment: http://stackoverflow.com/comment/45513854

http://stackoverflow.com/comment/45558364
comment on: http://stackoverflow.com/q/28625069
type: Comment
type: QuestionComment
score: 0
has text: Could you open **local static** HTML page on the computer? You can save all required JavaScripts in the same directory with HTML and to modify the HTML page so that it use *relative pathes* like ` ` instead of ` `. You should understand that nobody can solve the problem for you because nobody knows what is wrong on the computer.

http://stackoverflow.com/a/28721837
upvote count: 2
has comment: http://stackoverflow.com/comment/45748547
type: Answer
answers question: http://stackoverflow.com/q/28721655
score: 2
accepted answer of: http://stackoverflow.com/q/28721655
has comment: http://stackoverflow.com/comment/45753105
has body: Option 1 would be a better approach.DOM operations are generally very slow. In first option you are creating a string and then finally appending once. On the other hand in Option 2, you are doing DOM operation for each row, which makes it inefficient. I believe option 1 is better.
has comment: http://stackoverflow.com/comment/45736682
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45736948

http://stackoverflow.com/comment/45756160
comment on: http://stackoverflow.com/a/28735794
has text: I added that. Still not difference. Anything else?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28744370
downvote count: 0
score: 1
has body: Use other values and it becomes much clearer. It's working as intended. function* second() { var a = yield "HELLO"; console.log("a = ", a); var b = yield a+ 1; console.log("b = ", b); return b } var f= second(); console.log('1:',f.next()); console.log('2:',f.next(5)); console.log('3:',f.next(7)); outputs ///1st next() //yeld returns iterator {value: "HELLO", done: false} //2nd next(5) //the console log gets executed with var a = 5 a = 5 //yeld returns iterator {value: 6, done: false} //3rd next(7) //the console log gets executed with var b = 7 b = 7 //it doesn't use the 'a' var at all, neither does it add +1 to the yeld allocation //yeld returns iterator {value: 7, done: true}
type: Answer
answers question: http://stackoverflow.com/q/28743794
upvote count: 1

http://stackoverflow.com/q/28616055
has answer: http://stackoverflow.com/a/28616372
type: UnansweredQuestion
tagged with: handlebars.js
has title: How to loop over array objects and template with Handlebars
has body: I'm having trouble templating out some object data using Handlebars, objects look like this: [{ slug: "slug-q", videoBanner: true, videoId: "e_pBdaN5nEY", videoPoster: { "small": "630x630_partner.jpg", "medium": "853x863_partner.jpg", "large": "1306x653_partner.jpg", "xlarge": "1832x704_partner.jpg" } }, { slug: "slug-w", videoBanner: true, videoId: "e_fewf5nEY", videoPoster: { "small": "630x630_partnerY.jpg", "medium": "853x863_partnerY.jpg", "large": "1306x653_partnerY.jpg", "xlarge": "1832x704_partnerY.jpg" } }] And my template: &lt;a href="http://youtu.be/{{videoId}}" class="hero-content js-vid" target="_blank"&gt; {{#if videoBanner}} &lt;img class="hero-img preload-image js-preload-image js-poster" alt="" sizes="100%" srcset=" /static/img/partners/{{slug}}/{{videoPoster.small}} 320w, /static/img/partners/{{slug}}/{{videoPoster.medium}} 640w, /static/img/partners/{{slug}}/{{videoPoster.large}} 1024w, /static/img/partners/{{slug}}/{{videoPoster.xlarge}} 1280w"&gt; {{else}} &lt;img class="hero-img preload-image js-preload-image" alt="" sizes="100%" srcset=" /static/img/partners/{{slug}}/{{videoPoster.small}} 320w, /static/img/partners/{{slug}}/{{videoPoster.medium}} 640w"&gt; {{/if}} &lt;/a&gt; Right now the only thing that gets set is the videoId, I'm not sure where I need to add {{#each}} in order to loop through the data out and template. I initially tried adding {{#each this}} around the whole template block but this was incorrect.
has comment: http://stackoverflow.com/comment/45535143
has answer: http://stackoverflow.com/a/28616429
type: Question
linked to: http://stackoverflow.com/q/22696886
tagged with: javascript
score: 0
answer count: 2

http://stackoverflow.com/comment/45685111
comment on: http://stackoverflow.com/q/28696838
has text: Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/extjs/app/view/OpenQuoteComp.js?_dc=1424789231232
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45825442
comment on: http://stackoverflow.com/q/28747565
has text: You are correct that the model method of the AlertsRoute was not being called. However, upon adding the init method you suggested, I discovered that while the init method is called before the remaining method is called, self.set('model', model); is not called until after the remaining method has already been called, causing it to still return 0;
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28662742
answers question: http://stackoverflow.com/q/28662421
type: Answer
has comment: http://stackoverflow.com/comment/45623162
downvote count: 0
score: 1
has body: The following code using require as SYNC request but in browsers it is possible to use SYNC request if dependencies are defined in the same file or was loaded before calling require. Most of the time is useful javascript minimizer is used. define('foo', ['dep1', 'dep2'], function(){ return foo; }); define('bar', ['dep1', 'dep2'], function(){ return bar; }); define( ['require', 'jquery', 'underscore'], function (require, $, _) { var foo = require('foo'); var bar = require('bar'); return new FooBar(foo, bar); } ); Other solution is using Promises to promise you will return new object: define( ['require', 'jquery', 'underscore'], function (require, $, _) { var promise = new Promise(function(fulfill, reject){ require(['foo', 'bar'], function(foo, bar) { fulfill(new FooBar(foo, bar)); }); }); return promise; } );
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28662421

http://stackoverflow.com/q/28625567
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45552744
has title: http request every 500ms until request complete Angular
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28626033
type: UnansweredQuestion
has body: I am seeking to request the server with constant requests every 500ms. I want to request at first and IF the request is not complete after 500ms , I want to make the same request again. Then wait again 500ms and check if it is incomplete. I want to repeat this process until the request is complete. Right now, my request looks like this: $http({ method: method, url:baseUrl, headers: { 'Content-Type' : 'application/json; charset=utf-8', 'Data-Type': 'json' }, data: resultService.sendData(true), cache:false }) .success(function(data,status,headers,config){ // accepts more parameters $timeout(function(){ resultService.activeSearch=false; $timeout(function(){ request= $filter('orderBy')(data,['price','id']); },0); },1000); }) .error(function(){ resultService.activeSearch=false; function(){ request={error:1}; }; }); }; I thought about using something like this (function tick(){ $http({ method: method, url:baseUrl, headers: { 'Content-Type' : 'application/json; charset=utf-8', 'Data-Type': 'json' }, data: resultService.sendData(true), cache:false }) .success(function(data,status,headers,config){ // accepts more parameters request=data; $timeout(tick,500); $timeout( function(){resultService.activeSearch=false; },1000); }) .error(function(){ $timeout(tick,500); resultService.activeSearch=false; function(){ request={error:1}; }; }); })(); This does not work as intended. Where am I wrong?
upvote count: 1
tagged with: http
type: Question
tagged with: settimeout
has comment: http://stackoverflow.com/comment/45557056
score: 1
has comment: http://stackoverflow.com/comment/45552558

http://stackoverflow.com/q/28653641
tagged with: javascript
has comment: http://stackoverflow.com/comment/45621997
favorite count: 0
tagged with: firefox-addon
possible better answer: http://stackoverflow.com/a/28781254
has title: Converting HashString from C to JS
accepted answer: http://stackoverflow.com/a/28658351
has comment: http://stackoverflow.com/comment/45605574
tagged with: c++
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45604384
upvote count: 2
has comment: http://stackoverflow.com/comment/45604560
has comment: http://stackoverflow.com/comment/45604457
type: Question
has body: I'm trying to convert this function from the Mozilla Firefox code base, it's called HashString. It calls a bunch of functions which are all in this file: https://dxr.mozilla.org/mozilla-central/source/mfbt/HashFunctions.h#294 So these are the C functions it calls: static const uint32_t kGoldenRatioU32 = 0x9E3779B9U; MOZ_WARN_UNUSED_RESULT inline uint32_t HashString(const wchar_t* aStr) { return detail::HashUntilZero(aStr); } template&lt;typename T&gt; uint32_t HashUntilZero(const T* aStr) { uint32_t hash = 0; for (T c; (c = *aStr); aStr++) { hash = AddToHash(hash, c); } return hash; } MOZ_WARN_UNUSED_RESULT inline uint32_t AddToHash(uint32_t aHash, A* aA) { /* * You might think this function should just take a void*. But then we'd only * catch data pointers and couldn't handle function pointers. */ static_assert(sizeof(aA) == sizeof(uintptr_t), "Strange pointer!"); return detail::AddUintptrToHash&lt;sizeof(uintptr_t)&gt;(aHash, uintptr_t(aA)); } inline uint32_t AddUintptrToHash&lt;8&gt;(uint32_t aHash, uintptr_t aValue) { /* * The static cast to uint64_t below is necessary because this function * sometimes gets compiled on 32-bit platforms (yes, even though it's a * template and we never call this particular override in a 32-bit build). If * we do aValue &gt;&gt; 32 on a 32-bit machine, we're shifting a 32-bit uintptr_t * right 32 bits, and the compiler throws an error. */ uint32_t v1 = static_cast&lt;uint32_t&gt;(aValue); uint32_t v2 = static_cast&lt;uint32_t&gt;(static_cast&lt;uint64_t&gt;(aValue) &gt;&gt; 32); return AddU32ToHash(AddU32ToHash(aHash, v1), v2); } inline uint32_t AddU32ToHash(uint32_t aHash, uint32_t aValue) { return kGoldenRatioU32 * (RotateBitsLeft32(aHash, 5) ^ aValue); } inline uint32_t RotateBitsLeft32(uint32_t aValue, uint8_t aBits) { MOZ_ASSERT(aBits &lt; 32); return (aValue &lt;&lt; aBits) | (aValue &gt;&gt; (32 - aBits)); } And here is my js code: function HashString(aStr, aLength) { // moz win32 hash function if (aLength) { console.error('…
tagged with: http://stackoverflow.com/tag/c
has comment: http://stackoverflow.com/comment/45617204
has comment: http://stackoverflow.com/comment/45605243
has answer: http://stackoverflow.com/a/28658351
has comment: http://stackoverflow.com/comment/45604370
answer count: 2
has answer: http://stackoverflow.com/a/28781254
downvote count: 0

http://stackoverflow.com/comment/45511575
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28603059
has text: It sounds like your real problem is that the original URL contains `+` characters that should be encoded to `%2B`. You need to address that.
score: 1

http://stackoverflow.com/q/28608409
has title: Telerik RadGrid set specific cell readonly based on CheckBox State
tagged with: javascript
downvote count: 0
favorite count: 0
has body: I'm using a RadGrid to show several columns referring ID, Name, etc. One column contains a value to change, another one is a column containing a checkbox (in a GridTemplateColumn). Now I want to disable the value cell(!) based on the state of the checkbox (i.e. checkbox checked = cell disabled). Two ways have to be considered: - First load of the Grid, all value cells have to be disabled in which the checkbox is already ticked - on changing the checkbox, the cell has to be enabled/disabled. Sadly, I wasn't able to achieve this behaviour at all, neither with javascript nor with C#. Any help would be very appreciated!
type: UnansweredQuestion
tagged with: telerik
tagged with: checkbox
tagged with: radgrid
answer count: 0
score: 1
upvote count: 1
type: Question
tagged with: c#

http://stackoverflow.com/q/28621150
has comment: http://stackoverflow.com/comment/45544581
possible better answer: http://stackoverflow.com/a/28621555
has answer: http://stackoverflow.com/a/28621305
accepted answer: http://stackoverflow.com/a/28621305
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45544574
has comment: http://stackoverflow.com/comment/45544621
score: 0
has answer: http://stackoverflow.com/a/28621555
answer count: 2
has comment: http://stackoverflow.com/comment/45544724
has body: Posted a question on about the same project in the morning. After battling it for a while came up with a bit different approach. Trying to build a filter. And the idea is that a filter checkboxes have matching id's with filtered items classes. So, once a filter item clicked, filtration is applied to item class. Classes (except for inditem) and ids are dynamic simplified html of it whatever label whatever label whatever label js $(".lifilter").each(function() { var filter1 = $(this).find('.filtercheck').attr('id'); if ( $(this).find('.filtercheck').attr('checked') ) { $(this).find('.filtercheck').click(function(){ $('.' + filter1).removeClass('checkeditem').hide(); }); } else { $(this).find('.filtercheck').click(function(){ $('.inditem').hide(); $('.' + filter1).addClass('checkeditem'); }); } }); and this one marked as important not to be hidden when extra items are added into filtration .checkeditem {display:block !important} Initial filtration works fine. But when I click on checked item the associated div does not hide.
has title: if checkbox is checked remove class from div on click
has comment: http://stackoverflow.com/comment/45544832
type: AnsweredQuestion

http://stackoverflow.com/a/28750467
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28734674
score: 8
has body: You have made several incorrect assumptions about JavaScript. The primary issue being that rl.question(...) shows the prompt to the user, but it can do nothing to block the JS thread itself, so your readline() function will immediately exit with undefined because function(answer) has not run yet because the user has not typed anything yet. A simple way to structure your code would be: var readline = require('readline'); var rl = readline.createInterface({ input: process.stdin, output: process.stdout }); rl.write("Type 'help' for commands\n"); rl.write("Square numbers:\n"); function createPayer(number, callback){ rl.question("Enter player " + number + " name? ", function(answer) { var player = new Player(answer); // Call the callback function once the player is created. callback(player); }); } createPayer(1, function(player1){ createPayer(2, function(player2){ console.log("logging name after making players" + player1.name); console.log("logging name after making players" + player2.name); // Then call player logic you have from in here. }); }); The key being that there is no explicit 'wait' anywhere in here. JS code is primarily event and callback based, so instead of waiting for the user to type something, you queue up a function to be called once they have entered something.
upvote count: 8
accepted answer of: http://stackoverflow.com/q/28734674
type: Answer
has comment: http://stackoverflow.com/comment/45853367

http://stackoverflow.com/comment/45509568
score: 0
type: AnswerComment
type: Comment
has text: What if the only wrapper for the text is `body` tag and there other stuffs like image, while I only want to select text?
comment on: http://stackoverflow.com/a/28600394

arrays
tags question: http://stackoverflow.com/q/28709580
tags question: http://stackoverflow.com/q/28719795
tags question: http://stackoverflow.com/q/28646622
tags question: http://stackoverflow.com/q/28650136
tags question: http://stackoverflow.com/q/28619543
tags question: http://stackoverflow.com/q/28662153
tags question: http://stackoverflow.com/q/28595743
tags question: http://stackoverflow.com/q/28708919
tags question: http://stackoverflow.com/q/28692154
type: Tag
tags question: http://stackoverflow.com/q/28695264
tags question: http://stackoverflow.com/q/28727562
tags question: http://stackoverflow.com/q/28749937
tags question: http://stackoverflow.com/q/28692038
tags question: http://stackoverflow.com/q/28673365
tags question: http://stackoverflow.com/q/28658522
tags question: http://stackoverflow.com/q/28727329
tags question: http://stackoverflow.com/q/28737792
tags question: http://stackoverflow.com/q/28639399
tags question: http://stackoverflow.com/q/28706471
tags question: http://stackoverflow.com/q/28603377
tags question: http://stackoverflow.com/q/28636197
tags question: http://stackoverflow.com/q/28610663
tags question: http://stackoverflow.com/q/28747576
tags question: http://stackoverflow.com/q/28708216
tags question: http://stackoverflow.com/q/28673656
tags question: http://stackoverflow.com/q/28653495
tags question: http://stackoverflow.com/q/28605645
tags question: http://stackoverflow.com/q/28713592
tags question: http://stackoverflow.com/q/28749800
tags question: http://stackoverflow.com/q/28627632
tags question: http://stackoverflow.com/q/28721937
tags question: http://stackoverflow.com/q/28630480
tags question: http://stackoverflow.com/q/28630341
tags question: http://stackoverflow.com/q/28687665
tags question: http://stackoverflow.com/q/28599961
tags question: http://stackoverflow.com/q/28730827
tags question: http://stackoverflow.com/q/28631667
tags question: http://stackoverflow.com/q/28657686
tags question: http://stackoverflow.com/q/28677577
tags question: http://stackoverflow.com/q/28604744
tags question: http://stackoverflow.com/q/28736922
tags question: http://stackoverflow.com/q/28629055
tags question: http://stackoverflow.com/q/28714655
tags question: http://stackoverflow.com/q/28704509
tags question: http://stackoverflow.com/q/28681214
tags question: http://stackoverflow.com/q/28651878
tags question: http://stackoverflow.com/q/28672505
tags question: http://stackoverflow.com/q/28598729
tags question: http://stackoverflow.com/q/28650783
tags question: http://stackoverflow.com/q/28662854
tags question: http://stackoverflow.com/q/28693338
tags question: http://stackoverflow.com/q/28654782
tags question: http://stackoverflow.com/q/28629364
tags question: http://stackoverflow.com/q/28677722
tags question: http://stackoverflow.com/q/28672178
tags question: http://stackoverflow.com/q/28680517
tags question: http://stackoverflow.com/q/28644497
tags question: http://stackoverflow.com/q/28684653
tags question: http://stackoverflow.com/q/28677253
tags question: http://stackoverflow.com/q/28619675
tags question: http://stackoverflow.com/q/28604132
tags question: http://stackoverflow.com/q/28668352
tags question: http://stackoverflow.com/q/28603799
tags question: http://stackoverflow.com/q/28724648
tags question: http://stackoverflow.com/q/28650208
tags question: http://stackoverflow.com/q/28615179
tags question: http://stackoverflow.com/q/28635733
tags question: http://stackoverflow.com/q/28723353
tags question: http://stackoverflow.com/q/28670060
tags question: http://stackoverflow.com/q/28638669
tags question: http://stackoverflow.com/q/28712381
tags question: http://stackoverflow.com/q/28722875
tags question: http://stackoverflow.com/q/28717131
tags question: http://stackoverflow.com/q/28615525
tags question: http://stackoverflow.com/q/28738832
tags question: http://stackoverflow.com/q/28742264
tags question: http://stackoverflow.com/q/28623637
tags question: http://stackoverflow.com/q/28700377
tags question: http://stackoverflow.com/q/28659495

http://stackoverflow.com/q/28698644
score: 0
has title: Backbone JS cascading callbacks and best practise
has comment: http://stackoverflow.com/comment/45692121
tagged with: backbone.js
tagged with: parse-platform
type: UnansweredQuestion
has body: I am loving Backbone. My app is growing pretty well but I am faced with the following challenge : the stack of callbacks is getting higher and higher. I end up calling a function, passing it a few arguments and a callback, which is then passed as the last argument to another function, which then does the same with another function, etc. I feel this is wrong, as maintaining code for new comers become harder and harder, and it shadows arguments of the callback sometimes 3 to 4 calls down the road, but I can't find any best practise on this. Is there any guideline regarding passing callbacks as function argument, and callbacks nesting in JS / Backbone? Any piece of advice would be much appreciated!
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/45691669
tagged with: javascript
tagged with: jquery
tagged with: callback

http://stackoverflow.com/q/28715650
has body: i was trying to get the differences from two dates.. i was using html is-Date textbox &lt;input type="text" name="datein" id="datein" value="" class="inputtexbox datepicker" style="display: none" is-Date/&gt; &lt;input type="text" name="dateto" id="dateto" value="" class="inputtexbox datepicker" style="display: none" is-Date/&gt; &lt;script&gt; alert(document.getElementById("datein").value); alert(document.getElementById("dateto").value); &lt;/script&gt; i was trying to get those values to a java script to compare them. but the alert was empty
favorite count: 0
has answer: http://stackoverflow.com/a/28715767
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: -1
has comment: http://stackoverflow.com/comment/45719086
downvote count: 1
type: Question
has title: how to get selected date from html textbox is-Date
upvote count: 0
has comment: http://stackoverflow.com/comment/45718995
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/91581595
score: 0
has text: it's actually a 403 just showing as 404 looks at the address you are directed to but use google "php WebSocket server example" and you will find plenty
type: Comment
comment on: http://stackoverflow.com/a/34019487
type: AnswerComment

http://stackoverflow.com/comment/45598766
has text: I tried this : window.LikeCon = React.createClass.. and then {window.LikeCon} in the other jsx file but it complains about windows not define?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28650447

http://stackoverflow.com/comment/45574164
type: AnswerComment
has text: thank you, i updated my question. i would need access to all the values after the sort
score: 0
comment on: http://stackoverflow.com/a/28635565
type: Comment

http://stackoverflow.com/a/28709596
has body: I'm guessing the angular developers have chosen to run toString() on whatever you try to pass to ng-model (at least for input type=text). This makes sense, as it has to be put in a textbox, and it has to be editable by the user. Whatever you put into a input type=text should be a string anyway :) Running a function would in that case don't make much sense. While in the HTML template, you need to ouput a value, or object that it will bind to. {{firstName()}} will do the trick.
upvote count: 1
answers question: http://stackoverflow.com/q/28709476
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/q/28635350
has answer: http://stackoverflow.com/a/28636185
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28636003
favorite count: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/28636003
accepted answer: http://stackoverflow.com/a/28636386
tagged with: meteor
upvote count: 3
has body: I have an application where users can upload certain digital goods. Other users can purchase these, in which case a download link is presented right after, along with an email containing same link is sent. This link should expire after 7 days Right now, when users upload their item, it is uploaded to S3 and the URL is stored on the Items collection. Problem is, I don't want to give customers this direct link, as then I would have no way of expiring it. Instead, I want to create a new url that refers to the original S3 url when a purchase is made, and then send the customer this link instead I figured I could make some sort of url shortener functionality that does this, but not sure if this is the most effective Any idea how to accomplish this without leaking the original?
type: Question
type: AnsweredQuestion
score: 3
has title: make url link to other url
has answer: http://stackoverflow.com/a/28636386
linked to: http://stackoverflow.com/q/16329130

http://stackoverflow.com/q/28710127
has body: Login with Facebook I have this code. I'm using Facebook Login plug-in. The problem I got is that if I put data-ng-click straight on the fb-login-button click event is not triggered (probably because overriden by default Facebook's click event). So I put it in the parent. But this way I have to click outside from the button to trigger it. I was wondering: is there a way to forse "backpropagation" of click event from child (fb-login-button) to parent (fb-button-container)? Thanks in advance
type: AnsweredQuestion
tagged with: javascript
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45709181
type: Question
accepted answer: http://stackoverflow.com/a/28710223
tagged with: facebook
has comment: http://stackoverflow.com/comment/45709347
has title: Javascript/AngularJS: How do I make click event trigger parent?
possible better answer: http://stackoverflow.com/a/28712740
has answer: http://stackoverflow.com/a/28712740
has answer: http://stackoverflow.com/a/28710223
score: 0
answer count: 2

http://stackoverflow.com/a/28722613
accepted answer of: http://stackoverflow.com/q/28716591
upvote count: 1
type: AcceptedAnswer
has body: You need to set an innerHTML using executeScript(): var elm = element(by.xpath('(/html/body/div[2]/div/div/div[2]/form/fieldset[2]/div[2]/div/div/div[2]/div[2]/div/div/div/div[3]/div)')); browser.executeScript("arguments[0].innerHTML = '11';", elm.getWebElement()); Also, think about changing the xpath you are using - this one (an absolute one starting from the html root element) is very fragile.
answers question: http://stackoverflow.com/q/28716591
has comment: http://stackoverflow.com/comment/45732332
has comment: http://stackoverflow.com/comment/45733735
type: Answer
has comment: http://stackoverflow.com/comment/45733202
downvote count: 0
has comment: http://stackoverflow.com/comment/45732608
has comment: http://stackoverflow.com/comment/45732400
has comment: http://stackoverflow.com/comment/45733020
score: 1
has comment: http://stackoverflow.com/comment/45734074
has comment: http://stackoverflow.com/comment/45732210
has comment: http://stackoverflow.com/comment/45733632

http://stackoverflow.com/a/28644839
answers question: http://stackoverflow.com/q/28644730
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45587717
type: Answer
has body: This is because a varialbe does not have a lexical scope by default. If it was declared as var $elem instead, it would be reset to undefined each time the function is run. See the variable statement developer page for more information.
score: 1

http://stackoverflow.com/q/28657598
favorite count: 0
has comment: http://stackoverflow.com/comment/45611259
has comment: http://stackoverflow.com/comment/45611283
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45611309
has comment: http://stackoverflow.com/comment/45611286
type: UnansweredQuestion
tagged with: iframe
downvote count: 2
upvote count: 1
type: Question
has title: How to get the line number from Iframe using jquery in html
has answer: http://stackoverflow.com/a/28663007
has comment: http://stackoverflow.com/comment/45612163
has comment: http://stackoverflow.com/comment/45611341
has body: In my page have one textarea. The user is able to type a document in that textarea. I used WYSIWYG text editor to formate the text, so the textarea is changed to an iframe on runtime. So I cannot the get the value from the iframe, but I need the cursor line number and user high lighted text. When user highlight the text the image has shown on end of the textarea. I get it from text area [textarea link] but how can get the same from iframe
score: -1
linked to: http://stackoverflow.com/q/28655007
has comment: http://stackoverflow.com/comment/45612152
has comment: http://stackoverflow.com/comment/45612282
linked to: http://stackoverflow.com/q/4767848
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/136844833
has text: why not just split the filter before calling `querySelectorAll` and call the `querySelectorAll` using a loop for each "selector piece"?
type: Comment
comment on: http://stackoverflow.com/a/28648156
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45607945
type: Comment
has text: In `JSON.parse()` first argument must be `text` corresponding to JSON as string.
comment on: http://stackoverflow.com/a/28655655
type: AnswerComment
score: 0

http://stackoverflow.com/a/28731013
upvote count: 1
has body: You could move the definition of countdown into init, if you want to keep elapsed completely private to the Level instance. That would look like: //member variable this.elapsed has been removed Level.init = function(){ var elapsed = 0; // elapsed local to init this.countdown = function() { elapsed += 1; var remaining = (GAME_LENGTH*60) - (elapsed/TICKS); var minutes = Math.floor(remaining/60); var seconds = Math.floor(remaining%60); this.countdown.html(minutes + ":" + ("0"+seconds).slice(-2)); if (elapsed/TICKS &gt;= GAME_LENGTH*60) { elapsed = 0; this.end_level(); } }; return this; }; Level.update = function(){ this.countdown(); }; It isn't possible to use a closure over a variable like elapsed for each instance without creating a new variable each time.
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28730901
type: Answer

http://stackoverflow.com/a/28668832
upvote count: 1
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28668703
has body: On today button click event, write this code $('#event_calender').datepicker('setDate', 'today');
type: Answer

http://stackoverflow.com/comment/45683331
score: 0
has text: Simplest way is simply populating the array multiple times with the value and then grab a random element from the array.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28696298

http://stackoverflow.com/a/28749707
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45782787
type: Answer
score: 2
downvote count: 0
has body: It's quite hard to grasp on a phone but I think the reason is probably because it's getting confused about the new data. By default the data() function uses the index of the item to join to the DOM. What you need to do instead is pass another function to your calls to data() which is described as a key function. Here you can probably just return the word. .data(nodes, function(d) { return d.word; }) Take a look at the data function in the API docs https://github.com/mbostock/d3/wiki/Selections . I've had complex cases catch me out a couple of times where I missed a key function.
has comment: http://stackoverflow.com/comment/45782576
accepted answer of: http://stackoverflow.com/q/28747682
upvote count: 2
answers question: http://stackoverflow.com/q/28747682

http://stackoverflow.com/comment/45579668
type: AnswerComment
type: Comment
has text: But how can an object be `undefined`? `Number({})` also returns `NaN`.
comment on: http://stackoverflow.com/a/28640207
score: 0

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

http://stackoverflow.com/a/28653625
score: 0
has comment: http://stackoverflow.com/comment/45795666
answers question: http://stackoverflow.com/q/28653609
has body: You need to use this instead of `Money' to read/write properties of the newly created object: function Money(bill, accu, hb, food, webHosting, lynda) { this.bill = bill; this.accu = accu; this.hb = hb; this.food = food; this.webHosting = webHosting; this.lynda = lynda; this.total = function() { return this.bill + this.accu + this.hb + this.food + this.webHosting + this.lynda; } } It's unclear what you were trying to do with your 'total' method. If you can describe what that is supposed to do, then we could help with that implementation, but I've provided an implementation that sums the properties.
type: Answer

http://stackoverflow.com/q/28707799
has comment: http://stackoverflow.com/comment/45705132
has comment: http://stackoverflow.com/comment/45705581
has comment: http://stackoverflow.com/comment/45709982
has title: Javascript get current page html (after editing)
has comment: http://stackoverflow.com/comment/45705653
has comment: http://stackoverflow.com/comment/45705143
linked to: http://stackoverflow.com/q/28700919
linked to: http://stackoverflow.com/q/17529509
has comment: http://stackoverflow.com/comment/45705380
has comment: http://stackoverflow.com/comment/45705362
type: Question
has answer: http://stackoverflow.com/a/28711026
tagged with: javascript
has comment: http://stackoverflow.com/comment/45704975
score: 0
has body: I have a page that I have edited after load and what I want to do is get the pages current HTML and pass that off to a PHP script. I first passed document.documentElement.innerHTML but that ended up including a bunch of computed style garbage at the top which I did not want. After googling around I found I could use ajax to get a copy of the current file on the server and then replace the edited part afterwards. I can get the copy of the file using this: var url = window.location.pathname; var filename = url.substring(url.lastIndexOf('/')+1); $.ajax({ url: filename, async: false, // asynchronous request? (synchronous requests are discouraged...) cache: false, // with this, you can force the browser to not make cache of the retrieved data dataType: "text", // jQuery will infer this, but you can set explicitly success: function( data, textStatus, jqXHR ) { origPage = data; // can be a global variable too... // process the content... } }); Which works fine and gets me the html I expected and see when viewing the page in notepad. The next step is what I cannot figure out. All I want to do is swap out the innerHTML of a div with an id of 'editor' with what the current value is, so I have tried this: origPage.getElementById('editor').innerHTML = e.html; But I get the error "TypeError: undefined is not a function". I must be doing something simple wrong I feel but I don't know the proper formatting to do this. I have tried the following variations: alert($(origPage).getElementById('editor').innerHTML); //Different attempt var newHtml = $.parseHTML( origPage ); alert($(newHtml).getElementById('editor').innerHTML); //Different attempt alert($(origPage).html().getElementById('editor').innerHTML); But I always get "TypeError: undefined is not a function" or "TypeError: Cannot read property 'getElementById' of undefined". How can I do this properly? EDIT: Complete page html below: This is editable. Click me to start editing.
has comment: http://stackoverflow.com/comment/45708066
answer count: 1
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/45705557
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45709888
has comment: http://stackoverflow.com/comment/45705458

http://stackoverflow.com/a/28688538
type: Answer
downvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28688491
has body: The getElementsByClassName function returns a array containing the elements. Therefore, you will need to iterate over the elements and add a event listener to each item in the array. ex: for(var i = 0; i &lt; bttn.length; i++){ bttn[i].addEventListener("click",draw,true) }
upvote count: 2

http://stackoverflow.com/comment/45502239
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28597694
has text: I didn't know this existed, but I want to be able to click the button more than once. Just not until the process is finished.
type: Comment

http://stackoverflow.com/a/28748420
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28747746
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28747746
type: Answer
has body: you should take a look to this Jquery plugin : https://github.com/CSS-Tricks/jQuery-Circulate-Plugin I think this could do the job ! Edit : the demo don't work on css-tricks.com, you need to download it.

http://stackoverflow.com/q/28736815
has body: In order to place the button in the middle, I need to put vertical-align:middle; to the canvas. Putting it on the td would make a lot more sense but it does nothing. Why do I need to place vertical-align:middle; on the canvas to vertical-align the button? Hey
type: Question
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/28737406
has title: Why do I need to verticalAlign canvas to align button?
type: UnansweredQuestion
tagged with: css

http://stackoverflow.com/q/28644497
linked to: http://stackoverflow.com/q/8630471
type: Question
has comment: http://stackoverflow.com/comment/45587138
has answer: http://stackoverflow.com/a/28644663
tagged with: javascript
score: 0
answer count: 3
tagged with: arrays
has answer: http://stackoverflow.com/a/28644660
has comment: http://stackoverflow.com/comment/45587170
has body: i have function with results parameter which consist of question_id and question as result from sql query i want to create array below as follow quesArray['id']['1']['ques']=results['question']; This is my code var len = results.rows.length; console.log("DEMO table: " + len + " rows found."); var quesArray=new Array(); for (var i=0; i&lt;len; i++){ console.log("Row = " + i + " ID = " + results.rows.item(i).del_ques_id + " Data = " + results.rows.item(i).question); quesArray['id']['1']['ques']=results['question']; }
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45587197
has answer: http://stackoverflow.com/a/28644588
has title: How to create 3 dimension array in javascript i want data to be inserted in my array help me out with my code

http://stackoverflow.com/comment/45644141
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28675374
type: QuestionComment
has text: I have tried that answer but not working

http://stackoverflow.com/q/28656205
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has body: I have a series of article elements added dynamically inside a section. I need each article to have a crescent class (fp_1, fp_2, fp_3, ...). How can I pull it of with jquery? $('#featured_posts article').addClass('fp_*'); It's the way to make the class crescent that I am missing.
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28656226
score: 1
type: Question
has title: jQuery add crescent classes to elements inside div
upvote count: 1
has answer: http://stackoverflow.com/a/28656226
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/45570329
type: Comment
type: QuestionComment
has text: `$ is not defined` typically means that jQuery isn't loaded.
score: 0
comment on: http://stackoverflow.com/q/28635155

http://stackoverflow.com/comment/45604750
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28653280
has text: Getting `Uncaught SyntaxError: Unexpected token :` Also curious if you tried running your snippet in a JSFiddle?
score: 0

http://stackoverflow.com/a/28683936
upvote count: 3
downvote count: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28673155
type: Answer
has body: After spending some more time, I've managed to set up the object editor to map the child properties. In the editor extension code, I traverse the schema properties to add them to the form object, and then I can map them in the angular html template. Here's the js code with the additions: var location = function(name, schema, options) { if (schema.type === 'object' &amp;&amp; schema.format === 'location') { var f = schemaFormProvider.stdFormObj(name, schema, options); f.key = options.path; f.type = 'location'; options.lookup[sfPathProvider.stringify(options.path)] = f; // ADDED THIS BIT: // map the schema properties to form properties f.properties = {}; angular.forEach(schema.properties, function(v, k) { var path = options.path.slice(); path.push(k); if (options.ignore[sfPathProvider.stringify(path)] !== true) { var required = schema.required &amp;&amp; schema.required.indexOf(k) !== -1; var def = schemaFormProvider.defaultFormDefinition(k, v, { path: path, required: required || false, lookup: options.lookup, ignore: options.ignore }); if (def) { f.properties[k] = def; } } }); return f; } }; schemaFormProvider.defaults.object.unshift(location); and the HTML template (with the inputs type='number' rather than 'text') now looks like this: &lt;div class="form-group" ng-class="{'has-error': hasError()}"&gt; &lt;label class="control-label" ng-show="showTitle()"&gt;{{form.title}}&lt;/label&gt; &lt;input ng-show="form.properties.latitude.key" style="background-color: white" type="number" class="form-control" schema-validate="form.properties.latitude" ng-model="$$value$$.latitude" /&gt; &lt;input ng-show="form.properties.longitude.key" style="background-color: white" type="number" class="form-control" schema-validate="form.properties.longitude" ng-model="$$value$$.longitude" /&gt; &lt;span class="help-block"&gt;{{ (hasError() &amp;&amp; errorMessage(schemaError())) || form.description}}&lt;/span&gt; &lt;/div&gt; I don't know if this is the correct way to do it but it works f…
accepted answer of: http://stackoverflow.com/q/28673155
score: 3

http://stackoverflow.com/comment/45720670
comment on: http://stackoverflow.com/q/28716424
score: 0
type: Comment
type: QuestionComment
has text: Thanks for the reply - but I am using $http.get, or does that make a difference?

http://stackoverflow.com/a/28743536
has comment: http://stackoverflow.com/comment/45769855
upvote count: 2
score: 2
has body: This test HH:MM:SS pattern without testing about real hours, minutes and seconds: HTML Code: Javascript code: function validate() { var date = document.getElementById("date").value; if (date.match(/^[0-9]{2}:[0-9]{2}:[0-9]{2}$/)) { alert("Valid date"); } else { alert("Invalide date: dat should be in HH:MM:SS format!"); } return false; } You can try it online here: http://jsfiddle.net/OscarGarcia/fow3htwz/1/ Remember: number of seconds and minutes are not tested! Someone could try to introduce this incorrect time: 43:87:91 and will (bad) pass the pattern! Edit: testing hours, minutes and seconds ranges This code works like a charm :) http://jsfiddle.net/OscarGarcia/fow3htwz/2/ function validate() { var date = document.getElementById("date").value; if (date.match(/^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$/)) { alert("Valid date"); } else { alert("Invalide date: dat should be in HH:MM:SS format!"); } return false; } New edit using test instead match Try it online: http://jsfiddle.net/OscarGarcia/fow3htwz/4/ function validate() { var date = document.getElementById("date").value; var pattern = /^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$/; if (pattern.test(date)) { alert("Valid date"); } else { alert("Invalide date: dat should be in HH:MM:SS format!"); } return false; } Best regards.
accepted answer of: http://stackoverflow.com/q/28743300
has comment: http://stackoverflow.com/comment/45770276
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45769982
type: Answer
has comment: http://stackoverflow.com/comment/45769798
answers question: http://stackoverflow.com/q/28743300

http://stackoverflow.com/comment/45565501
has text: Your codepen looks totally different from your sample here. It shouldn't call multiple times in the codepen.
type: QuestionComment
comment on: http://stackoverflow.com/q/28632689
score: 0
type: Comment

http://stackoverflow.com/a/28710209
has comment: http://stackoverflow.com/comment/45709947
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28710047
has comment: http://stackoverflow.com/comment/45709736
has body: Strangely enough this works for me: Plunker In HTML: &lt;input type="file" data-url="https://domain.com:9999/{{sidebar.id}}"/&gt; Controller: $scope.sidebar = { id : 'a' }; Are you sure this is available on scope?

http://stackoverflow.com/comment/45637173
type: Comment
has text: Havent tried it apparently it is `.hover()` or `.mouseover()`
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28671662

http://stackoverflow.com/a/28599038
answers question: http://stackoverflow.com/q/28598997
score: 0
type: Answer
has body: Just assign the value in total text box after your for loop is completed var limit = document.getElementById('limit').value; limit = parseFloat(limit); total = 0; for (i=0; i&lt;=limit ;i++) { total = total + i; }; document.getElementById("total").value = total; };

http://stackoverflow.com/q/28749378
has answer: http://stackoverflow.com/a/28767691
type: Question
linked to: http://stackoverflow.com/q/25382246
tagged with: angular-ui-router
possible better answer: http://stackoverflow.com/a/28764966
tagged with: javascript
linked to: http://stackoverflow.com/q/21424524
has answer: http://stackoverflow.com/a/28765204
answer count: 3
downvote count: 0
has title: With multiple views my child template is not loading, in Angular UI when URL changes
favorite count: 0
tagged with: angularjs
has body: I've seen a few questions like this, so forgive me if I've overlooked a crucial detail from them. When I load http://localhost:8000/characters/#/mages/detail/3 I get redirected to my 'otherwise' url: $urlRouterProvider.otherwise("/users"); But my state provider (if I've understood this correctly) should load the correct page: $stateProvider .state('users', { url: "/users", templateUrl: DjangoProperties.STATIC_URL + "partials/users.html" }) .state('users.list', { url: "/list", templateUrl: DjangoProperties.STATIC_URL + "partials/users.list.html", controller: 'UserListCtrl' }) .state('users.detail', { url: "/detail/{userID:int}", templateUrl: DjangoProperties.STATIC_URL + "partials/users.detail.html", controller: 'UserDetailCtrl' }) .state('mages', { url: "/mages", templateUrl: DjangoProperties.STATIC_URL + "partials/mages.html" }) .state('mages.list', { url: "/list", templateUrl: DjangoProperties.STATIC_URL + "partials/mages.list.html", controller: 'MageCtrl' }) .state('mages.detail', { url: "/detail/{mageID:int}", views:{ "@mage.detail": { templateUrl: DjangoProperties.STATIC_URL + "partials/mages.detail.html", controller: 'MageCtrl', }, "characteristics@mage.detail": { templateUrl: DjangoProperties.STATIC_URL + "common_partials/characteristics.html" }, "attributes@mage.detail": { templateUrl: DjangoProperties.STATIC_URL + "common_partials/attributes.html" }, "skills@mage.detail": { templateUrl: DjangoProperties.STATIC_URL + "common_partials/skills.html" }, "spells@mage.detail": { templateUrl: DjangoProperties.STATIC_URL + "partials/spells.html" }, } }); }]); Here is my mages.html: Mages Show List and my mages.detail.html {{mage.name}} None of these are loaded, just the default 'list' page. I feel I've gotten muddled over my view names, but I can't figure out what to do to fix them?
accepted answer: http://stackoverflow.com/a/28765204
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28764966
upvote count: 1

http://stackoverflow.com/comment/45651180
type: QuestionComment
score: 0
has text: is your data object an array? I see the index 0 in the json
comment on: http://stackoverflow.com/q/28678945
type: Comment

http://stackoverflow.com/a/28698577
upvote count: 1
has comment: http://stackoverflow.com/comment/45692972
type: Answer
has comment: http://stackoverflow.com/comment/45687804
downvote count: 0
has body: I did a quick google search on how to do this and found a stack overflow post with a similar answer, here is the fiddle that was provided, here is the javascript portion: var i = 0; $('#dragbar').mousedown(function(e){ e.preventDefault(); $('#mousestatus').html("mousedown" + i++); $(document).mousemove(function(e){ $('#position').html(e.pageX +', '+ e.pageY); $('#sidebar').css("width",e.pageX+2); $('#main').css("left",e.pageX+2); }) console.log("leaving mouseDown"); }); $(document).mouseup(function(e){ $('#clickevent').html('in another mouseUp event' + i++); $(document).unbind('mousemove'); }); http://jsfiddle.net/gaby/Bek9L/ And here is the post: Emulating frame-resize behavior with divs using jQuery without using jQuery UI? The fiddle uses jQuery but not jQuery UI, You will need to use percentages for width, look into responsive design. http://learn.shayhowe.com/advanced-html-css/responsive-web-design/ I hope this helps
has comment: http://stackoverflow.com/comment/45687420
score: 1
answers question: http://stackoverflow.com/q/28698441

http://stackoverflow.com/comment/45527525
comment on: http://stackoverflow.com/a/28611753
score: 0
has text: So I have to rewrite the code because example1 and example2 must be in readydoc() to work proper because readydoc() have stuff that they need. But I'm not sure is this possible with them outside the function.
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/45560324
has text: Lack of coffee creates significant mistakes.
comment on: http://stackoverflow.com/a/28630125
score: 2
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45623984
type: QuestionComment
score: 2
has text: i dont see the text "conditional after return" in the fiddle's console, so it seems to be working for me.
comment on: http://stackoverflow.com/q/28664549
type: Comment

http://stackoverflow.com/comment/45721460
type: Comment
comment on: http://stackoverflow.com/a/28716346
score: 0
type: AnswerComment
has text: Your question is how to add oncontextmenu attribute while building the iframe. The above does exactly that. If this is an attempt to hide the path of the image, disabling right click is fine but F12 will still open the inspect element giving the client access to the source/path.

http://stackoverflow.com/comment/45669625
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28688256
has text: Interesting situation. I think the best (and only) way to handle this is by overriding the key option with a promissory function. I'll write up an answer.
score: 0

http://stackoverflow.com/comment/100280862
score: 0
has text: Note to future readers; last loop with _`while`_ doesn't work on it's own without a proceeding `let element;`... well for some JavaScript shells that is. Solid answer otherwise.
comment on: http://stackoverflow.com/a/45849918
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28690564
has body: Is it possible to remove or disable "Inspect Element" context menu in Chrome App via Javascript? I have searched through several forums but there are no definite answer.
upvote count: 52
has title: Is it possible to remove "Inspect Element"?
answer count: 21
has comment: http://stackoverflow.com/comment/45672724
has comment: http://stackoverflow.com/comment/45672938
favorite count: 0
has answer: http://stackoverflow.com/a/44601125
has answer: http://stackoverflow.com/a/70474044
accepted answer: http://stackoverflow.com/a/28690644
has answer: http://stackoverflow.com/a/70324242
linked to: http://stackoverflow.com/q/24319786
has comment: http://stackoverflow.com/comment/45673072
tagged with: google-chrome
has answer: http://stackoverflow.com/a/68308585
possible better answer: http://stackoverflow.com/a/44601125
has answer: http://stackoverflow.com/a/69538263
has answer: http://stackoverflow.com/a/65102393
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/63490897
has answer: http://stackoverflow.com/a/78796655
has answer: http://stackoverflow.com/a/28690599
has comment: http://stackoverflow.com/comment/45673404
has comment: http://stackoverflow.com/comment/45672988
has answer: http://stackoverflow.com/a/39071547
has answer: http://stackoverflow.com/a/68387880
type: Question
has answer: http://stackoverflow.com/a/66904457
has comment: http://stackoverflow.com/comment/45672645
has answer: http://stackoverflow.com/a/78112556
has answer: http://stackoverflow.com/a/72587459
has comment: http://stackoverflow.com/comment/45695351
has answer: http://stackoverflow.com/a/28690644
has answer: http://stackoverflow.com/a/77926913
score: 52
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/64262192
has answer: http://stackoverflow.com/a/67604375
has answer: http://stackoverflow.com/a/57055833
tagged with: google-chrome-app
has comment: http://stackoverflow.com/comment/45672743
has answer: http://stackoverflow.com/a/64870293
has answer: http://stackoverflow.com/a/71901904

http://stackoverflow.com/q/28660525
tagged with: jquery
type: UnansweredQuestion
type: Question
score: 1
favorite count: 0
answer count: 2
has title: How can i update the date? it gets stuck on the date when i ran the app
upvote count: 1
has answer: http://stackoverflow.com/a/28660650
has answer: http://stackoverflow.com/a/28660719
tagged with: date
has comment: http://stackoverflow.com/comment/45616689
downvote count: 0
has body: I want to update the Date each day, right now it gets stuck on the Date when i opened the app, when i open it says for example: Sunday 22 February 2015, and tomorrow it will keep showing Sunday 22 February 2015 instead of Monday 23 February 2015. The JQuery Code: $(document).ready(function() { var monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; var dayNames["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"] var newDate = new Date(); newDate.setDate(newDate.getDate()); $('#Date').html(dayNames[newDate.getDay()] + " " + newDate.getDate() + ' ' + monthNames[newDate.getMonth()] + ' ' + newDate.getFullYear()); setInterval( function() { var seconds = new Date().getSeconds(); $("#sec").html(( seconds &lt; 10 ? "0" : "" ) + seconds); },1000); setInterval( function() { var minutes = new Date().getMinutes(); $("#min").html(( minutes &lt; 10 ? "0" : "" ) + minutes); },1000); setInterval( function() { var hours = new Date().getHours(); $("#hours").html(( hours &lt; 10 ? "0" : "" ) + hours); }, 1000); }); to load on: &lt;div id="Date"&gt;&lt;/div&gt; &lt;div id="hours"&gt;&lt;/div&gt; &lt;div id="min"&gt;&lt;/div&gt; &lt;div id="sec"&gt;&lt;/div&gt; working Demo
tagged with: javascript

http://stackoverflow.com/q/28604111
score: 0
has comment: http://stackoverflow.com/comment/45513935
has body: As the title says, I want to stick a div to top at scroll, unstick it when scrolling back. i know theres a million answers on this, I have tried every example i can find but no-one seems to work for me. I would prefer Vanilla Js too. Html: &lt;div class="menubar" id="menubar"&gt;&lt;/div&gt; css: #menubar { height: 150px; padding-left: 4px; top: 0; z-index: 99999999; background-repeat: repeat-x; background-position: top; background-color: #fff; border-bottom: 43px solid #2081c1; margin-left: -50%; width: 100%t; position: absolute; }
has title: Stick div to top on scroll, unstick when scrolling back
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45513154
answer count: 0
tagged with: javascript
type: Question

http://stackoverflow.com/q/28667385
type: Question
score: 0
tagged with: javascript
tagged with: ajax
has body: I am lost on why i am getting this internal error(500). My email info still go through when i click submit. The only problem i have is that the ajax success method is not being called so basically my callback function is never getting called on. Any help would be greatly appreciated. I have been pulling my hair out for hours on this problem. My scipt-ajax call: emailValidation: function(e){ e.preventDefault(); $('body, html').animate({scrollTop:0},"slow"); var valid = ''; var name = $("#f_name").val(); var email = $("#f_email").val(); var message = $("#f_message").val(); var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; if(name === '' || name.length <= 2){ valid += ' Name must be longer than 2 char. '; } if(message === '' || message.length <= 5){ valid += ' Message must be longer than 5 char. '; } if (!(email).match(emailReg)){ valid += ' Invalid Email '; } if (valid !== ''){ $('#form-messages').html(''+valid+'').fadeIn(); } else { var formData = $("#contact").serialize();//Value for sanitized form values to be paased to email.php. Value returns an array portfolio.submitEmail(formData); } }, submitEmail: function(formData){ console.log(formData); //$('#form-messages').html("Proccessing... ").fadeIn('fast'); $('body, html').animate({scrollTop:0},"fast"); $.ajax({ type: 'POST', url: 'mailer.php', data: formData, dataType: 'json', success: function(result){ console.log(result.statusText); if(result.statusText === 'OK'){ console.log('jam'); // Make sure that the formMessages div has the 'success' class. $('#form-messages').removeClass('error'); $('#form-messages').addClass('success'); // Set the message text. $('#form-messages').html(' Message has been sent succesfully! Thank you '+ $('#f_name').val() +', a response will be returned in less than one business day. '); $("#contact").fadeOut('slow').remove(); $('body, html').animate({scrollTop:0},"fast"); } }, error: function(error){ console.log(error.statusText); if(error.statusText === 'OK'){ // Make sure that the fo…
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45629313
has title: getting a 500 error when submitting email but email still goes through
tagged with: php
has comment: http://stackoverflow.com/comment/54711241

http://stackoverflow.com/a/28692265
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28692060
has body: I checked your link. The Hindi text on that page is made up with &lt;span&gt; elements containing single letter. It'll render perfectly if you add 1 word in each &lt;span&gt; instead of single letter. The vowel sounds of Hindi (Matra) can't be used without a letter thats why a circle is being used on your page to support each Matra. Edit: Try this function to make it work function setText(){ $('p.calibre2').each(function(){ var $this = $(this); var text = ''; $this.find('span').each(function(){ text += $(this).text(); }); $this.html($('&lt;span/&gt;').append(text)); }); } setText();
downvote count: 0
has comment: http://stackoverflow.com/comment/45675775

http://stackoverflow.com/comment/45631008
score: 0
type: Comment
type: QuestionComment
has text: Provide more details with your question, also add what have you tried and see [How to ask](http://stackoverflow.com/help/how-to-ask), for properly formatting your question. Thanks.
comment on: http://stackoverflow.com/q/28642425

http://stackoverflow.com/comment/45620045
type: Comment
has text: Thanks. Yeah I did it with splice and worked to create an empty array and then push the positives into that new array, I just can't figure out how I would use pop and no temporary arrays. Here are the instructions i was given: (Removing Negatives) Given an array X of multiple values (e.g. [-3,5,1,3,2,10]), write a program that removes any negative values in the array. Once your program is done X should be composed of just positive numbers. Do this without creating a temporary array and only using the pop method to remove any values in the array.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28653229

http://stackoverflow.com/comment/45734441
comment on: http://stackoverflow.com/q/28723814
has text: You're also likely to overflow a server-side buffer and crash your server at this rate.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28658388
possible better answer: http://stackoverflow.com/a/67883939
tagged with: javascript
has answer: http://stackoverflow.com/a/67883939
has title: FileReader.result return null
accepted answer: http://stackoverflow.com/a/28658756
answer count: 2
upvote count: 7
has comment: http://stackoverflow.com/comment/45612601
has answer: http://stackoverflow.com/a/28658756
has comment: http://stackoverflow.com/comment/45612636
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45612737
type: AnsweredQuestion
downvote count: 0
score: 7
tagged with: file
has comment: http://stackoverflow.com/comment/45613167
favorite count: 0
has body: I'm trying to setup a page that lets you upload a txt file (namely a log file that another program generates), and then manipulate the text further. So far I just want to console.log the text, but later on I'm planning to separate lines and get some specifics out of it to run my program. Anyway, when I upload my log file I get the following: null $("#draftlog").change(function() { var logFile = $('#draftlog').get(0).files[0]; var reader = new FileReader; reader.readAsText(logFile); var rawLog = reader.result; console.log(rawLog); }); body { margin: 0; min-width: 1200px; } .pickscontainer { margin-left: 5%; width: 90%; border: 1px solid black; } .cardbox { margin: 1px; border: 2px solid black; border-radius: 5px; width: auto; display: inline-block; } .card { width: 210px; height: 285px; } .picks { width: 90%; border: 1px solid black; height: 150px; margin-right: 5%; margin-left: 5%; } .inputbox { margin-left: 5%; width: 90%; } MTGO draft There's the snippet. I've also uploaded a few of the log files I'm trying to read onto my server logs
type: Question
has comment: http://stackoverflow.com/comment/45612576

http://stackoverflow.com/a/28599232
score: 0
has body: Just change from -webkit-transform: rotatey(-180deg); to -webkit-transform: rotatex(-180deg);. I think this is what you are looking for. $(document).ready(function () { $('.flipWrapper').click(function () { $(this).find('.card').toggleClass('flipped'); return false; }); }); .flipWrapper { -webkit-perspective: 1000; width: 400px; height: 200px; position: relative; margin: 50px auto; } .flipWrapper .card.flipped { -webkit-transform: rotatex(180deg); } .flipWrapper .card { width: 100%; height: 100%; -webkit-transform-style: preserve-3d; -webkit-transition: 0.5s; } .flipWrapper .card .face { width: 100%; height: 100%; position: absolute; -webkit-backface-visibility: hidden; z-index: 2; font-family: Georgia; font-size: 3em; text-align: center; line-height: 200px; } .flipWrapper .card .front { position: absolute; z-index: 1; background: rgb(57, 171, 62); color: white; cursor: pointer; border-radius: 10px; } .flipWrapper .card .back { -webkit-transform: rotatex(-180deg); background: blue; background: red; color: white; cursor: pointer; border-radius: 10px; } jQuery Script
type: Answer
answers question: http://stackoverflow.com/q/28599149

http://stackoverflow.com/comment/45668485
comment on: http://stackoverflow.com/q/28685912
score: 0
type: Comment
type: QuestionComment
has text: I dunno. Maybe someone dislike your question style.

http://stackoverflow.com/q/28718641
has body: I'm trying to use the new Map object from Javascript EC6, since it's already supported in the latest Firefox and Chrome versions. But I'm finding it very limited in "functional" programming, because it lacks classic map, filter etc. methods that would work nicely with a [key, value] pair. It has a forEach but that does NOT returns the callback result. If I could transform its map.entries() from a MapIterator into a simple Array I could then use the standard .map, .filter with no additional hacks. Is there a "good" way to transform a Javascript Iterator into an Array? In python it's as easy as doing list(iterator)... but Array(m.entries()) return an array with the Iterator as its first element!!! EDIT I forgot to specify I'm looking for an answer which works wherever Map works, which means at least Chrome and Firefox (Array.from does not work in Chrome). PS. I know there's the fantastic wu.js but its dependency on traceur puts me off...
has title: Transforming a Javascript iterable into an array
answer count: 9
linked to: http://stackoverflow.com/q/27612713
score: 264
has answer: http://stackoverflow.com/a/61067076
has answer: http://stackoverflow.com/a/28719692
type: AnsweredQuestion
upvote count: 264
has answer: http://stackoverflow.com/a/28719419
has answer: http://stackoverflow.com/a/58163021
has answer: http://stackoverflow.com/a/51780205
has answer: http://stackoverflow.com/a/79189541
possible better answer: http://stackoverflow.com/a/28719692
type: Question
has answer: http://stackoverflow.com/a/69968711
linked to: http://stackoverflow.com/q/27529486
tagged with: ecmascript-6
has answer: http://stackoverflow.com/a/28718967
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28718967
linked to: http://stackoverflow.com/q/28541039
has answer: http://stackoverflow.com/a/54323648
downvote count: 0
has comment: http://stackoverflow.com/comment/61241480
favorite count: 0
has comment: http://stackoverflow.com/comment/118357341

http://stackoverflow.com/q/28636358
accepted answer: http://stackoverflow.com/a/28636450
type: AnsweredQuestion
downvote count: 2
upvote count: 1
duplicate of: http://stackoverflow.com/q/14684077
has title: How to disable HTML effect in a tag but not the HTML
type: Question
tagged with: javascript
score: -1
answer count: 2
has answer: http://stackoverflow.com/a/28636450
has comment: http://stackoverflow.com/comment/45574857
possible better answer: http://stackoverflow.com/a/28636444
has body: While making a post feature with PHP , i realized that anyone can post their text with a tag also. For ex. What's Up or even Look, moving . When these types of data will be printed it would affect inside the post. Like will make the post bold. There must a html tag or a way with PHP or Javascript to disable html inside a tag. I'm well aware of strip_tags(), but this function strips the tags for ex. blah blah will be shown like blah blah but i want it to be shown blah blah but not the HTML effect it would cause.
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28636444
favorite count: 0
linked to: http://stackoverflow.com/q/14684077
tagged with: php
linked to: http://stackoverflow.com/q/10551116

http://stackoverflow.com/q/28702106
has body: So say if i have li elements, and i want to use java script to a) find element with class X then add modify some attribute of it. I can run usual JavaScript and it'd be doable, but i have no idea of how to get handle of existing elements and manipulate them. Can you refer to element with in jade, preferably like in jquery $('.a').has(..) This is new idea i haven't seen it mentioned anywhere before. Usually it's server side ( you manually modify elements ) or you send data along template to client where javascript can tackled actual elements.
type: AnsweredQuestion
upvote count: 0
score: -5
type: Question
has comment: http://stackoverflow.com/comment/45733851
has comment: http://stackoverflow.com/comment/45695543
has comment: http://stackoverflow.com/comment/45705449
has answer: http://stackoverflow.com/a/28706086
tagged with: templating
tagged with: javascript
has comment: http://stackoverflow.com/comment/45712251
tagged with: express
answer count: 2
tagged with: pug
linked to: http://stackoverflow.com/q/14144274
favorite count: 0
possible better answer: http://stackoverflow.com/a/28706086
downvote count: 5
has title: is there jade plugin that would allow manipulation using jquery styled syntax
has answer: http://stackoverflow.com/a/28723971
accepted answer: http://stackoverflow.com/a/28723971
tagged with: node.js

http://stackoverflow.com/a/70062659
has body: Printing line number with custom string const moment = require('moment'); const log = console.log; const path = require('path'); function getTime(time) { return moment().format('YYYY-MM-DD HH:mm:ss') }; function line(num = 2) { const e = new Error(); const regex = /\((.*):(\d+):(\d+)\)$/ const match = regex.exec(e.stack.split("\n")[num]); const filepath = match[1]; const fileName = path.basename(filepath); const line = match[2]; const column = match[3]; return { filepath, fileName, line, column, str: `${getTime()} - ${fileName}:${line}:${column}` }; } log(line().str, "mylog1"); log(line().str, "mylog2"); log(line().str, "mylog3"); OUTPUT 2021-11-22 13:07:15 - test.js:44:5 mylog1 2021-11-22 13:07:15 - test.js:45:5 mylog2 2021-11-22 13:07:15 - test.js:46:5 mylog3
downvote count: 0
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/28631260
score: 2

http://stackoverflow.com/q/28709027
answer count: 1
tagged with: javascript
has body: I'm trying to code a function in javascript that will automatically add a button into some components that are from particular class. I've finally succeeded by writing the following code : Configurations Configuration manager ! Current configuration header reference label highlight color account number But, before this, i've encountered one issue that i'm not able to understand. The issue : the HTMLCollection.length keep zero as value, but the collection seems to be correctly populated in the debug view, so the loop is not executed at all. Configurations Configuration manager ! Current configuration header reference label highlight color account number Is it possible to have an explanation about this ?
tagged with: iteration
score: 0
has answer: http://stackoverflow.com/a/28709076
tagged with: htmlcollection
type: UnansweredQuestion
tagged with: onload
has title: javascript onload function scope interrogation
type: Question

http://stackoverflow.com/q/28632993
has body: I am trying to use AnySlider (http://jwilsson.github.io/AnySlider/) with a text link to call specific slides. Unfortunately, I can not get this API function to work: var slider = $("#slider").data('anyslider'); slider.goTo(3); Here is the rest of the code. Thanks for your help! Slide 1 Slide 2 Slide 3 Slide 2
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: AnySlider goTo(slide) using text link
type: UnansweredQuestion
type: Question
tagged with: hyperlink
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28635599
score: 0
tagged with: slider

php
tags question: http://stackoverflow.com/q/28738960
tags question: http://stackoverflow.com/q/28650423
tags question: http://stackoverflow.com/q/28749724
tags question: http://stackoverflow.com/q/28700137
tags question: http://stackoverflow.com/q/28653130
tags question: http://stackoverflow.com/q/28749343
tags question: http://stackoverflow.com/q/28636358
tags question: http://stackoverflow.com/q/28613168
tags question: http://stackoverflow.com/q/28683662
tags question: http://stackoverflow.com/q/28728436
tags question: http://stackoverflow.com/q/28618755
tags question: http://stackoverflow.com/q/28711117
tags question: http://stackoverflow.com/q/28701402
tags question: http://stackoverflow.com/q/28739747
tags question: http://stackoverflow.com/q/28624816
tags question: http://stackoverflow.com/q/28687297
tags question: http://stackoverflow.com/q/28729091
tags question: http://stackoverflow.com/q/28670716
tags question: http://stackoverflow.com/q/28636364
tags question: http://stackoverflow.com/q/28712161
tags question: http://stackoverflow.com/q/28666481
tags question: http://stackoverflow.com/q/28618439
tags question: http://stackoverflow.com/q/28616585
tags question: http://stackoverflow.com/q/28679164
tags question: http://stackoverflow.com/q/28605468
tags question: http://stackoverflow.com/q/28718787
tags question: http://stackoverflow.com/q/28640467
tags question: http://stackoverflow.com/q/28677909
tags question: http://stackoverflow.com/q/28611903
tags question: http://stackoverflow.com/q/28667385
tags question: http://stackoverflow.com/q/28747589
tags question: http://stackoverflow.com/q/28719450
tags question: http://stackoverflow.com/q/28739387
tags question: http://stackoverflow.com/q/28595659
tags question: http://stackoverflow.com/q/28610666
tags question: http://stackoverflow.com/q/28608606
tags question: http://stackoverflow.com/q/28724013
tags question: http://stackoverflow.com/q/28647629
tags question: http://stackoverflow.com/q/28596313
tags question: http://stackoverflow.com/q/28663204
tags question: http://stackoverflow.com/q/28725684
tags question: http://stackoverflow.com/q/28626142
tags question: http://stackoverflow.com/q/28749800
tags question: http://stackoverflow.com/q/28627632
tags question: http://stackoverflow.com/q/28628874
tags question: http://stackoverflow.com/q/28748965
tags question: http://stackoverflow.com/q/28656441
tags question: http://stackoverflow.com/q/28730431
tags question: http://stackoverflow.com/q/28626074
tags question: http://stackoverflow.com/q/28626837
tags question: http://stackoverflow.com/q/28608158
tags question: http://stackoverflow.com/q/28674181
tags question: http://stackoverflow.com/q/28633494
tags question: http://stackoverflow.com/q/28677683
tags question: http://stackoverflow.com/q/28745515
tags question: http://stackoverflow.com/q/28675979
tags question: http://stackoverflow.com/q/28727248
tags question: http://stackoverflow.com/q/28638039
tags question: http://stackoverflow.com/q/28602839
tags question: http://stackoverflow.com/q/28595870
tags question: http://stackoverflow.com/q/28735016
tags question: http://stackoverflow.com/q/28675017
tags question: http://stackoverflow.com/q/28731797
tags question: http://stackoverflow.com/q/28722656
tags question: http://stackoverflow.com/q/28694443
tags question: http://stackoverflow.com/q/28609997
tags question: http://stackoverflow.com/q/28622018
tags question: http://stackoverflow.com/q/28667227
tags question: http://stackoverflow.com/q/28687274
tags question: http://stackoverflow.com/q/28657344
tags question: http://stackoverflow.com/q/28732639
tags question: http://stackoverflow.com/q/28740065
tags question: http://stackoverflow.com/q/28707405
tags question: http://stackoverflow.com/q/28641888
tags question: http://stackoverflow.com/q/28613452
tags question: http://stackoverflow.com/q/28631255
tags question: http://stackoverflow.com/q/28655915
tags question: http://stackoverflow.com/q/28620310
tags question: http://stackoverflow.com/q/28648611
tags question: http://stackoverflow.com/q/28716633

http://stackoverflow.com/a/28641686
has comment: http://stackoverflow.com/comment/45582567
type: AcceptedAnswer
downvote count: 0
has body: Try doing this JavaScript: Add a dataType and change the alert so it alerts the response. $.ajax({ type: 'POST', url: './dev.php', data: {tradeOf: tradeOf, test: "test"), dataType: 'json', success: function(response) { alert(response); } }) PHP: Echo back the $_POST via a json_encode. &lt;?php echo json_encode($_POST); ?&gt;
has comment: http://stackoverflow.com/comment/45582488
has comment: http://stackoverflow.com/comment/45582423
type: Answer
accepted answer of: http://stackoverflow.com/q/28641438
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28641438

http://stackoverflow.com/q/28648162
tagged with: jquery
has comment: http://stackoverflow.com/comment/45594016
has body: I make Chrome extension for removing li elements from specific UL. for example i have test1 test2 test3 .... and so on I have array of 3500 items(like database) which on every page reload checks this ul for matches and removes them. my jQuery code is like this: var remove = function remove(items){ $.each(items, function(index,value){ if( $("div.l1 p").filter(function() { return $(this).text() == value; }).length ) // if there is match { $("div.l1 p").filter(function(){ return $(this).text() == value; }).parent().parent().remove(); // delete li element } } } and i call it like: var initi = function initi() // called when page is loaded { remove(Array("test1","test2","test3",...,"testonemilion")); } my problem which happens is sometimes chrome randomly runs out of memory and requires reloading the page. I think this will happen more often when "database" becomes bigger. so i wanted to ask are there possible ways to optimize my jQuery function, to lower that memory stress? i use latest chrome 40.0.2214.115 m and have 8GB RAM on my computer(which never gets to 100%) Thanks! EDIT: Also are there debugging tools which will display how different versions of function will perform(for example function1() executes for 1 sec, function2() executes for 0.8sec and so on)
has comment: http://stackoverflow.com/comment/45594971
answer count: 3
upvote count: 1
favorite count: 0
has title: Optimize javascript/jQuery for better performance
tagged with: out-of-memory
has answer: http://stackoverflow.com/a/28648273
possible better answer: http://stackoverflow.com/a/28648228
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28648228
accepted answer: http://stackoverflow.com/a/28648346
downvote count: 0
score: 1
tagged with: google-chrome
type: Question
has comment: http://stackoverflow.com/comment/45593991
has answer: http://stackoverflow.com/a/28648346
tagged with: javascript

http://stackoverflow.com/q/28690022
type: AnsweredQuestion
has title: Linkedin Developer: [unauthorized]. IP Address Mismatch
possible better answer: http://stackoverflow.com/a/28690162
type: Question
has answer: http://stackoverflow.com/a/28690162
has answer: http://stackoverflow.com/a/30324961
accepted answer: http://stackoverflow.com/a/30324961
tagged with: linkedin-jsapi
tagged with: javascript
score: 0
has body: I tried to share a html page on linkedin using the Javascript API and the following format. I didn't need any image, so I left it blank. { "comment": "Check out developer.linkedin.com!", "content": { "title": "LinkedIn Developers Resources", "description": "Leverage LinkedIn's APIs to maximize engagement", "submitted-url": "https://developer.linkedin.com" }, "visibility": { "code": "anyone" } } I get an error [unauthorized]. IP Address Mismatch from the API, when I change the "submitted-url" to my html page. The code works fine when I try to share a linkedin url, the one given in the example above.
answer count: 2
tagged with: linkedin-api

http://stackoverflow.com/comment/45783920
type: AnswerComment
type: Comment
has text: @Esailija oh thats good to know. I'm pretty sure relay on that behavior somewhere -.-
comment on: http://stackoverflow.com/a/28737038
score: 0

http://stackoverflow.com/q/28654349
has comment: http://stackoverflow.com/comment/45605750
has title: How can i sort this div by distance?
answer count: 1
has body: With javascript I got the distance between some fixed coordinates respect my current location, now how can I order them (div) by distance? This is my code: Documento senza titolo <span id="currentLon" Distance from starting location: km <span id="currentLon" Distance from starting location: km <span id="currentLon" Distance from starting location: km <span id="currentLon" Distance from starting location: km I would like them appear in order of distance; Thanks a lot!
has comment: http://stackoverflow.com/comment/45616679
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: 0
has answer: http://stackoverflow.com/a/28654526
type: Question
tagged with: javascript
tagged with: sorting
tagged with: distance
has comment: http://stackoverflow.com/comment/45617016
tagged with: google-maps

http://stackoverflow.com/q/28645358
has comment: http://stackoverflow.com/comment/45588709
has body: First, the problem: I have an overview of items, and I want to get directed to a detailpage when clicking on a item. So far so good, the path works and all, but somehow my code keeps directing and removes the hash of the link. My browser(google chrome) tells me "object not found then". The routing code: .when('/home/:category/', { title: "Home", name: "home", templateUrl: './templates/frontend_home.php', controller: "SearchListCtrl" }) .when('/detail/:id', { title: "Detailansicht", name: "detail", controller: "DetailController", templateUrl: "./templates/frontend_detail.php" }) I have an ng-repeat of &lt;tr&gt;, which link to the detailview like: &lt;tr ng-repeat="data in responseData | limitTo:limit" ng-click="showDetail(data.id)"&gt; And the code in the SearchListCtrl: $scope.showDetail = function(detailId){ console.log("showDetail"); $location.path('/detail/' + detailId); } The DetailController: lmsApp.controller('DetailController', function ($scope, $routeParams, $http){ $scope.$on("$routeChangeSuccess", function(evt, absNewUrl, absOldUrl){ console.log(absOldUrl); console.log(absNewUrl); }); var ajax=$http.post("./includes/ajax_getDetailInformation.php", {"id": $routeParams["id"]}); ajax.success(function(data, status, headers, config) { $scope.object=data[0]; }); ajax.error(function(data, status, headers, config){ console.log("Ajax failed"); }); }); So, first the link is like: http://localhost/Diplomarbeit/lms_project/#/detail/168?query=violine And than gets (automatically) to something like: http://localhost/Diplomarbeit/lms_project/detail/168 I have tried to remove the search query with $location.url($location.path()); before changing the path already, but it doesn't make changes. I can see the first(working) link in the history, but why does it keep redirecting? I would appreciate every answer. Greets, Force0234
has title: Removes hash when directing
tagged with: http://stackoverflow.com/tag/html
tagged with: ngroute
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
upvote count: 1
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/45588602
type: Question
tagged with: angular-routing
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45588645

http://stackoverflow.com/a/28668366
score: 1
accepted answer of: http://stackoverflow.com/q/28668274
upvote count: 1
answers question: http://stackoverflow.com/q/28668274
type: AcceptedAnswer
downvote count: 0
has body: You can try something like this: $('#displayData').on('click', '.tb_data thead th', function(){ var className = $(this).attr('class').match(new RegExp(/sort_[\w]+/g)); var str = className[0].replace(/^sort_/g,""); alert(str); });
type: Answer

easeljs
tags question: http://stackoverflow.com/q/28731492
tag name: easeljs
tags question: http://stackoverflow.com/q/28605572
type: Tag

http://stackoverflow.com/q/28732410
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28748601
score: 0
has title: ionic pushing a view within a side menu
tagged with: ionic-framework
type: Question
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/28732579
has body: I have a side menu: <ion-side-menu side="left"> John Doe <ion-content id="menu-content"> <ion-list> account When the app opens, I am automatically sent to the accounts page. I can easily click the "hamburger" to get to the slide out navigation where there are several other pages to I can access. From the account page, there is a list of accounts. I am having trouble "drilling-down" into a detailed view of account. The side menu is defined in menu.html. Here are the routes: .config(function($stateProvider, $urlRouterProvider) { $stateProvider .state('app', { url: '/app', abstract: true, templateUrl: 'templates/menu.html', controller: 'AppCtrl' }) .state('app.accounts', { url: '/accounts', views: { 'menuContent': { templateUrl: 'templates/account.html' } } }) .state('app.accounts/accountId', { url: '/accounts/accountId', views: { 'menuContent': { templateUrl: 'templates/account-detail.html' } } }) $urlRouterProvider.otherwise('/app/home'); The third state is not working. What would the name (currently menuContent) be? How would I properly route this from the context of a side menu? What would the link look like in the account list page? something like: view account The resulting view config is something like below: Note that the user should not be able to go from account back to menu. They will need to hit a 'back' button then go to the menu. Pretty standard in mobile apps.
tagged with: angularjs

http://stackoverflow.com/q/28616948
tagged with: charts
has answer: http://stackoverflow.com/a/28618225
tagged with: javascript
upvote count: 2
answer count: 1
downvote count: 0
linked to: http://stackoverflow.com/q/18693005
has comment: http://stackoverflow.com/comment/45537061
favorite count: 0
tagged with: d3.js
has title: d3 lines and circles data
type: AnsweredQuestion
score: 2
accepted answer: http://stackoverflow.com/a/28618225
type: Question
has body: I am trying to draw a set of lines and circle points, but I cant figure out how to get the circles to work. The line function needs an array of points, but for the circle it needs just the x/y of each point. How do I append a circle (to the same group as the line), for each x/y point? // Data join var join = svg.selectAll("g") .data(lineData) // Enter var group = join.enter() .append("g"); group.append("path") .attr('stroke', 'blue') .attr('stroke-width', 2) .attr('fill', 'none'); group.append('circle') .attr("r", 10) .attr('fill', 'blue'); // Update join.select("path") .attr('d', line); join.select("circle") .attr("cx", function(d) { return x(d.x); }) .attr("cy", function(d) { return y(d.y); }); Full code is here: http://jsfiddle.net/dxxddvL4/1/

http://stackoverflow.com/q/28638913
has comment: http://stackoverflow.com/comment/45592054
type: AnsweredQuestion
downvote count: 0
has body: I need to save a large set of client-side generated data (binary) to the client system. I looked at creating a Data URI, but the datasize is large (an app-generated image PDF files of 100+ pages). Is there some other way to do this other than a Data URI? Thanks!
has answer: http://stackoverflow.com/a/28647235
score: 1
has title: Looking to save a client-side generated binary file to client machine
accepted answer: http://stackoverflow.com/a/28647235
tagged with: file
type: Question
has comment: http://stackoverflow.com/comment/45620389
tagged with: javascript
tagged with: dart
upvote count: 1
answer count: 1
tagged with: binary-data
favorite count: 0
tagged with: download

http://stackoverflow.com/q/28661243
linked to: http://stackoverflow.com/q/9999802
score: 3
upvote count: 3
has title: Javascript & html: Is there a way to find a top level named window(or tab) and bring it to foreground instead of loading url into it?
type: Question
has body: As we know, click &lt;a href='a.html' target='abc'&gt;...&lt;/a&gt; will load a.html into a window named abc. But if the abc window already exists, and i just want to bring it foreground instead of load a.html again into it, is there a way to do this? Thanks a lot.
has comment: http://stackoverflow.com/comment/45618282
linked to: http://stackoverflow.com/q/7174222
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28698202
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45618270
has comment: http://stackoverflow.com/comment/45644018
type: UnansweredQuestion

http://stackoverflow.com/a/28610378
upvote count: 1
has body: i guss this is a better way of doing that Here is a FIDDLE of the gallery. Put all your images in a hidden div Clone them and put them in the visible div Animate the image by changing the left margin You can adjust the time between images by the set interval function You can adjust the slidein time by the animate time. JS var pictxtnumber = 1; loadpictxt(pictxtnumber); var fadeintime = 500; animatediv(); function animatediv() { var number = 0; var interval = setInterval(function() { pictxtnumber = pictxtnumber + 1; if(pictxtnumber &gt; 6) { pictxtnumber = 1; } loadpictxt(pictxtnumber); }, 1000); } function loadpictxt(num) { $('.picturediv').html(''); $(".hiddenimage img:nth-child(" + num + ") ").clone().appendTo('.picturediv'); $('.picturediv img').css('margin-left', '100px'); $('.picturediv img').animate({marginLeft: "0"}, 100); }
answers question: http://stackoverflow.com/q/28609749
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45526015

http://stackoverflow.com/a/28614146
type: Answer
has body: I mocked this up, it uses JQuery's each() function to iterate through the pages and return the information of the page that has breached the top of the box. I wasn't sure from your question exactly what you wanted returned, so I got it to return either the percentage of the page that has cleared the top border, the position (as negative value of pixels) of the top of the "page " in relation to the content container, and also just the ID of that div. var getCurrentPage = function(){ var page; var position; var percentageRead; $('.content').each(function(){ if($(this).position().top &lt;= 0){ page = $(this); position = $(this).position().top; } }); percentageRead = ((position *-1)/ $(page).height()* 100); console.log(page.attr('id')); console.log(position); console.log(percentageRead + '%'); } $('#pageContent').on('scroll', getCurrentPage); You could fire this on any event but I used scroll to build it.
score: 0
answers question: http://stackoverflow.com/q/28613343

http://stackoverflow.com/q/28628874
type: UnansweredQuestion
tagged with: php
linked to: http://stackoverflow.com/q/1884724
type: Question
has comment: http://stackoverflow.com/comment/45558004
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
answer count: 2
has body: In my web site timeline, I want to just append new update after a time interval like facebook timeline. So I read about many article about comet, long poll, web socket etc here and many where in web. But I can understand how to implement any script to append new update only without refresh page or any div. I have not enough knowledge about jQuery, Javascript. But I already solved many more problem with Stackoverflow's help. So please help me to do it as a newbie. You can also say me to give some working example that not work. But I cannot understand how and what to do. Here I give my timeline and wall related all script. My comment.php function getComments($userwallid){ $results = mysqli_query($dbh,"SELECT * FROM comments_lite WHERE qazi_id='$userwallid' ORDER BY id DESC LIMIT 20") or die(mysqli_error($dbh)); echo ' '; while($rows = mysqli_fetch_assoc($results)) { $id = $rows['id']; $uesrpage_id = $rows['userpage_id']; $likes = $rows['likes']; $username = $rows['username']; $description = $rows['description']; $date = $rows['date']; // etc all.. echo' '; if ($url=="") { echo' '.$username.' Says: '; } else echo' '.$username.' Says: '; echo''.$date.' '; if ($description=="") {echo '';} else echo''.nl2br(smileys($description)).' '; if ($img=="") {echo '';} else echo' '; echo ' '; //delete button //Likes button echo' '; //Reply script goes here... echo 'same as aove'; } Timeline page <?php include_once('comment.php'); getComments("$uesrid"); ?>
has answer: http://stackoverflow.com/a/28629111
has answer: http://stackoverflow.com/a/28629130
has comment: http://stackoverflow.com/comment/45557992
has title: How to append new update after a time interval

http://stackoverflow.com/comment/45678782
has text: It looks like `window` can be replaced with `null` too(!)
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28693823
score: 2

http://stackoverflow.com/a/28618219
downvote count: 0
has comment: http://stackoverflow.com/comment/45540638
has comment: http://stackoverflow.com/comment/45539915
score: 3
answers question: http://stackoverflow.com/q/28617990
upvote count: 3
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28617990
has body: You can do a self invoking anonymous function and pass the parameters that you want to retain after the method is called like this: (function(asyncTasksArr, index, zipResults, jobVersion){ return function(){ asyncTasksArr.push(Scraper.batchOne(zipResults['zip_codes'][index], jobVersion)); } }(asyncTasks, i, zip_results, job_version)); Hope this helps.
type: Answer
has comment: http://stackoverflow.com/comment/45539773

http://stackoverflow.com/comment/45601546
comment on: http://stackoverflow.com/a/28651991
score: 0
type: Comment
has text: OK, that's bad. It does not work for me on Chrome 40.0.2214.115, it does on Firefox 35. Windows platform. Any idea?
type: AnswerComment

http://stackoverflow.com/comment/45525406
comment on: http://stackoverflow.com/a/28610075
has text: Here's the good example with Smooth Auto Scroll http://www.developphp.com/video/JavaScript/Smooth-Auto-Scroll-Tutorial
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/56548030
type: Comment
has text: How about without changing the schema?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28705522

http://stackoverflow.com/a/28734313
downvote count: 0
answers question: http://stackoverflow.com/q/28719565
accepted answer of: http://stackoverflow.com/q/28719565
upvote count: 2
type: AcceptedAnswer
type: Answer
has body: I've managed to solve that using deferred and promise, here is what I did: var getMessages = function findAll() { db.transaction( function(tx) { var sql = "SELECT (nome) as nomes FROM clientes"; tx.executeSql(sql, [], function(tx, results) { var len = results.rows.length, clientes = [], i = 0; for (; i &lt; len; i = i + 1) { clientes[i] = results.rows.item(i).nomes; } log(clientes + ' rowsss found'); deferred.resolve(clientes); } ); },txErrorHandler, function () { } ); return deferred.promise; }; return { showClientes: getMessages }; The Controller: .controller('ListaCtrl', function ($scope, dbFactory) { dbFactory.showClientes().then(function(listview) { $scope.clientes = listview; console.log($scope.clientes); }); }); And the html: &lt;ion-view view-title="Playlists" ng-app="starter"&gt; &lt;ion-content&gt; &lt;ion-list&gt; &lt;ion-item ng-repeat="cliente in clientes"&gt; {{cliente}} &lt;/ion-item&gt; &lt;/ion-list&gt; &lt;/ion-content&gt; &lt;/ion-view&gt; Now I can see my listview with all my clients.
score: 2

http://stackoverflow.com/q/28740995
has answer: http://stackoverflow.com/a/28741451
score: 0
has comment: http://stackoverflow.com/comment/45765827
type: Question
tagged with: javascript
tagged with: forms
answer count: 1
has title: Validating form using HTML and JavaScript - Checking form input matches a value in an array
has body: I have a simple web form which accepts a user email and password for log in. I want to check the users email and password match up with what is stored in an external javascript file and if the combination matches then proceed to the index.html page. My array is declared in my router file as follows: var USERS = { users: [] }; function User(type, useremail, password) { this.type = type; this.useremail = useremail; this.password = password; } var Bob = new User("rep", "bob@bob.com", "qwerty"); USERS.users.push(Bob); var Helen = new User("rep", "helen@helen.com", "test"); USERS.users.push(Helen); var Dominic = new User("customer", "dom@dom.com", "1234"); USERS.users.push(Dominic); var James = new User("grower", "james@james.com", "pass1"); USERS.users.push(James); My html form is as follows: &lt;div id="loginform"&gt; &lt;form id ="login" name="login" method="post" accept-charset="utf-8" onsubmit="return verify();"&gt; &lt;h1&gt;&amp;nbsp;&lt;/h1&gt; &lt;label&gt; &lt;span&gt;Email Address:&lt;/span&gt; &lt;input id="email" type="email" name="email" placeholder="Enter a valid email address" required /&gt; &lt;/label&gt; &lt;br&gt; &lt;label&gt; &lt;span&gt;Password:&lt;/span&gt; &lt;input id="password" type="password" name="password" placeholder="Password" required /&gt; &lt;/label&gt; &lt;br&gt; &lt;br&gt; &lt;label id="reset"&gt;&lt;a href="#"&gt;Click here to reset your password&lt;/a&gt; &lt;/label&gt; &lt;br&gt; &lt;label&gt; &lt;span&gt;&amp;nbsp;&lt;/span&gt; &lt;input id="submit_button" type="submit" value="Login" /&gt; &lt;/label&gt; &lt;!-- &lt;input type="submit" value="Login" onsubmit = "verify()"&gt; --&gt;&lt;!-- &lt;input type="submit" name="submit" value="Send"&gt; --&gt; &lt;/form&gt; &lt;!-- End of log in form --&gt; &lt;/div&gt; My attempt at checking if the user email and password combo match: function verify() { validUser = false; for (var x in USERS.users){ //console.log(USERS.users[x].userid); if (query.useremail === USERS.users[x].useremail &amp…
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28684796
has comment: http://stackoverflow.com/comment/45662836
type: Question
linked to: http://stackoverflow.com/q/19181515
linked to: http://stackoverflow.com/q/19183752
has body: I found this code on http://games.usvsth3m.com/javascript-under-pressure/ and I reach the 5th problem which requires to estimate the sum of all the integer in the list. The list may contains nested lists. So for a list [1,2,3,4,5] or [[1,2,3],4,5] the code below works but for a list [[[[[1]]]],2,3,4] does not. I try a lot of hours and I do not know to solve it. I need a hit plz. function arraySum(i) { var sum =0; for (var id =0; id&lt;i.length;id++){ if(typeof i[id]==='object'){ var ar = i[id]; for (var dd =0; dd&lt;ar.length;dd++ ){ if(typeof ar[dd]==='number'){ sum+=parseInt(ar[dd]); } } } else if(typeof i[id]==='number'){ sum+=parseInt(i[id]); } } return sum; }
tagged with: javascript
has answer: http://stackoverflow.com/a/28684929
duplicate of: http://stackoverflow.com/q/19183752
score: 0
has comment: http://stackoverflow.com/comment/45663399
answer count: 1
type: UnansweredQuestion
has title: calculate the sum of a list of lists
has comment: http://stackoverflow.com/comment/45663310
tagged with: list
tagged with: nested-lists

http://stackoverflow.com/q/28682899
has comment: http://stackoverflow.com/comment/45658714
tagged with: javascript
has answer: http://stackoverflow.com/a/28683753
answer count: 1
downvote count: 0
has title: Use Directive two times in one controller AngularJS
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has body: I want to use same directives multiple times in one controller in AngularJS. I want to create a list widget that can be used multiple times. I can display two widgets at the same time under the same controller. But, I am unable to bind teamA and teamB data to ng-repeat in my directive. In addition to that, the code fails during addTeamMember() because datasource is undefined. I was hoping that datasource will be updated with teamA and teamB respectively. Here is the HTML code. Controller.js: angular.module('app',[]) .controller('myCtrl', [ '$scope', function($scope){ $scope.teamA = {}; $scope.teamB = {}; } ] ); Directive.js: angular.module('app', [] ) .directive('myDirective', function(){ return{ restrict: 'AE', templateUrl: 'directive_html.html', scope: { datasource: "=TeamMembers" }, transclude: true, link: function(scope, elem, attrs){ scope.addTeamMember = function(){ scope.datasource.push({}); }; scope.removeTeamMember = function(item){ scope.datasource.splice(item, 1); }; } }; }) ; directive_html.html: Remove Add Could anyone please help me out here? I want to create custom Widgets that can be used multiple places either in same controllers or in different controllers. Thanks
score: 1
has comment: http://stackoverflow.com/comment/45660942
upvote count: 1
type: Question
tagged with: angularjs-directive

http://stackoverflow.com/q/28618015
has answer: http://stackoverflow.com/a/35012109
tagged with: firebug
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has title: How can I find out which methods are called in Javascript when debugging without knowing the methods beforehand?
has answer: http://stackoverflow.com/a/28618361
tagged with: events
has comment: http://stackoverflow.com/comment/45539359
has comment: http://stackoverflow.com/comment/45538998
score: 1
has comment: http://stackoverflow.com/comment/45540496
upvote count: 1
has body: For example, I want to debug a third party library. It has a plethora of functions within it and I have no idea where to start. Is there a quick way to find out which functions are being fired without prior knowledge of the code base and thus not knowing where to put the break points?
type: Question
tagged with: debugging
has comment: http://stackoverflow.com/comment/57750304
tagged with: google-chrome-devtools
tagged with: javascript
has comment: http://stackoverflow.com/comment/45540130
has comment: http://stackoverflow.com/comment/45539721
answer count: 2

http://stackoverflow.com/q/28616325
answer count: 2
has body: I want to make it so that the header row is not editable. I have managed to make it read only which means when they left click the cell they cannot edit it. However, they can right click the cell and choose remove row or column. One way to do this is perhaps, intercept the bit where they remove the row or column and then check if that cell is readOnly or not. But how can I do this with Handsontables?
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has answer: http://stackoverflow.com/a/28616555
type: Question
has title: How can I stop users removing cells in the header row in handsontable?
has answer: http://stackoverflow.com/a/28772924
tagged with: handsontable
score: 0

http://stackoverflow.com/a/28748857
accepted answer of: http://stackoverflow.com/q/28748714
has body: str was never defined replace by your text : $(el).text('name', text.replace(currentIdx, i)); http://jsfiddle.net/5nykq0e6/1/
type: AcceptedAnswer
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28748714

http://stackoverflow.com/comment/45552037
type: Comment
comment on: http://stackoverflow.com/a/28620156
has text: Thanks for your reply gibberish. What i'm trying to do is better illustrated on this website - http://www.hugeinc.com/ . When you click the menu icon the first time it brings the nav in from the top (upon inspecting the code on the click it adds a class called open to nav) and then when you click the same icon again it removes the class open and adds a class called closing, then removes that class once the animation is finished. The process of adding two separate classes consecutively from the same button is what i'm after.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47770687
has text: @JME.. i want Keystone routes `(i.e. /keystone/*)` , to have my own authentication middleware..
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28685092

http://stackoverflow.com/comment/45583249
type: Comment
has text: Your object in anonymous. Normally you would refer to `window` or some other object you attach your properties to.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28642280

http://stackoverflow.com/q/28750222
tagged with: photobucket
downvote count: 1
has comment: http://stackoverflow.com/comment/45782990
has title: Javascript, uncaught reference error: function() not defined
has body: Well, I can't seem to figure out why my function is not defined on click, or onload. I've ran it through firebug, and can't see any syntax errors. Any help would be appreciated. Fiddle: http://jsfiddle.net/170a71mj/1/ The code in question: function getAlbums(user, album) { var url = "http://api.photobucket.com/album/"; url = url + encodeURIComponent( user + "/" + album ) var json = callPhotobucket( url, "format=json" ); } function getTag(media) { var url = "http://api.photobucket.com/media/"; url = url + encodeURIComponent(media) + "/tag" ; var json = callPhotobucket(url, "format=json"); } function getTimestamp() { var timestamp = new Date().valueOf(); timestamp = timestamp / 1000; timestamp = Math.ceil( timestamp ); return timestamp; } function ping() { auth_url = callPhotobucket( "http://api.photobucket.com/ping", "format=json" ); } function callPhotobucket( url, format ) { try { if( url == undefined ) { url = "http://api.photobucket.com/ping"; } if( format == undefined ) { format = "format=json"; } var timestamp = getTimestamp(); auth_nonce="nonce" + timestamp; auth_method = "HMAC-SHA1"; auth_timestamp = "" + timestamp; auth_version="1.0"; auth_consumer = "&amp;oauth_consumer_key="+ encodeURIComponent( consumer_key ); nonce = "&amp;oauth_nonce="+ encodeURIComponent( auth_nonce ); auth_sig_method = "&amp;oauth_signature_method="+ encodeURIComponent( auth_method ); auth_timestamp = "&amp;oauth_timestamp="+ encodeURIComponent( auth_timestamp ); version = "&amp;oauth_version=" + encodeURIComponent( auth_version ); paramstring = format + auth_consumer + nonce + auth_sig_method + auth_timestamp + version; method = "GET"; base = encodeURIComponent( method ) + "&amp;" + encodeURIComponent( url ) + "&amp;" + encodeURIComponent( paramstring ); sig_hash = getSignature( consumer_secret+"&amp;", base ); auth_sign = "&amp;oauth_signature=" + sig_hash; auth_url = url + "?" + paramstring + "&amp;" + auth_sign; myalert( ""+ auth_url+""); return auth_url; } catch (err) { alert( "E…
tagged with: twitter
type: Question
tagged with: api
upvote count: 0
answer count: 1
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/28753239
tagged with: rest
favorite count: 0
has comment: http://stackoverflow.com/comment/45782793
has comment: http://stackoverflow.com/comment/45782541
type: UnansweredQuestion

http://stackoverflow.com/comment/45665172
has text: You have the right idea, but I was hoping there was a tool out there like JSON.Net; only in reverse. Instead of converting .Net objects to JSON, I was hoping there was a tool to convert JSON to .Net objects within javascript. As I said before, it works fine if I just create 1 .Net class and combine all the properties of the child classes into that one .Net class. So, unless there's a tool that can do what I said, I'm sticking to what I just mentioned.
score: 0
comment on: http://stackoverflow.com/a/28676025
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28688859
tagged with: ng-view
has body: I have some javascript I need to run after a particular template rendered in ng-view finishes loading. If it's the first page to load this works: $(window).load(function(){}); The code is being executed in a controller for the template so it is outside of the main html file. I have also tried nesting it in a directive under link: so that it won't run until after the directive is loaded, but that doesn't seem to work either. Here is the snippet I need to run: $(window).load(function(){ $('#carousel').flexslider({ animation: "slide", controlNav: false, animationLoop: false, slideshow: false, itemWidth: 210, itemMargin: 5, asNavFor: '#slider' }); $('#slider').flexslider({ animation: "slide", controlNav: false, animationLoop: false, slideshow: false, sync: "#carousel", start: function(slider){ $('body').removeClass('loading'); } }); }); $(window).load(function() { $('.flexslider').flexslider({ animation: "slide" }); });
downvote count: 0
score: 1
type: Question
tagged with: javascript
upvote count: 1
answer count: 1
has title: Run javascript after ng-view loads or directive loads
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/37761107
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/comment/45548606
score: 0
comment on: http://stackoverflow.com/a/28623547
type: Comment
has text: I has been setting here for hour to find a solution, and you come here with a simple line. Please, let me ask you something very important. How do I know which methods use with `controlgroup()`, because I have seek for all jquery docs with not positive results.
type: AnswerComment

http://stackoverflow.com/a/28677952
has body: The redirect happens at the end of processing everything inside the set of 'script' tags. This way the DOM can put everything within that script tag into memory when processing the individual operations. If you had processing in a secondary set of script tags, those instructions would be ignored.
type: Answer
has comment: http://stackoverflow.com/comment/46242083
has comment: http://stackoverflow.com/comment/47266999
answers question: http://stackoverflow.com/q/28677866
score: 0
has comment: http://stackoverflow.com/comment/47211493

http://stackoverflow.com/a/28594604
has body: Your REST server needs to support CORS requests in order to respond to client-generated requests. Which framework is your server built with?
has comment: http://stackoverflow.com/comment/45496003
answers question: http://stackoverflow.com/q/28593710
score: 0
type: Answer

http://stackoverflow.com/comment/45699396
type: QuestionComment
score: 1
has text: I don't think IE supports `importNode`, even though it is there. I get `No such interface supported` in IE 11, also http://stackoverflow.com/questions/1811116/ie-support-for-dom-importnode
comment on: http://stackoverflow.com/q/28704520
type: Comment

http://stackoverflow.com/a/28656445
has body: var response = data; var listOfTimes = new Array(); for(i = 0; i &lt; 2; i++){ //number of rows... listOfTimes[i]=response[i]; for(j = 0; j&lt; 8; j++){ //number of columns listOfTimes[i]=repsonse[i][j]; } }
has comment: http://stackoverflow.com/comment/45609309
type: Answer
answers question: http://stackoverflow.com/q/28656404
score: 0

http://stackoverflow.com/a/28669382
accepted answer of: http://stackoverflow.com/q/28666676
type: Answer
answers question: http://stackoverflow.com/q/28666676
score: 2
upvote count: 2
has body: Look here again. Add appropriate code to your web.config (1GB for example): &lt;system.webServer&gt; &lt;security&gt; &lt;requestFiltering&gt; &lt;requestLimits maxAllowedContentLength="1073741824" /&gt; &lt;/requestFiltering&gt; &lt;/security&gt; &lt;/system.webServer&gt; &lt;configuration&gt; &lt;system.web&gt; &lt;httpRuntime maxRequestLength="1048576" /&gt; &lt;/system.web&gt; &lt;/configuration&gt; Now it should allow uploading files up to 1GB and you can check the size on server side: public ActionResult Foo(HttpPostedFileBase file) { .... if(file.ContentLength &gt; 536870912) //512MB .... .... }
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28629789
answer count: 2
has answer: http://stackoverflow.com/a/28630946
tagged with: jquery
has answer: http://stackoverflow.com/a/28629890
tagged with: angularjs
type: UnansweredQuestion
has title: ng-if unexpected behaviour
tagged with: http://stackoverflow.com/tag/html
has body: I have following line in my jsp 1"> and Js file is as follows $scope.initiateEvent = function(issuerId) { $scope.show=false; myService.setIssuerId(issuerId); $scope.show=true; }; moreThanOone.html is as follows Please review your plan selection and click "Apply" to start your application. Plan Name Premium {{x.planName}} {{x.amount}} Make Event Because my morethanOne.html has a ng-repeat and onclick of button or a link it should go and fetch data and render one.html therefore I am making show as false then setting issuer id and making it true again So expected behaviour is that onclick of button it should hide the ng-if div then after that it should make it visible again
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45560055

http://stackoverflow.com/a/28739369
downvote count: 0
type: Answer
score: 1
answers question: http://stackoverflow.com/q/28739222
has body: You could copy your array, and remove the generated value when you pick it. So next time you randomly pick an element, you're unable to pick the same one again. This requires your array to consist only of unique elements (no duplicates).
upvote count: 1

http://stackoverflow.com/q/28693746
tagged with: jquery
has comment: http://stackoverflow.com/comment/45685955
has comment: http://stackoverflow.com/comment/45686542
has comment: http://stackoverflow.com/comment/45695262
tagged with: google-chrome-extension
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/45696428
has comment: http://stackoverflow.com/comment/45736582
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45736229
duplicate of: http://stackoverflow.com/q/12089752
has comment: http://stackoverflow.com/comment/45695407
upvote count: 1
has comment: http://stackoverflow.com/comment/45734998
has body: I am building a chrome extension, in which i needed to fetch and parse some html from a web page. Decided to use jquery for that. $(htmlString).find(".some-table"); The problem is i am getting following warning when running this code. Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'self' chrome-extension-resource:". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution. It seems "htmlString" contains some inline event handlers and while parsing it, chrome is throwing this warning. I cannot control what is inside "htmlString", just needed to retrieve some information out of it. Is there any better way to do this?
linked to: http://stackoverflow.com/q/12089752
score: 1
has title: Parse HTML which has inline event handler
has comment: http://stackoverflow.com/comment/45736506
type: Question
tagged with: jquery-selectors
downvote count: 0
has answer: http://stackoverflow.com/a/28719309
tagged with: javascript
has comment: http://stackoverflow.com/comment/45736000

http://stackoverflow.com/comment/45813183
has text: @message, otherwise you'd have a difference setTimeout for each store's change event, and they'd all be sent out after each other, possibly causing the some components to have outdated data and even errors that should be impossible. The #1 important thing in optimizing is that you don't break anything following best practices (#2 is not breaking anything, but that's allowed sometimes).
score: 0
comment on: http://stackoverflow.com/a/28740608
type: Comment
type: AnswerComment

http://stackoverflow.com/q/28627860
linked to: http://stackoverflow.com/q/10070464
has comment: http://stackoverflow.com/comment/45556620
has comment: http://stackoverflow.com/comment/45556509
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45556256
type: Question
has comment: http://stackoverflow.com/comment/45556543
tagged with: function
tagged with: javascript
tagged with: jquery
has title: Onclick element simulate Esc key
has comment: http://stackoverflow.com/comment/45556678
score: 0
has answer: http://stackoverflow.com/a/28628097
has body: I have the following situation: When the user clicks on a link, through Javascript Esc key should be triggered. So to be able to explain it better I have the following code so far: 1.I've created a function: //my function function invokeEscKey() { var ev = document.createEvent('KeyboardEvent'); ev.initKeyEvent( 'keydown', true, true, window, false, false, false, false, 27, 0); document.body.dispatchEvent(ev); } also tried this with jQuery: //my function function invokeEscKey() { jQuery.event.trigger({ type : 'keypress', which : 27 }); } 2.And when the user clicks on the href, the function should be called: $(function() { $('a.close').click(function() { //call this function to simulate ESC key press invokeEscKey(); }); }); But this doesn't work at all. My question is, what is the best way to solve this? Note: The reason I ask this is because I have a popup with the F11 key (full screen mode) is activated. When the user clicks on the close button, the F11 must be undone, which is normally done by pressing on the ESC key. And I want this to be done automatically.
has comment: http://stackoverflow.com/comment/45556171
tagged with: esc-key
answer count: 1

http://stackoverflow.com/q/28663068
has comment: http://stackoverflow.com/comment/45621179
score: 0
has title: How to append tds into tableRows?
accepted answer: http://stackoverflow.com/a/28663263
linked to: http://stackoverflow.com/q/28572307
has body: I'm trying to append different -elements to corresponding tr-elements, but no matter, what I am trying: it does not work :-/ Unfortunately I'm not able to show you an complete jsfiddle, because the whole table stuff is rather complex and depends on a map and stuff like that, but I hope some code snippets are also okay. Table-Structure (header) var table = createElement('table'); table.className = "table"; table.id = "table"; var header = table.createTHead(); var row = header.insertRow(0); var cell0 = row.insertCell(0); cell0.innerHTML = "Indicator" var cell1 = row.insertCell(1); cell1.innerHTML = "Current value" var cell2 = row.insertCell(2); cell2.innerHTML = "High value" var cell3 = row.insertCell(3); cell3.innerHTML = "Low value" var cell4 = row.insertCell(4); cell4.innerHTML = "Average"; var cell5 = row.insertCell(5); cell5.innerHTML = "Pic"; tbody = table.appendChild(document.createElement('tbody')); Then I'm using a for-loop, where the rest of the table is created: //"key" is the description of the "value" for (var key in values) { //... //method to calculate the values ... //append values to tbody $(table).find(tbody).append(" "); $(table).find(tbody).append( " "+(indicatorValue)); $(table).find(tbody).append( " "+(regionValue)); $(table).find(tbody).append( " "+(bestValues)); $(table).find(tbody).append( " "+(worstValues)); $(table).find(tbody).append( " "+(average)); //append image to a td-element var img = " "; if (picIdentifier != 'green') { img = " "; } $(table).find(tbody).append( " "+ img +" "); } Using the above code, the table looks like the following jsfiddle: http://jsfiddle.net/nwd6na53/2/ As you can see, the td-elements in the tbody are not wrapped in the tr-element, but the table-rows are empty. Do you have any tip how to put the tds into the tr-elements? Any help is much appreciated!
tagged with: javascript
has comment: http://stackoverflow.com/comment/45621464
type: AnsweredQuestion
tagged with: jquery
has comment: http://stackoverflow.com/comment/45621225
possible better answer: http://stackoverflow.com/a/28663482
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28663263
has answer: http://stackoverflow.com/a/28663482

http://stackoverflow.com/comment/45633290
has text: Have a look at [io.js](https://iojs.org) :)
comment on: http://stackoverflow.com/q/28669114
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28680381
tagged with: video
answer count: 0
has comment: http://stackoverflow.com/comment/45654081
type: Question
has body: I saw this link http://dev.w3.org/2009/dap/camera/ and I can upload video on my smartphone. But I need to show the video just after the user record. It's exactly like the example 6 but with video, not image. The project it's allow the user to record one or more video and use a framework like popcorn.js with own video, not youtube or other. And the all without internet, in local webapp... I'm a little lost ^^ Thank you !
has comment: http://stackoverflow.com/comment/45676127
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: smartphone
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45772418
tagged with: web-applications
has title: HTML Media Capture and video

http://stackoverflow.com/q/28686331
has title: Angularjs and Jquery datepicker data-binding
tagged with: jquery-ui
tagged with: javascript
answer count: 2
has body: I was making a project with a datepicker(JQuery) . When i click the date in the datepicker it never shows the date unless space or enter is typed. I want it that when I click the date, the date clicked is showed. I expect the output to be automatically show the date when clicking the date in datepicker. But I have to press spacebar first before it generates/ show the date .. Please help .. These are my codes : $(document).ready(function () { $("#datepickerfrom").datepicker({ numberOfMonths: 1, onSelect: function (selected) { $("#datepickerto").datepicker("option", selected) } }); $("#datepickerto").datepicker({ numberOfMonths: 1, onSelect: function (selected) { $("#datepickerfrom").datepicker("option", selected) } }); // jQuery object; this demo }); function GetbyDate(fr, t) { var from = new Date(t) }; scope.changeDate = function () { scope.models = null; http.get('GetReportList?from=' + scope.filter_fromDate + '&to=' + scope.filter_toDate).success( function (data) { scope.models = data; }); } {{filter_fromDate}} {{filter_toDate}}
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28686505
has answer: http://stackoverflow.com/a/28686738
tagged with: datepicker
possible better answer: http://stackoverflow.com/a/28686505
score: 2
upvote count: 2
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28686738

http://stackoverflow.com/a/28654842
has comment: http://stackoverflow.com/comment/45607255
has comment: http://stackoverflow.com/comment/45607156
type: Answer
has comment: http://stackoverflow.com/comment/45606720
has comment: http://stackoverflow.com/comment/45607218
accepted answer of: http://stackoverflow.com/q/28654815
has comment: http://stackoverflow.com/comment/45607175
answers question: http://stackoverflow.com/q/28654815
has comment: http://stackoverflow.com/comment/45606741
has comment: http://stackoverflow.com/comment/45606950
has comment: http://stackoverflow.com/comment/45606945
has comment: http://stackoverflow.com/comment/45606926
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45607088
has body: If they are of same length then it is possible in a single loop. var arr = $("[name='multiple[]']"); var arr2 = $("[name='multiple[]Phone']"); $.each(arr, function (i, item) { PageMethods.InsertContacts(arr[i].val(),arr2[i].val(),"M0011", getValues_Success, getValues_Fail); }); If they are of different lengths then use two loops $.each([arr, arr2], function() { $.each(this, function(i, v) { // do something }); });

http://stackoverflow.com/q/28624763
tagged with: dom
has answer: http://stackoverflow.com/a/49684109
has answer: http://stackoverflow.com/a/78138720
tagged with: reactjs
score: 112
has answer: http://stackoverflow.com/a/47894683
upvote count: 112
downvote count: 0
has title: Retrieving value from with multiple option in React
favorite count: 0
answer count: 12
has body: The React way to set which option is selected for a select box, is to set a special value prop on the itself, corresponding to the value attribute on the element you desire to be selected. For a multiple select this prop can accept an array instead. Now because this is a special attribute, I'm wondering what the canonical way is to retrieve the selected options in the same array-of-option-values-structure when the user changes things (so I can pass it through a callback to a parent component etc), since presumably the same value property won't be available on the DOM element. To use an example, with a text field you would do something like this (JSX): var TextComponent = React.createClass({ handleChange: function(e) { var newText = e.target.value; this.props.someCallbackFromParent(newText); }, render: function() { return ; } }); What is the equivalent to replace ??? for this multiple select component? var MultiSelectComponent = React.createClass({ handleChange: function(e) { var newArrayOfSelectedOptionValues = ???; this.props.someCallbackFromParent(newArrayOfSelectedOptionValues); }, render: function() { return ( First option Second option Third option ); } });
accepted answer: http://stackoverflow.com/a/49684109
has answer: http://stackoverflow.com/a/71443220
has answer: http://stackoverflow.com/a/36431131
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28625477
has answer: http://stackoverflow.com/a/32098857
has answer: http://stackoverflow.com/a/73347933
has answer: http://stackoverflow.com/a/28625477
has answer: http://stackoverflow.com/a/44257483
type: Question
has answer: http://stackoverflow.com/a/55065643
has answer: http://stackoverflow.com/a/49493454
has answer: http://stackoverflow.com/a/33184997
tagged with: javascript

redactor.js
tag name: redactor.js
tags question: http://stackoverflow.com/q/28721043
type: Tag

http://stackoverflow.com/q/28672794
has answer: http://stackoverflow.com/a/28672874
has comment: http://stackoverflow.com/comment/45639029
has answer: http://stackoverflow.com/a/28672927
favorite count: 0
answer count: 5
type: UnansweredQuestion
score: 3
has answer: http://stackoverflow.com/a/28672845
has answer: http://stackoverflow.com/a/28672852
upvote count: 3
type: Question
has body: Can someone explain why my ajax function fires without call or clicking? &lt;script&gt; $('#mudaSESSION'){ $.ajax({ type: "POST", url: "procura.php", data: { &lt;?php echo $_SESSION['pagina'] = $_SESSION['pagina'] + 1; header("refresh: 3;");?&gt;}, } }); } &lt;/script&gt; Any tips or help would be welcome, Thank you. =)
has answer: http://stackoverflow.com/a/28672919
downvote count: 0
has comment: http://stackoverflow.com/comment/45639046
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/45639267
has title: Ajax - Function fires without call or clicking
has comment: http://stackoverflow.com/comment/45639080

http://stackoverflow.com/comment/45593205
type: AnswerComment
type: Comment
has text: Basically anywehere in the same HTML file document. So for example in tag. Just write the hex code. Nothing more, nothing less. :-)
comment on: http://stackoverflow.com/a/28647567
score: 0

android-webview
tags question: http://stackoverflow.com/q/28609389
type: Tag
tags question: http://stackoverflow.com/q/28667151
tag name: android-webview

http://stackoverflow.com/q/28676373
type: Question
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45646029
has body: This is my current code: TABLES Tables will be listed here... << >> TABLE(S) TO SYNC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . How can I transfer a selected table from the left dropdownlist to the right, or vice versa?
tagged with: javascript
type: UnansweredQuestion
has title: How can I transfer the selected table from a list of database tables inside form to another form
has answer: http://stackoverflow.com/a/28677315
has comment: http://stackoverflow.com/comment/45646030

http://stackoverflow.com/comment/45555173
comment on: http://stackoverflow.com/q/28624950
type: Comment
has text: because I don't know the URL, that is embedded in the HTML page
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45748786
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28731136
has text: its codility, a site which tests job applicants to see if they can code! They also have some interesting lessons - this one is a basic one from [lesson 2](https://codility.com/programmers/lessons/2)
score: 0

http://stackoverflow.com/a/28636890
type: Answer
score: 2
has body: Just removed the :form, I can't see why is it necessary. Also, Thanks to Razib, except from the :form part which is unnecessary, you forgot to set the method to POST, so you can add it in the javascript part, or in the HTML. I did in both as you can see. You can use only one of them. function apprvRqstSbmt(){ $("#formToSubmit").attr("method","POST"); //Razib solution $("#formToSubmit").attr("action","/some/url/to/submit"); $("#formToSubmit").submit(); } function disApprvRqstSbmt(){ $("#formToSubmit").attr("method","POST"); //Razib solution $("#formToSubmit").attr("action","/some/url/to/submit"); $("#formToSubmit").submit(); } Your Comments: (Required if you do not review the samples) <form:textarea id="newCommentsTextAreaId" path="newComments" rows="5" cols="50" /> JSFiddle: http://jsfiddle.net/6fp1ukzL/
downvote count: 0
answers question: http://stackoverflow.com/q/28636843
upvote count: 2

http://stackoverflow.com/comment/45611115
type: Comment
type: QuestionComment
has text: I still don't really understand the problem. Do you want the height of a section to be at least the same height than the viewport, but be still big enough to fit all the content? In that case, don't use JS, it can be done by CSS: `section {min-height: 100vh; }` - but this does not work in mobile Safari in iOS 7 (and 6?) because of the vh-unit. There are workarounds, however - for example, you could just change the min-height of sections with JS whenever the window resizes.
comment on: http://stackoverflow.com/q/28657264
score: 0

http://stackoverflow.com/q/28732438
has comment: http://stackoverflow.com/comment/45750983
has comment: http://stackoverflow.com/comment/45751022
accepted answer: http://stackoverflow.com/a/28732606
answer count: 3
score: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45750808
favorite count: 0
has answer: http://stackoverflow.com/a/28732642
has comment: http://stackoverflow.com/comment/45750970
has answer: http://stackoverflow.com/a/28857591
has title: add up values from siblings using jQuery
has body: Hi Guys I have been working on this script for some time and I just cant make it work well I may be missing an important argument to get it to work properly.. I need to calculate the values from inside of a tag and add up the total to a heres the HTML: Ford £19.99 Ferrary £19.99 £0.00 £0.00 And here is my Script: $('.catProdAttributeItem img').on("click", function() { $(this).siblings('input[type=radio]').attr('checked', true); var original_price = $('.original_price').text().replace(/[^0-9\.]/g, ''); parseFloat(this.original_price); var warehouse_price = $(this).siblings('.catProdAttributeItem span').text().replace(/[^0-9\.]/g, ''); warehouse_price = parseFloat(warehouse_price); var total_price = parseFloat(original_price) + parseFloat(warehouse_price); $('.updated_price').html('£' + total_price.toFixed(2)); }) I can only get the result of the clicked siblings, please some help is much appreciated.. I was expecting to add up the values displayed on the .updated_price when the input is selected but it will work on a wider set of inputs where you can check more inputs and you would get the result from all the inputs checked DEMO FIDDLE
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28732642
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45750984
has answer: http://stackoverflow.com/a/28732606
upvote count: 2
has comment: http://stackoverflow.com/comment/45750980
has comment: http://stackoverflow.com/comment/45750795
type: Question
has comment: http://stackoverflow.com/comment/45750781
has comment: http://stackoverflow.com/comment/45751000

http://stackoverflow.com/comment/45690251
has text: Did you include the power permission in manifest.json?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28699971
score: 1

http://stackoverflow.com/comment/45767040
type: QuestionComment
has text: didn't know there was an actual code review section. sorry!
comment on: http://stackoverflow.com/q/28706520
score: 0
type: Comment

http://stackoverflow.com/q/28609259
upvote count: 1
duplicate of: http://stackoverflow.com/q/203198
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/203198
has body: Hi folks I've a situation here I've a page to order food it works fine add to shopping cart successfully but with one issue its delete item button click event dose not perform as it should. It work fine as i load the page, i mean if i refresh page using F5. If another item is added in the basket and then press the delete button it show # sign in the url an go to the top of the page. where as it should print to console 'remove item' here is the PHP code when I load the page $total = 0; $index = 0; if(isset($_SESSION['order_array'])){ foreach ($_SESSION['order_array'] as $value) { echo ' '; echo ' '; echo ' ' . $value['product_name'] . ' '; echo ' ' . $value['price'] . ' '; echo ' '; $total = (float) $total + $value['price']; $index++; } } When user adds another item which is done by jQuery post... $('.addbasketCLS').click(function(event){ var itemID = $(this).attr('id'), output = "", cart_total = 0; $.post("addtobasket_json.php", { product : itemID }, function(data){ $("#cart_result").empty(); $(data).each(function(index,item) { output = setCartContent(index, item); cart_total += +item.price; $("#cart_result").append(output); }); $("#cart_total").empty(); $("#cart_total").html(cart_total.toFixed(2)); }); return false; }); setCartContent() method below function setCartContent(index, data){ return ' ' + ' ' + ' ' + data.product_name + ' ' + ' ' + data.price + ' ' + ' '; } click event for rermoveItem $('.removeItemCLS').click(function(event){ console.log('remove Item : '); return false; }); it works fine if do not any more item after refreshing the page... if i add an item i'll have to refresh the page to get this working. Any Idea where I'm going wrong Regards
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has title: jquery click event does not fire
answer count: 0
score: 1

http://stackoverflow.com/q/28713510
tagged with: http://stackoverflow.com/tag/html
has title: How to check condition on time
has comment: http://stackoverflow.com/comment/45715145
favorite count: 0
has comment: http://stackoverflow.com/comment/45715366
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28713732
score: 2
downvote count: 0
has answer: http://stackoverflow.com/a/28713648
linked to: http://stackoverflow.com/q/15083548
type: Question
answer count: 2
tagged with: javascript
upvote count: 2
has body: Hi i want to put condition on time that only time between 9:00 AM to 5:00 PM has to access. here is my javascript code for it. var time = document.getElementsByName('s_time')[0].value; if user enter tie before 9:00 AM or after 5:00 PM it should give alert. Please help me User enterd time by using jquery picker.

http://stackoverflow.com/q/28733325
type: Question
has body: I'm not at my first express.js application, although I have still to figure out the most robust way to handle errors. Since io.js is reality from a couple months I'm using native Promises to help myself with asyncronicity, the following code reflects that. My error-handling middleware is as following: router.use(function (err, req, res, next) { // in case err.custom is present, means is an "handled" Error, created by developers if (!!err.custom) { return res.status(err.code).json(err.message); } if (err instanceof Error) { console.error(err.stack); return res.status(500).send('Runtime Error'); // should be reported! } // last but not least, validation error res.status(400).send(err); }); An example controller is written like this: function callService1 (param1) { return new Promise(function (resolve, reject) { service.call(param1, function (err, data) { if (!!err) return reject(err); // this is an Error object?? not sure! if (!!data.handledError) { // this is an handled Error to the user, not 500 return reject({ custom: true, status: 403, message: 'service1 tells you that myCoolParam is not valid' }); } resolve(data); }); }; } function callService2 (dataFromParam1) { return new Promise(function (resolve, reject) { // something here }); } // this is the API "controller" module.exports = function (req, res, next) { callService1(req.body.myCoolParam) .then(callService2) .then(function (service2Output) { res.status(200).json({ message: 'everything went smooth!' }); }) .catch(next); // here is the catch-all errors }; As you can see the express middleware looks quite tidy and elegant. I usually handle all the interesting errors to the user in the rejects(), some of them are called with an object where I tell the errorhandling middleware. The problem is service from the example is a 3rd-party library. Those libraries some times returns a string, sometime an object (from an external API), sometimes a javascript Error. Currently I cannot handle custom javascript Objects, mor…
tagged with: javascript
tagged with: robustness
tagged with: express
has answer: http://stackoverflow.com/a/28735413
accepted answer: http://stackoverflow.com/a/28735413
answer count: 1
downvote count: 0
favorite count: 0
upvote count: 2
tagged with: node.js
score: 2
type: AnsweredQuestion
has title: How to correctly handle errors (string OR objects) in express.js using promises
tagged with: error-handling

http://stackoverflow.com/comment/114743783
type: AnswerComment
type: Comment
has text: Does nothing on TinyMCE version 5.
comment on: http://stackoverflow.com/a/33655087
score: 0

http://stackoverflow.com/comment/45703430
has text: Thank you very much. Implemented flawlessly. I was thrown a project with no background in html php or javascript and have been learning the languages on the fly, but again thank you so much!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28706293
type: Comment

http://stackoverflow.com/q/28602012
has answer: http://stackoverflow.com/a/33579641
tagged with: graph-visualization
tagged with: chap-links-library
type: Question
tagged with: javascript
has title: How to filter links dynamically in vis.js
score: 4
upvote count: 4
has body: Is there a way to filter links and nodes in vis.js network? I have set a DataSet for both nodes and edges like so: function drawNetwork(container){ var nodes = new vis.DataSet(); populateNodes(nodes); // code ommited for bravity var edges = new vis.DataSet(); populateEdges(edges); // code ommited for bravity var data = { nodes: nodes, edges: edges }; // create the network var options = {...} var network = new vis.Network(container, data, options); } Thanks.
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/45590919
type: QuestionComment
comment on: http://stackoverflow.com/q/28646574
type: Comment
has text: my console? I dont have a console... Just regular text editor
score: 0

http://stackoverflow.com/comment/45615630
score: 1
comment on: http://stackoverflow.com/q/28660013
has text: I'm guessing the for loop is marginally faster at finding a match, but you still have to replace something, and using a regex is so much simpler for things like this, so that's what I would use, or not really, I'd use EJS instead of inventing the wheel all over again, it does exactly this using a regex.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45605632
comment on: http://stackoverflow.com/a/28651115
type: Comment
has text: Even though I couldn't get this to work fully for my needs, this is the correct way to go about this. I was getting a 95% working solution following your help and perhaps someday I'll try it again. Unfortunately, I just have a lot of other code that plays into this that wasn't playing nicely with these sorts of changes. Thanks for the help!
score: 0
type: AnswerComment

http://stackoverflow.com/q/28640760
has answer: http://stackoverflow.com/a/28640849
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28640849
upvote count: 2
has comment: http://stackoverflow.com/comment/45580601
has comment: http://stackoverflow.com/comment/45581101
has body: Excuse the newbie kind of question, I'm sure what I want to do is easy however I must be wording it right when looking for solutions. Basically I want to set a section in html to the height of the viewport minus the height of the navigation bar and a small slider at the bottom. I understand that this is something I need Javascript for? If anyone could help that would be great. I know I could .container { height: 100%; margin-top: -300px; min-width: 100%; } .slider-wrapper { height: 300px; min-width: 100%; } But it really doesn't give the desired effect as it would cut off the top of the container. Is there some sort of Jquery maths we can do to subtract the height of .slider from the height of .container? Sorry, as asked for in comments, heres some more markup, i've only included the container sections as they're the only ones that at the moment I need to interact with. Here's the html &lt;section class="top-bar"&gt; &lt;/section&gt; &lt;section id="container"&gt; &lt;/section&gt; &lt;section class="slider-wrapper"&gt; &lt;/section&gt; So those are the three containers that make up the actual layout of the screen at the moment. so here's the css I have for the .container as it stands: #container { background: url(../img/cafe-background.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; width: 100%; height: 100%; position: relative; } so I just need to minus the height of the .slider-wrapperunderneath from this container.
has title: How to set height of a container to viewport height minus a 300px in height slider?
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45581037
score: 1
has comment: http://stackoverflow.com/comment/45580748
has answer: http://stackoverflow.com/a/28647056
possible better answer: http://stackoverflow.com/a/28641014
has answer: http://stackoverflow.com/a/28640888
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28641014
favorite count: 0

http://stackoverflow.com/q/28689332
tagged with: jquery
has answer: http://stackoverflow.com/a/28689581
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28691123
upvote count: 6
has answer: http://stackoverflow.com/a/28689485
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28689773
has answer: http://stackoverflow.com/a/67497011
possible better answer: http://stackoverflow.com/a/28689447
type: Question
has title: How can I make many jQuery ajax calls look pretty?
has answer: http://stackoverflow.com/a/28689447
has body: I'm making many ajax call based web service. I attached event listeners every dom elements. And every event handlers request ajax call in it. By the way, my source code getting more dirty and complexity. I want to reduce boilerplate code and look more simple with ajax calls. How can I do that effectively? The sample code looks like this: button1 button2 button3 button4 $('.button1').on('click', function() { $.ajax({ url: '/api/1/resource1', data: { value1: 'value1', value2: 'value2' }, success: function (response) { $('.some_dom1').html(Handlebars.resource({items:response.items})); } }); }); $('.button2').on('click', function() { $.ajax({ url: '/api/1/resource2', data: { value1: 'value1', value2: 'value2' }, success: function (response) { $('.some_dom2').html(Handlebars.resource({items:response.items})); } }); }); $('.button3').on('click', function() { $.ajax({ url: '/api/1/resource3', data: { value1: 'value1', value2: 'value2' }, success: function (response) { $('.some_dom3').html(Handlebars.resource({items:response.items})); } }); }); $('.button4').on('click', function() { $.ajax({ url: '/api/1/resource4', data: { value1: 'value1', value2: 'value2' }, success: function (response) { $('.some_dom4').html(Handlebars.resource({items:response.items})); } }); }); Updated: Every class name and ajax response handler is not same each other. Example code just shows boilerplate code and complexity. This is not the problem of class name or if else statements.
tagged with: javascript
answer count: 6
score: 6
accepted answer: http://stackoverflow.com/a/28689773
downvote count: 0

http://stackoverflow.com/q/28624800
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28651594
has comment: http://stackoverflow.com/comment/45552979
accepted answer: http://stackoverflow.com/a/31526886
has answer: http://stackoverflow.com/a/28960841
type: Question
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28960841
linked to: http://stackoverflow.com/q/28558696
has body: After the latest release of EmberJS v1.9.0 I am trying to move from Handlebars to HTMLbars. What I am finding very challenging is lack of documentation. I am trying to implement very simple helpers. For example take this handlebars helpers: HTML &lt;div id="main"&gt;&lt;/div&gt; &lt;script type="text/x-handlebars" data-template-name="index"&gt; {{logIt test}} &lt;h1&gt;{{test}}&lt;/h1&gt; &lt;/script&gt; JS App = Ember.Application.create({ rootElement: '#main' }); App.IndexRoute = Ember.Route.extend({ setupController: function(controller){ controller.set('test', 'mytest'); } }); Ember.Handlebars.registerHelper("logIt", function(something) { console.log(something); }); Js Fiddle: http://jsfiddle.net/sisir/p463q2L8/ How do I convert it to htmlbars?
tagged with: ember.js
upvote count: 6
has answer: http://stackoverflow.com/a/31526886
answer count: 4
has title: How to write Helpers in HTMLBars?
favorite count: 0
tagged with: handlebarshelper
tagged with: htmlbars
tagged with: handlebars.js
score: 6
has answer: http://stackoverflow.com/a/31734178

http://stackoverflow.com/comment/45664148
has text: Import services with Cu.import('resources://gre/modules/Services.jsm')
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28659769

http://stackoverflow.com/q/28633835
type: Question
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/28634272
score: 0
has title: How to hide the element on textbox blur event and show it again on focus
has body: I am checking username availability. when focus is set on the username textbox the username availability is show onkeyup event using ajax. But when set focus or select other textbox the 'username available' or 'not available' text does not hide it stays there besides username textbox as it is So please advice me some code for hiding the text. Here is my jsp page Please Register User Type select user Mentor Student User Name First Name Last Name Email ID Password Confirm password
has answer: http://stackoverflow.com/a/28633998
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45567774

http://stackoverflow.com/comment/45769361
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28680823
has text: Is there any problem to trigger a digest?

http://stackoverflow.com/comment/49005516
type: AnswerComment
comment on: http://stackoverflow.com/a/30391237
type: Comment
score: 1
has text: I can't post the real code, that's confidential to the company I work at. An entire working code snippet would be extraneous and external from the point I am making. Please read my entire post and you will realize that this is deeper than simple JavaScript syntax and variable instantiation, but rather due to something in the rendering engine of Safari. Please only answer if you understand the question.

http://stackoverflow.com/q/28663101
type: AnsweredQuestion
type: Question
answer count: 1
tagged with: javascript
has title: .scrollIntoView any element with data- tag, or using classes to section content with data- tags
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: Right now, I separate my content with a class called "section", not to be confused with the html tag, e.g.: Using the above method, I can easily grab each elementsByClassName('section'), and gather the data- value; however, I am not sure how to efficiently grab a data- tag without using a class, e.g.: I could create a loop to grab every single element, right? But, would it not be a bad thing to do performance wise, or [insert con I am not aware of]? What method would you use for a site with maybe 3-5 scroll destinations? EDIT: With the answer to my question, I was able to come up with this: function jump(destination) { var scrollpoint = document.querySelectorAll('[data-scroll-location=' + destination + ']'); [].forEach.call(scrollpoint, function(land) { land.scrollIntoView(); }); } querySelectorAll really is awesome, it will help in so many projects!
has answer: http://stackoverflow.com/a/28664295
accepted answer: http://stackoverflow.com/a/28664295

http://stackoverflow.com/comment/45782446
has text: You could add a CSS3 transition: transition:margin-left 300ms; http://jsfiddle.net/rfLffev7/5/
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28733868

http://stackoverflow.com/comment/45497988
type: Comment
has text: Could you post your HTML? Do you have a model attached to the select field?
type: QuestionComment
comment on: http://stackoverflow.com/q/28595505
score: 0

http://stackoverflow.com/q/28711448
tagged with: jsf
tagged with: cookies
score: 1
upvote count: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45739365
tagged with: ajax
has title: Execute JavaScript before Ajax redirect
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45740500
type: UnansweredQuestion
tagged with: http-redirect
has body: Ajax request, redirect to /foo.jsf FacesContext context = FacesContext.getCurrentInstance(); ExternalContext ec = context.getExternalContext(); ec.redirect("/foo.jsf"); context.responseComplete(); The ajax response: Adding cookies to response will not work for ajax. I need browser to execute a script to set cookies before redirect, so need to add before as following script_set_cookies How to add before ? Thanks.
answer count: 0

http://stackoverflow.com/a/28702045
has comment: http://stackoverflow.com/comment/45699739
type: AcceptedAnswer
score: 0
type: Answer
has body: Try this regular expression var str = "Hey hello hi history hey", strToMatch = 'hey', re = new RegExp('hey','ig'); str.match(re).length;
accepted answer of: http://stackoverflow.com/q/28701631
answers question: http://stackoverflow.com/q/28701631

http://stackoverflow.com/comment/47100444
has text: @Mikhail - Assuming you defined in your index.html and you are entering the root of your app ("/"). Did you set this > $urlRouterProvider.otherwise('home'); within your stateprovider function?
comment on: http://stackoverflow.com/a/29435855
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28739920
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28739222
type: Answer
has body: The following will give you an array of unique newBiscuits that you can do what you want with: biscuits = ['a', 'b','c','d','e','f','g','h','i', 'j', 'k','l','m','n','o','p']; newBiscuits=new Array(); items=16; while(newBiscuits.length&lt;8) { newBiscuits.push(biscuits.splice(parseInt(Math.random()*items), 1)); items--; }
score: 0
accepted answer of: http://stackoverflow.com/q/28739222

http://stackoverflow.com/q/28623607
has title: How do I change tabs using JavaScript or jQuery without clicking on a tab?
has comment: http://stackoverflow.com/comment/45572156
type: Question
has comment: http://stackoverflow.com/comment/45572107
has body: I need to change active tab when user clicks on certain element inside first tab. I am calling javascript function on click of that element. I am trying to set current tab inactive and make other tab active. This is my HTML: Trial Balance Ledgers Loans (Liabillity) //tab 2 content
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45548631
score: 0
has comment: http://stackoverflow.com/comment/45548719
tagged with: tabs
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45548758

http://stackoverflow.com/q/28635694
tagged with: node-webkit
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28973350
score: 1
has title: Mac Node-webkit menu
type: Question
has comment: http://stackoverflow.com/comment/46197912
answer count: 1
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28973350
has body: I am trying to create a menu for a mac node-webkit app. I am trying to append a preferences menu item to the first/root menu(app name > about, preferences, etc). I have not been able to figure out how to access the menus that the .createMacBuiltin(); function creates. I have only been able to create a new custom menu. Has anyone figured out how to do this. See Slack's mac app for an example. Here is my code so far. var gui = require('nw.gui'); // Create menu container var Menu = new gui.Menu({ type: 'menubar' }); Menu.createMacBuiltin("Example App"); Menu.append( new gui.MenuItem({ label: 'Preferences', click : function () { $('#preferences').modal('toggle'); } }) ); gui.Window.get().menu = Menu; Thanks for the help.
has comment: http://stackoverflow.com/comment/46183018
tagged with: menu
tagged with: node.js
favorite count: 0

forms
tags question: http://stackoverflow.com/q/28642784
tags question: http://stackoverflow.com/q/28653297
tags question: http://stackoverflow.com/q/28659588
tags question: http://stackoverflow.com/q/28664840
tags question: http://stackoverflow.com/q/28605234
tags question: http://stackoverflow.com/q/28670953
tags question: http://stackoverflow.com/q/28725510
tags question: http://stackoverflow.com/q/28599600
tags question: http://stackoverflow.com/q/28657904
type: Tag
tags question: http://stackoverflow.com/q/28625094
tags question: http://stackoverflow.com/q/28747903
tags question: http://stackoverflow.com/q/28630449
tags question: http://stackoverflow.com/q/28678894
tags question: http://stackoverflow.com/q/28599763
tags question: http://stackoverflow.com/q/28702245
tags question: http://stackoverflow.com/q/28747687
tags question: http://stackoverflow.com/q/28694938
tags question: http://stackoverflow.com/q/28626161
tags question: http://stackoverflow.com/q/28602796
tags question: http://stackoverflow.com/q/28627248
tags question: http://stackoverflow.com/q/28614450
tags question: http://stackoverflow.com/q/28729990
tags question: http://stackoverflow.com/q/28720216
tags question: http://stackoverflow.com/q/28665529
tags question: http://stackoverflow.com/q/28740362
tags question: http://stackoverflow.com/q/28631283
tags question: http://stackoverflow.com/q/28674628
tags question: http://stackoverflow.com/q/28702607
tags question: http://stackoverflow.com/q/28727367
tags question: http://stackoverflow.com/q/28596705
tags question: http://stackoverflow.com/q/28702432
tags question: http://stackoverflow.com/q/28740261
tags question: http://stackoverflow.com/q/28685912
tags question: http://stackoverflow.com/q/28673594
tags question: http://stackoverflow.com/q/28740995
tags question: http://stackoverflow.com/q/28617609
tags question: http://stackoverflow.com/q/28748901
tags question: http://stackoverflow.com/q/28663066
tags question: http://stackoverflow.com/q/28731563
tags question: http://stackoverflow.com/q/28595704
tags question: http://stackoverflow.com/q/28667792
tags question: http://stackoverflow.com/q/28726040
tags question: http://stackoverflow.com/q/28730090
tags question: http://stackoverflow.com/q/28709146
tags question: http://stackoverflow.com/q/28636843
tags question: http://stackoverflow.com/q/28743300
tags question: http://stackoverflow.com/q/28625625
tags question: http://stackoverflow.com/q/28737540
tags question: http://stackoverflow.com/q/28745176
tags question: http://stackoverflow.com/q/28705851
tags question: http://stackoverflow.com/q/28727380
tags question: http://stackoverflow.com/q/28729255
tags question: http://stackoverflow.com/q/28705099
tags question: http://stackoverflow.com/q/28641781
tags question: http://stackoverflow.com/q/28657728
tags question: http://stackoverflow.com/q/28749136
tags question: http://stackoverflow.com/q/28597583
tag name: forms
tags question: http://stackoverflow.com/q/28647629
tags question: http://stackoverflow.com/q/28608558
tags question: http://stackoverflow.com/q/28619984
tags question: http://stackoverflow.com/q/28717205
tags question: http://stackoverflow.com/q/28696171
tags question: http://stackoverflow.com/q/28705795
tags question: http://stackoverflow.com/q/28616926
tags question: http://stackoverflow.com/q/28725815
tags question: http://stackoverflow.com/q/28749059
tags question: http://stackoverflow.com/q/28696996
tags question: http://stackoverflow.com/q/28730528
tags question: http://stackoverflow.com/q/28732639
tags question: http://stackoverflow.com/q/28634502
tags question: http://stackoverflow.com/q/28605452
tags question: http://stackoverflow.com/q/28634421
tags question: http://stackoverflow.com/q/28639545
tags question: http://stackoverflow.com/q/28747864

http://stackoverflow.com/q/28622018
accepted answer: http://stackoverflow.com/a/28622101
tagged with: javascript
answer count: 2
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45546150
tagged with: php
has answer: http://stackoverflow.com/a/28622101
score: 2
type: AnsweredQuestion
has body: I am trying to limit keyword input. Whenever a user enter a keyword, it will append 'span' to that keyword, e.g. like the html code below. I can limit words, but the count is not accurate but when it reach 5, it stop entering. If I refresh page, I can enter one more again, then stop me again too. The weird things, it doesn't work if I use id for var count=$('#result_tag').text(). I have to use class. I had tried to change /\S+/g to /\s+/g, not working, I have to keep S capital. JQuery: $( "#tag" ).on( "keydown", function( event ) { var count=$('.result_tag').text(); var words=count.match(/\S+/g).length; if(words >= 8 ){ alert('No more than eight words'); } //save tag after press enter key else if ( event.which==188 || event.which == 13 ) { event.preventDefault(); //codes will do the action HTML: keyword that user enter keyword that user enter keyword that user enter
upvote count: 2
type: Question
possible better answer: http://stackoverflow.com/a/28622171
has title: How come my code cannot calculate count correctly in jquery?
has answer: http://stackoverflow.com/a/28622171

http://stackoverflow.com/a/28711298
has comment: http://stackoverflow.com/comment/45717173
has body: Use jQuery functions like "delegate" or "on" for binding events to an element irrespective of element is present in DOM or not. Here is the example $( "body" ).on( "click", "#create_butt_1", function() { // Do something... });
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28710807
upvote count: 1
has comment: http://stackoverflow.com/comment/45714044

http://stackoverflow.com/q/28599149
has body: I want it to be changed not from right to left and then from left to right but from down to up and from back side, up to down. How do I do this? I tried some solutions and it last some hours so I write to you :/. $(document).ready(function () { $('.flipWrapper').click(function () { $(this).find('.card').toggleClass('flipped'); return false; }); }); .flipWrapper { -webkit-perspective: 1000; width: 400px; height: 200px; position: relative; margin: 50px auto; } .flipWrapper .card.flipped { -webkit-transform: rotatey(180deg); } .flipWrapper .card { width: 100%; height: 100%; -webkit-transform-style: preserve-3d; -webkit-transition: 0.5s; } .flipWrapper .card .face { width: 100%; height: 100%; position: absolute; -webkit-backface-visibility: hidden; z-index: 2; font-family: Georgia; font-size: 3em; text-align: center; line-height: 200px; } .flipWrapper .card .front { position: absolute; z-index: 1; background: rgb(57, 171, 62); color: white; cursor: pointer; border-radius: 10px; } .flipWrapper .card .back { -webkit-transform: rotatey(-180deg); background: blue; background: red; color: white; cursor: pointer; border-radius: 10px; } jQuery Script
tagged with: javascript
answer count: 2
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/28599227
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28599232
has title: How do I change this flipping card to flip vertically?
accepted answer: http://stackoverflow.com/a/28599227
upvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/28599232

http://stackoverflow.com/a/36715253
answers question: http://stackoverflow.com/q/28713598
downvote count: 0
has body: The window object, although globally available has testability issues as reference in the angular docs https://docs.angularjs.org/api/ng/service/$window .It looks like its not an issue on your code though but for good practice, you can inject a $window service then reference that instead and of course the "px" issue on the bottom. angular.module('ionicApp', ['ionic']) .controller('MainCtrl', function($scope, $window) { $scope.iframeHeight = $window.innerHeight; }); Later, as said before; ng-style="{height: iframeHeight + 'px'}"
score: 6
type: Answer
upvote count: 6

http://stackoverflow.com/comment/45613071
type: Comment
has text: thanks. i got [[null,52],[50,54],[52,56],[54,58]]
type: AnswerComment
comment on: http://stackoverflow.com/a/28658634
score: 0

http://stackoverflow.com/a/28724732
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28722979
type: Answer
upvote count: 11
accepted answer of: http://stackoverflow.com/q/28722979
score: 11
has comment: http://stackoverflow.com/comment/69622219
has body: var elements = this.refs.form.getDOMNode().elements; gives you an object containing each of the input nodes, which you could then iterate through.
has comment: http://stackoverflow.com/comment/66772222
has comment: http://stackoverflow.com/comment/63772516

el
tags question: http://stackoverflow.com/q/28744817
type: Tag
tag name: el

http://stackoverflow.com/q/28615535
has comment: http://stackoverflow.com/comment/45828769
downvote count: 0
tagged with: angularjs
answer count: 0
type: UnansweredQuestion
has title: ng-table not updating without page refresh
type: Question
score: 1
tagged with: ngtable
has comment: http://stackoverflow.com/comment/45896810
has body: I've come across some odd behavior with ng-table. When I refresh the page the reload() method works fine, updating the new data as it comes in via a socket events. When I go from one part of the app to the next without a full refresh, the socket event calls the same function that works after refresh but fails to reload the table. Here is the table: vm.communicationEventLogsTableParams = new ngTableParams({ page: 1, // show first page count: 5, sorting: { createdDate: 'dsc' // initial sorting } }, { counts: [5,10,25,50], total: vm.communicationEventLogs ? vm.communicationEventLogs.length : 0, // length of data getData: function ($defer, params) { //load data from resource CommunicationEventLog.getCommunicationEventLogs({workorderId: $stateParams.workorderId}, function (data) { vm.communicationEventLogs = data; console.log('hi'); console.log('GETTING DATA FOR COMM EVENT LOG TABLE'); var filteredData = vm.communicationEventLogs; filteredData = $filter('filter')(filteredData, vm.mySearch); if (filteredData) params.total(filteredData.length); var orderedData = params.sorting() ? $filter('orderBy')(filteredData, params.orderBy()) : filteredData; if (orderedData) $defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count())); console.log(params); }); } }); Here is the function calling the reload, called by a socket event: realTimeChannelFactory.on(realTimeChannelFactory.events.CELA, function (args) { console.log("RT_Event: Communication Log Event!"); vm.communicationEventLogsTableParams.reload(); }); The data is in the DOM because I can log it to the console when an event is fired. The strangest part is if I filter the table, ng-table does another reload and the data is visible in the table.
tagged with: pusher
upvote count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/45662876
type: Comment
has text: It's not weird. It works because you're using all global variables, which in general is not the best of ideas.
comment on: http://stackoverflow.com/a/28680165
type: AnswerComment
score: 0

http://stackoverflow.com/q/28627780
upvote count: 2
possible better answer: http://stackoverflow.com/a/28627893
answer count: 2
has title: How to pass the button name as variable in jquery dialogue box
downvote count: 1
favorite count: 0
has body: I want to call the default action of dialogue box button, so please tell me how to pass the variable in side the dialogue box initialization. Here is my try for that : Calling the dialogue box with default function of 'Yes' button $( "#confirmComplete" ).dialog( "option", "buttons:Yes"); $( "#confirmComplete" ).dialog({ autoOpen: false, resizable: false, modal: true, async:false, position: 'top', buttons: { "Yes": function() { //SOME FUNCTIOANLITY } } })
tagged with: jquery-ui-dialog
has answer: http://stackoverflow.com/a/28627893
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28627877
accepted answer: http://stackoverflow.com/a/28627877
type: Question
has comment: http://stackoverflow.com/comment/45556011
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28748690
has comment: http://stackoverflow.com/comment/45779375
accepted answer of: http://stackoverflow.com/q/28748483
has comment: http://stackoverflow.com/comment/45812271
score: 3
has comment: http://stackoverflow.com/comment/45779689
upvote count: 3
has comment: http://stackoverflow.com/comment/45779480
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45779392
type: Answer
has comment: http://stackoverflow.com/comment/45805117
answers question: http://stackoverflow.com/q/28748483
has body: The data returned in the .then is available to the next chained .then handler, which is what you would ultimately use to get the data. The .success just relays the original promise of $http.get. Returning data from .success doesn't do anything. So, if you have: function getStuff() { return $http.get('/api/stuff') .success(function(data) { // do something with data. returning doesn't do anything }) .error(function(data) { console.error(data); }); }; in the controller you would do: getStuff().then(function(response){ $scope.data = response.data; // this is the data available from `$http.get` }

http://stackoverflow.com/q/28684845
has comment: http://stackoverflow.com/comment/45664354
has comment: http://stackoverflow.com/comment/45673485
tagged with: facebook
has comment: http://stackoverflow.com/comment/45687307
type: AnsweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/45685727
type: Question
has title: Facebook Javascript SDK: Friend Invitations Limit
has comment: http://stackoverflow.com/comment/45684080
has answer: http://stackoverflow.com/a/28685871
has comment: http://stackoverflow.com/comment/45690639
has comment: http://stackoverflow.com/comment/45693131
tagged with: javascript
has comment: http://stackoverflow.com/comment/45690011
has body: I have an app on facebook with a secure canvas URL (still not published). I'm inviting friends in the following manner: FB.ui({method: 'apprequests', message: message, to: ids, onInvite); Is there a limit to how many ids I can pass to that function? I saw in the facbook documentation something about 20-50 limit depending on the browser. From what I understand the limit is due to Facebook's SDK using GET requests, is there a way to get rid of that limit?
answer count: 1
accepted answer: http://stackoverflow.com/a/28685871
has comment: http://stackoverflow.com/comment/45691798
has comment: http://stackoverflow.com/comment/45663094

http://stackoverflow.com/a/28641453
has comment: http://stackoverflow.com/comment/45581873
upvote count: 2
has comment: http://stackoverflow.com/comment/45581822
type: Answer
accepted answer of: http://stackoverflow.com/q/28641430
score: 2
answers question: http://stackoverflow.com/q/28641430
has comment: http://stackoverflow.com/comment/45581900
has comment: http://stackoverflow.com/comment/45581967
downvote count: 0
has body: the j-- is the loop condition, that's how it will terminate. the trailing ;) is the missing increment/decrement. The j-- construct both decrements j and tests the old un-decremented value for non-zero to decide whether to continue looping. The loop stops when j is zero; below the loop, the value of j will be -1. The key parts of the for loop to look for are the semicolons -- for ( ; ; ) Any valid expression (or comma-separated expression list) can go in any of the three slots, before, between, and after the semicolons. The loop initializers go after the ( and before the first ;. The loop condition is the value of the expression between the two ; ;. The post-loop update goes after the last ; and before the ).
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45581782

http://stackoverflow.com/a/28714125
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28694134
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28694134
type: Answer
has body: Highcharts is not defined on your page, so put the script of Highcharts on top of your page. Then use: var chart = new Highcharts.Chart({ chart: { renderTo: 'container2' } instead of: $('#container2').highcharts({ .. }); Here's the working fiddle

http://stackoverflow.com/comment/45753967
type: Comment
has text: I didnt get your HTML. You have only one checkbox field named other. And what is going in the hidden field??
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28731186

http://stackoverflow.com/q/28679164
upvote count: 0
possible better answer: http://stackoverflow.com/a/28680018
score: -2
tagged with: javascript
has answer: http://stackoverflow.com/a/28680018
tagged with: jquery
has comment: http://stackoverflow.com/comment/45653692
has comment: http://stackoverflow.com/comment/45652273
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45651592
has title: Insert data to different tables
has comment: http://stackoverflow.com/comment/45652631
has comment: http://stackoverflow.com/comment/45651499
has comment: http://stackoverflow.com/comment/45651903
favorite count: 0
has comment: http://stackoverflow.com/comment/45651887
has body: Surname/Last Name * Agency * Organizer * //my php code here $lname=strtoupper($_POST['lname']); $agency=strtoupper($_POST['agency']); $trorganizer=strtoupper($_POST['trorganizer']); $sql1 = "INSERT INTO personalinfo (lname) VALUES ('$lname')"; $sql2 = "INSERT INTO pep (agency) VALUES ('$agency')"; $sql3 = "INSERT INTO training (trorganizer) VALUES ('$trorganizer')"; //I think I have a problem with my sql code mysql_select_db('DATABASENAME'); $retval = mysql_query( $sql, $conn ); if(! $retval ) { die('Could not enter data: ' . mysql_error()); } echo "Data added successfully!"; mysql_close($conn); } } Anyone can help me how to insert data into different tables? I can't save these data. Thanks for your help. It'll much appreciated! Thanks!
has comment: http://stackoverflow.com/comment/45652144
downvote count: 2
has answer: http://stackoverflow.com/a/28680259
has comment: http://stackoverflow.com/comment/45653949
tagged with: php
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45651717
type: Question
has answer: http://stackoverflow.com/a/28679303
accepted answer: http://stackoverflow.com/a/28680259

object.observe
tags question: http://stackoverflow.com/q/28661401
type: Tag
tags question: http://stackoverflow.com/q/28662069
tag name: object.observe

http://stackoverflow.com/a/28625654
score: 2
has body: document.getElementById("street")[0] Does not return an array of HTML elements, it returns just a single element. So just use without [0] puts @browser.execute_script('return document.getElementById("street").innerHTML')
has comment: http://stackoverflow.com/comment/45588278
accepted answer of: http://stackoverflow.com/q/28625602
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/28625602
has comment: http://stackoverflow.com/comment/45552314

http://stackoverflow.com/a/28708164
answers question: http://stackoverflow.com/q/28708097
type: Answer
upvote count: 1
score: 1
downvote count: 0
has body: Have you considered using the UI Router library? In general, it's excellent. Specific to your question, the UrlMatcher service provides a method format that- unless I'm misunderstanding what you're asking- does what you're trying to do. new UrlMatcher('/your/route/here').format(optionalNamedParameters); // returns a formatted URL

http://stackoverflow.com/q/28672473
tagged with: jquery
answer count: 6
tagged with: http://stackoverflow.com/tag/html
has title: When to use the css element/class selector in javascript?
favorite count: 0
has answer: http://stackoverflow.com/a/28672526
upvote count: 2
tagged with: css
score: 2
has answer: http://stackoverflow.com/a/28672500
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28672588
possible better answer: http://stackoverflow.com/a/28672500
accepted answer: http://stackoverflow.com/a/28672526
type: Question
has answer: http://stackoverflow.com/a/28672559
has answer: http://stackoverflow.com/a/28672525
has answer: http://stackoverflow.com/a/28672516
downvote count: 0
tagged with: javascript
has body: I'm currently working on the codecademy course on building an interactive website and I stumbled upon an ambiguity concerning the use of the elemement/class selection of the css elements. javascript: var main = function() { $('.article').click(function() { $('.article').removeClass('current'); $('.description').hide(); $(this).addClass('current'); $(this).children('.description').show(); }); }; css: .current .item { background: rgba(206,220,206,.9); } Why do I have to use the element selector 'current' instead of the class selector '.current' in line 4? Is there any rule behind it or just a specification of jquery?

http://stackoverflow.com/a/28598527
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/28598411
score: 3
downvote count: 0
has body: use console.log or console.dir try { example.example = example; } catch (err) { console.dir(err); console.log("Error Message!", err.message); console.log("Stack Trace" , err.stack); } In this case if you check out your console you will notice that the error type is "ReferenceError". Hence, every exception has a type. Try to do this and you'll get the following: var x = undefined; x.myproperty= 0 TypeError: Cannot set property 'myproperty' of undefined myfaultySyntax' SyntaxError: Unexpected token ILLEGAL And so on! hopes this helps and gives you an idea.

http://stackoverflow.com/comment/45541357
comment on: http://stackoverflow.com/q/28607020
type: QuestionComment
score: 1
has text: Hm, maybe implement some kind of `reverse` with it?
type: Comment

http://stackoverflow.com/comment/100619315
type: AnswerComment
has text: best answer here
type: Comment
comment on: http://stackoverflow.com/a/46125317
score: 1

http://stackoverflow.com/q/28637389
downvote count: 0
has comment: http://stackoverflow.com/comment/45574903
has comment: http://stackoverflow.com/comment/45574869
type: Question
has comment: http://stackoverflow.com/comment/45576112
tagged with: javascript
has body: I'm using the following function to prevent double submissions: $("#form").submit(function () { var form = $(this); form.find("input[type=submit]").attr("disabled", "disabled") form.find("input[type=submit]").attr("value", "Processing"); }); It works fine, but then I have the following code which triggers an alert to avoid accidentally leaving the page: function goodbye(e) { if(!e) e = window.event; //e.cancelBubble is supported by IE - this will kill the bubbling process. e.cancelBubble = true; e.returnValue = '¿DO YOU REALLY WANT TO LEAVE THIS PAGE?'; //This is displayed on the dialog //e.stopPropagation works in Firefox. if (e.stopPropagation) { e.stopPropagation(); e.preventDefault(); } } window.onbeforeunload=goodbye; The problem is if the user clicks submit and the realizes he didnt want to leave the page and clicks on stay on this page instead, the submit button is still disabled. How could I re-enable it upon clicking stay on this page? Thanks!
has comment: http://stackoverflow.com/comment/45574754
has comment: http://stackoverflow.com/comment/45576147
upvote count: 2
has comment: http://stackoverflow.com/comment/45574983
has title: Prevent double submission with prevent window event issue
answer count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28639135
accepted answer: http://stackoverflow.com/a/28639135
has comment: http://stackoverflow.com/comment/45575120
has comment: http://stackoverflow.com/comment/45575064
has comment: http://stackoverflow.com/comment/45575091
score: 2
type: AnsweredQuestion

http://stackoverflow.com/comment/45611632
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28657757
type: Comment
has text: @Pieter21 . Yes it does , according to this - http://jsonlint.com/

http://stackoverflow.com/a/28703324
has body: Try this, Date Validation function in javascript function dateValidation() { var b = new Date("2014/01/22"); //your input date here var d = new Date(); // today date d.setMonth(d.getMonth() - 6); //subtract 6 month from current date if (b &gt; d) { alert("date is less than 6 month"); } else { alert("date is older than 6 month"); } }
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28697082
type: Answer
upvote count: 6
accepted answer of: http://stackoverflow.com/q/28697082
score: 6

http://stackoverflow.com/q/28611903
has title: Jquery POST unicode string to codeigniter php
has comment: http://stackoverflow.com/comment/45528241
has answer: http://stackoverflow.com/a/28614696
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45528399
has comment: http://stackoverflow.com/comment/45527774
accepted answer: http://stackoverflow.com/a/28614696
answer count: 2
has comment: http://stackoverflow.com/comment/45531051
has body: I'm trying to implement a custom suggestion engine using jquery. I take the user input, call my codeigniter v2 php code in order to get matches from a pre-built synonyms table. My javascript looks like this: var user_str = $("#some-id").val(); $.ajax({ type: "POST", url: "http://localhost/my-app/app/suggestions/", data: {"doc": user_str}, processData: false }) .done(function (data) { // Show suggestions... }); My PHP code (controller) looks like this: function suggestions() { $user_input = trim($_POST['doc']); die("[$user_input]"); } But the data is NOT posted to my PHP :( All I get as echo is an empty [] (with no 500 error or anything) I've spent 2 days looking for an answer, what I've read in SO / on google didn't help. I was able to make this work using GET, but then again, this wouldn't work with unicode strings, so I figured I should use POST instead (only this won't work either :() Anyone can tell me how to fix this? Also, this has to work with unicode strings, it's an important requirement in this project. I'm using PHP 5.3.8
downvote count: 0
has comment: http://stackoverflow.com/comment/45528970
has comment: http://stackoverflow.com/comment/45536469
tagged with: unicode
favorite count: 0
linked to: http://stackoverflow.com/q/28602890
has comment: http://stackoverflow.com/comment/45530188
has comment: http://stackoverflow.com/comment/45527463
tagged with: php
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/28617373
has comment: http://stackoverflow.com/comment/45527565
upvote count: 3
has answer: http://stackoverflow.com/a/28617373
tagged with: codeigniter
type: Question
has comment: http://stackoverflow.com/comment/45527735

http://stackoverflow.com/q/28644292
score: 0
linked to: http://stackoverflow.com/q/16420823
tagged with: http://stackoverflow.com/tag/html
has body: So I am making a JS playground like JSFiddle. While adding the JavaScript functionality and calling different functions, it seems like the code is running from the page document root and not the iframe one. $(document).ready(function() { var result = $("#result"); htmlVal = htmlEditor.getValue(); cssVal = cssEditor.getValue(); jsVal = jsEditor.getValue(); iframe = $(" "); result.append(iframe); var iframeDoc = $(iframe.get(0).contentDocument) //iframe.contents(); bodyFrame = iframeDoc.find("body"); headFrame = iframeDoc.find("head"); cssFiddle = headFrame.append(" ").children("#cssEdit"); jsFiddle = bodyFrame.append(" ").children("#jsEdit"); $("#update").click(updateResult); //setInterval(updateResult, 100); }); function updateResult() { htmlVal = htmlEditor.getValue(); cssVal = cssEditor.getValue(); jsVal = jsEditor.getValue(); if(htmlVal.split(" ").length == 2) { var bodyText = htmlVal.split(" ")[1].split(" ")[0]; bodyFrame.html(bodyText); jsFiddle = bodyFrame.append(" ").children("#jsEdit"); } if(htmlVal.split(" ").length == 2) { var headText = htmlVal.split(" ")[1].split(" ")[0]; headFrame.html(headText); css = headFrame.append(" ").children("#cssEdit"); } else { bodyFrame.html(htmlVal); js = bodyFrame.append(" ").children("#jsEdit"); } jsFiddle.html(settings.JS + "\n" + jsVal); cssFiddle.html(settings.CSS + "\n" + cssVal); }
has answer: http://stackoverflow.com/a/28644391
type: UnansweredQuestion
tagged with: iframe
has title: Problems with custom JavaScript code being run in iFrame
has answer: http://stackoverflow.com/a/28646140
has comment: http://stackoverflow.com/comment/45586678
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45587021
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28762708
accepted answer of: http://stackoverflow.com/q/28625043
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45919609
answers question: http://stackoverflow.com/q/28625043
has comment: http://stackoverflow.com/comment/45920320
has comment: http://stackoverflow.com/comment/45925824
type: Answer
has body: Use setContent method of active Editor in tinyMCE suppose you have value as var txtVal = $(".dropdown").val(); // dropdown value //set value as in your active tinyMCE's textarea editor tinyMCE.activeEditor.setContent(txtVal ); Hope it will work :)
has comment: http://stackoverflow.com/comment/45882292
score: 1
has comment: http://stackoverflow.com/comment/45919265

http://stackoverflow.com/a/28650103
downvote count: 0
has comment: http://stackoverflow.com/comment/45604695
has comment: http://stackoverflow.com/comment/45625444
accepted answer of: http://stackoverflow.com/q/28649851
has body: You need to set the canvas width: var canvas1 = document.createElement( 'canvas' ); canvas1.width = 512; canvas1.height = 64; var texture1 = new THREE.Texture( canvas1 ); texture1.needsUpdate = true; var material1 = new THREE.MeshLambertMaterial( { map: texture1, side:THREE.DoubleSide, transparent = true } ); Now, when you create your mesh geometry, you specify its size in world units, not in pixels: var mesh1 = new THREE.Mesh( new THREE.PlaneGeometry( 1024, 128 ), material1 ); three.js r.70
answers question: http://stackoverflow.com/q/28649851
upvote count: 2
has comment: http://stackoverflow.com/comment/45604112
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/45626406
has comment: http://stackoverflow.com/comment/45601640
score: 2

http://stackoverflow.com/q/28668690
has answer: http://stackoverflow.com/a/28695793
downvote count: 0
score: 1
has body: I have a dropdown list in PHP Zend with the following code : $this-&gt;addElement('select', 'target', array( 'decorators' =&gt; $this-&gt;getElementDecorators(), 'label' =&gt; Zend_Registry::get('Zend_Translate')-&gt;translate('Target_Platform'), 'style' =&gt; 'width:320px;', 'data-help' =&gt; Zend_Registry::get('Zend_Translate')-&gt;translate('Target_Platform_To_Publish_To'), )); This has a list of about 14 values. I am using below code in my JS file to get the CURRENT drop-down value : this.temp = $('#target :selected').text(); console.dir(this.temp); However the value in this variable does not changes when I select some other value in the dropdown ? I want the variable to change dynamically as per the values selected by the user. How is that possible ? Thanks for reading :)
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28668722
tagged with: zend-form
answer count: 3
upvote count: 1
favorite count: 0
has title: How to get drop down value dynamically in JavaScript?
has answer: http://stackoverflow.com/a/28696036
type: UnansweredQuestion
tagged with: php

http://stackoverflow.com/comment/45703898
score: 0
has text: Yes this is my jsfiddle: https://jsfiddle.net/anna33/z5mojbve/7/ Thank u
type: AnswerComment
comment on: http://stackoverflow.com/a/28706674
type: Comment

http://stackoverflow.com/comment/45565002
score: 0
has text: I will prefer the `absolute` and table `relative` http://jsfiddle.net/xrLLaqs6/5/ +1
type: Comment
comment on: http://stackoverflow.com/a/28632525
type: AnswerComment

http://stackoverflow.com/comment/45587010
type: Comment
has text: @Quentin that question and mine is the same i wasnt able to see that question so i asked. The question is a bit old is there any new way to this or still the same as before?
comment on: http://stackoverflow.com/q/28644200
score: 0
type: QuestionComment

http://stackoverflow.com/a/28669198
has comment: http://stackoverflow.com/comment/45665980
has body: A brief inspection of the jss source leads me to believe that your answer lies in creating different stylesheets. From my brief perusal it seems that CSS in stylesheets created later override CSS in previously created stylesheets. "Read the source"
has comment: http://stackoverflow.com/comment/45637196
score: 0
has comment: http://stackoverflow.com/comment/45632538
answers question: http://stackoverflow.com/q/28669083
type: Answer

http://stackoverflow.com/q/28739108
favorite count: 0
has comment: http://stackoverflow.com/comment/45762353
has answer: http://stackoverflow.com/a/28741663
has comment: http://stackoverflow.com/comment/45762451
upvote count: 1
type: Question
type: AnsweredQuestion
tagged with: angular-ui-router
score: 1
has body: I use angularjs and ui-router to write a page. And I found my router is not working in current router. For example: The current router is /a/b, and $location.path() or $location.path("/a/b") is not working. If I locate to a new path, $location.path("/a/c"), it is working. Please give me some suggestion about my problem. THANKS.
accepted answer: http://stackoverflow.com/a/28741663
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45762170
has title: Angularjs $location.path() cannot locate to current router

http://stackoverflow.com/comment/45557321
has text: @squiroid.. read my updated answer, hope this will make clear to you, how node is single threaded
comment on: http://stackoverflow.com/a/28627152
score: 0
type: AnswerComment
type: Comment

knockout.js
tags question: http://stackoverflow.com/q/28666569
tags question: http://stackoverflow.com/q/28613707
tags question: http://stackoverflow.com/q/28701180
tags question: http://stackoverflow.com/q/28670719
tags question: http://stackoverflow.com/q/28690412
tags question: http://stackoverflow.com/q/28708643
tags question: http://stackoverflow.com/q/28730562
tags question: http://stackoverflow.com/q/28621446
tags question: http://stackoverflow.com/q/28688322
tags question: http://stackoverflow.com/q/28673085
tags question: http://stackoverflow.com/q/28673506
tags question: http://stackoverflow.com/q/28686332
tags question: http://stackoverflow.com/q/28731450
tags question: http://stackoverflow.com/q/28680523
tags question: http://stackoverflow.com/q/28701361
tags question: http://stackoverflow.com/q/28620867
tag name: knockout.js
tags question: http://stackoverflow.com/q/28630340
tags question: http://stackoverflow.com/q/28749896
tags question: http://stackoverflow.com/q/28639480
tags question: http://stackoverflow.com/q/28737316
tags question: http://stackoverflow.com/q/28672531
tags question: http://stackoverflow.com/q/28687550
tags question: http://stackoverflow.com/q/28739403
tags question: http://stackoverflow.com/q/28732641
tags question: http://stackoverflow.com/q/28667486
tags question: http://stackoverflow.com/q/28635879
type: Tag
tags question: http://stackoverflow.com/q/28690366
tags question: http://stackoverflow.com/q/28679622
tags question: http://stackoverflow.com/q/28699890
tags question: http://stackoverflow.com/q/28674338
tags question: http://stackoverflow.com/q/28701374
tags question: http://stackoverflow.com/q/28731334
tags question: http://stackoverflow.com/q/28683205
tags question: http://stackoverflow.com/q/28739815

http://stackoverflow.com/a/28678939
has body: What you can do is to use selenium browser automation tool and check the console logs: from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities capabilities = DesiredCapabilities.CHROME capabilities['loggingPrefs'] = { 'browser':'ALL' } driver = webdriver.Chrome(desired_capabilities=capabilities) driver.get('http://foo.com') # print console log messages for entry in driver.get_log('browser'): print entry Taken from Getting console.log output from Chrome with Selenium Python API bindings.
has comment: http://stackoverflow.com/comment/82637788
upvote count: 8
type: Answer
accepted answer of: http://stackoverflow.com/q/28678872
score: 8
answers question: http://stackoverflow.com/q/28678872
has comment: http://stackoverflow.com/comment/45651516
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45651504

http://stackoverflow.com/a/28705738
has body: Use keyboard events from React - http://facebook.github.io/react/docs/events.html For example: var CommentForm = React.createClass({ handleSubmit: function(e) { alert("YES again"); return; }, handleKeyPress: function(e){console.log(e.which);if(e.which == 13){this.handleSubmit();}}, render: function() { return ( &lt;div className="postCon"&gt; &lt;form className="commentForm" onSubmit={this.handleSubmit}&gt; &lt;textarea onKeyPress={this.handleKeyPress} className="textA input" placeholder="Your comment" ref="author" /&gt; &lt;/form&gt; &lt;/div&gt; ); } })
answers question: http://stackoverflow.com/q/28705565
accepted answer of: http://stackoverflow.com/q/28705565
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/45708054
score: 0

http://stackoverflow.com/q/28749119
accepted answer: http://stackoverflow.com/a/28749182
tagged with: meteor
favorite count: 0
has title: Why Does {{#each}} Work Properly While {{#with}} Does Not?
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: spacebars
type: Question
tagged with: javascript
has body: I am working on a project with Meteor.js and have some issue with the use of Handlebar : I want to retrieve the last item of a collection , and display the field : text which have html in it : here is my javascript code : Template.postVerif.helpers({ 'lastPost' :function(){ lastPost = Posts.find({}, {sort:{timestamp:-1}, limit :1}).fetch(); return lastPost } }) and in the html the handlebar {{#each}} is working but not the {{#with}} which is kind of weird seeing that there is only one item returned. {{#each lastPost}} {{{text}}} {{/each}} {{#with lastPost}} {{{text}}} {{/with}} Do you have any kind of idea why that is ?
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/28749182

http://stackoverflow.com/comment/45503820
has text: can you understand what i try to say ?
type: Comment
comment on: http://stackoverflow.com/a/28598726
score: 0
type: AnswerComment

http://stackoverflow.com/q/28691960
has answer: http://stackoverflow.com/a/28692255
answer count: 4
possible better answer: http://stackoverflow.com/a/28692141
favorite count: 0
has answer: http://stackoverflow.com/a/28692141
has body: I have this countDown, each time I press the buttons I want to add 5 more seconds. When the time is updated the function count down the new value but the old value as well. Can someone explain me why? http://jsfiddle.net/xqdj3uz8/1/ $('button').on('click', function() { var newtime = parseInt(seconds + 5); timer(newtime); });
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/45675252
downvote count: 0
type: Question
upvote count: 2
has title: setInterval countDown update time
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28692238
accepted answer: http://stackoverflow.com/a/28692238
has answer: http://stackoverflow.com/a/28692286

http://stackoverflow.com/a/28698123
answers question: http://stackoverflow.com/q/28691085
accepted answer of: http://stackoverflow.com/q/28691085
has body: Checked your page (chrome 40) and got SecurityError: Blocked a frame with origin "null" from accessing a frame with origin "null". Protocols, domains, and ports must match. so I checked in a server (local express) and works fine.
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45690127
type: Answer
has comment: http://stackoverflow.com/comment/45689236

http://stackoverflow.com/comment/45549623
type: Comment
type: QuestionComment
score: 2
has text: Have you looked at a CSS-based solution liked viewport height units? http://web-design-weekly.com/2014/11/18/viewport-units-vw-vh-vmin-vmax/
comment on: http://stackoverflow.com/q/28624129

angularjs-ng-repeat
tags question: http://stackoverflow.com/q/28677310
tags question: http://stackoverflow.com/q/28737441
tags question: http://stackoverflow.com/q/28687931
tags question: http://stackoverflow.com/q/28670213
tags question: http://stackoverflow.com/q/28695600
tags question: http://stackoverflow.com/q/28743442
tags question: http://stackoverflow.com/q/28734475
tags question: http://stackoverflow.com/q/28714416
tags question: http://stackoverflow.com/q/28612147
tags question: http://stackoverflow.com/q/28746424
tags question: http://stackoverflow.com/q/28728994
tags question: http://stackoverflow.com/q/28725554
tags question: http://stackoverflow.com/q/28707156
type: Tag
tags question: http://stackoverflow.com/q/28637581
tags question: http://stackoverflow.com/q/28738765
tags question: http://stackoverflow.com/q/28683992
tag name: angularjs-ng-repeat
tags question: http://stackoverflow.com/q/28626502
tags question: http://stackoverflow.com/q/28635578
tags question: http://stackoverflow.com/q/28596579
tags question: http://stackoverflow.com/q/28656698
tags question: http://stackoverflow.com/q/28705875
tags question: http://stackoverflow.com/q/28739669
tags question: http://stackoverflow.com/q/28598874
tags question: http://stackoverflow.com/q/28632647
tags question: http://stackoverflow.com/q/28746758
tags question: http://stackoverflow.com/q/28684735

angularjs-ng-click
tags question: http://stackoverflow.com/q/28674204
type: Tag
tag name: angularjs-ng-click
tags question: http://stackoverflow.com/q/28728542

http://stackoverflow.com/comment/45680556
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28694775
type: AnswerComment
has text: slide just makes it look cool when you toggle, I've tried it without slide and have the same issue...

http://stackoverflow.com/a/45849918
has comment: http://stackoverflow.com/comment/100280862
has body: Documentation: Iteration Protocols Example class implementing both iterator protocol and iterable protocol techniques: class MyCollection { constructor(elements) { if (!Array.isArray(elements)) throw new Error('Parameter to constructor must be array'); this.elements = elements; } // Implement "iterator protocol" *iterator() { for (let key in this.elements) { var value = this.elements[key]; yield value; } } // Implement "iterable protocol" [Symbol.iterator]() { return this.iterator(); } } Access elements using either technique: var myCollection = new MyCollection(['foo', 'bar', 'bah', 'bat']); // Access elements of the collection using iterable for (let element of myCollection) console.log('element via "iterable": ' + element); // Access elements of the collection using iterator var iterator = myCollection.iterator(); while (element = iterator.next().value) console.log('element via "iterator": ' + element);
downvote count: 0
type: Answer
score: 19
upvote count: 19
answers question: http://stackoverflow.com/q/28739745

http://stackoverflow.com/comment/45604165
type: QuestionComment
comment on: http://stackoverflow.com/q/28652655
has text: yes that works and it appears in the node_modules dir but karma isn't in there
score: 0
type: Comment

http://stackoverflow.com/a/28727732
upvote count: 1
has body: You should set the context when you call the function: privateInitFunc.call(this)
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28727715
answers question: http://stackoverflow.com/q/28727715
score: 1

http://stackoverflow.com/comment/45783603
score: 1
comment on: http://stackoverflow.com/q/28750487
type: Comment
has text: I'm surprised this doesn't work. Are you sure you are calling your code after the DOM is fully loaded?
type: QuestionComment

http://stackoverflow.com/a/28688267
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45670027
has comment: http://stackoverflow.com/comment/45669727
upvote count: 1
answers question: http://stackoverflow.com/q/28688171
has comment: http://stackoverflow.com/comment/45670245
type: Answer
has body: You can use something like this, I have considered maximum of 4 numbers, you can change it in letterUsed variable. You can add Capital letters as well in array function getAlphaNumeric(){ var arr =['a','b', 'c', 'd','e','f','g','h','i', 'j', 'k', 'l', 'm', 'n','o','p','q', 'r','s','t','u','v','w','x','y','z'], letterUsed=0,numberUsed=0, maxNum =Math.ceil(Math.random()*4), maxLetter = 8-maxNum,i=0, randomStr=''; for(;i&lt;8;i++){ if((Math.floor(Math.random()*2) === 0 &amp;&amp; numberUsed &lt;maxNum) || letterUsed&gt;=maxLetter ){ randomStr += Math.floor(Math.random()*10); numberUsed++; }else{ randomStr += arr[Math.floor(Math.random()*26)]; letterUsed++; } } return randomStr; } getAlphaNumeric();

http://stackoverflow.com/comment/45692485
type: Comment
comment on: http://stackoverflow.com/a/28637128
type: AnswerComment
has text: @steve_o: I'm not sure which version of jqGrid you use. I recommend you to download the current code [here](https://github.com/free-jqgrid/jqGrid) If you want to use Font Awesome then you should include `iconSet: "fontAwesome"` option to jqGrid and don't forget to include the fonts itself: ` `. It was short time the version where I changed default value of `iconSet` from `"jQueryUI"` to `"fontAwesome"`, but I changed it back because I realized that not all people include the fonts. :-(
score: 0

http://stackoverflow.com/q/28663151
has body: I'm very new to Ajax. Currently I'm working on a new project. For that project one of the requirements is, populating a second dropdown based on the input from the first dropdown. I'm using Struts to do that. I don't want the page to be refreshed, so I need to use Ajax for calling the second dropdown content in the backend and populate in the second dropdown. I don't know how to write code for that. What should be included (jars,tags) in my struts project? What entries should come in my JSP (I am using &lt;html:select&gt;)? What will come in JavaScript? What will come in action class (in action class I can fetch the list values from the DB based on the selection from the first dropdown)?
has title: Dropdown based on another dropdown in jsp Struts
score: -1
type: AnsweredQuestion
tagged with: struts-1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45658509
has answer: http://stackoverflow.com/a/29756995
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28664967
has answer: http://stackoverflow.com/a/28664967
answer count: 2
upvote count: 0
has comment: http://stackoverflow.com/comment/45632395
tagged with: jsp
tagged with: jquery
favorite count: 0
tagged with: ajax
accepted answer: http://stackoverflow.com/a/29756995

http://stackoverflow.com/a/28664591
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45639469
downvote count: 0
answers question: http://stackoverflow.com/q/28662091
accepted answer of: http://stackoverflow.com/q/28662091
type: Answer
score: 1
upvote count: 1
has body: hard to make this right in my head without some code for the login template, so I just threw together a quick codePen here based on the nightly builds from Ionic http://codepen.io/aaronksaunders/pen/ogdzNE angular.module('mySuperApp', ['ionic']) .controller('PopupCtrl',function($scope, $ionicPopup, $timeout) { // Triggered on a button click, or some other target $scope.showPopup = function() { $scope.loginData = {}; // An elaborate, custom popup var myPopup = $ionicPopup.show({ templateUrl: 'popup-template.html', title: 'Enter Wi-Fi Password', subTitle: 'Please use normal things', scope: $scope, buttons: [ { text: 'Cancel' }, { text: 'Save', type: 'button-positive', onTap: function(e) { alert(JSON.stringify($scope.loginData)); } }, ] }); }; });

http://stackoverflow.com/comment/74761109
has text: @SanjayaPandey: Did you find any solution? (suggestion on every key stroke) I badly need this. Thanks in advance.
comment on: http://stackoverflow.com/a/28945669
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/a/60690753
type: Answer
score: 1
upvote count: 1
downvote count: 0
has body: How do I protect against unexpected data quoted below the first paragraph above? filter_input( INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_FULL_SPECIAL_CHARS ); Thanks, for @Sverri M. Olsen for expaining why to use filter_input instead of superglobals https://stackoverflow.com/a/15103555/11173494 Also, is there a specific name for this type of XSS attack? This is Stored XSS. The hacker could construct custom query to attack user by store malicious code. @Sandeep Nair expained the difference between Stored XSS and Reflected XSS https://stackoverflow.com/a/48893119/11173494
answers question: http://stackoverflow.com/q/28610732

http://stackoverflow.com/comment/45541731
has text: It is javascript specific because I'm trying to do it with JAVASCRIPT. I'll verify the input with php as well which is easy for me.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28619433
score: 0

http://stackoverflow.com/a/28688753
has comment: http://stackoverflow.com/comment/45682536
has comment: http://stackoverflow.com/comment/45719765
has comment: http://stackoverflow.com/comment/45730619
type: Answer
downvote count: 2
answers question: http://stackoverflow.com/q/28687940
has comment: http://stackoverflow.com/comment/45688267
upvote count: 0
score: -2
has body: You need to declare $scope.games variable outside success function. Means at the level where $scope.formData is declared.

http://stackoverflow.com/q/28714655
has answer: http://stackoverflow.com/a/28714755
tagged with: javascript
has title: jquery access column of a multidimensional array
has body: I have a multidimensional array of vectors as follows: var mutliDimArr = [[1,0,0],[0,0,1],[0,1,0]]; I wish to form another array of the i'th column elements for example if i write a function getColumnarArray(1), then it must return an new array [0,0,1] ..which are the 2nd elements each from the above mutliDimArr I tried the following, but it is not giving me the desired results.: function getColumnarArraycolumn(){ var output = []; var column = 1; $.map(multiDimArray, function( arrayVect, column) { output.push(arrayVect[column]); }); console.log(output); } Please advise, Thanks!
type: Question
has answer: http://stackoverflow.com/a/28714751
score: 0
has answer: http://stackoverflow.com/a/28714823
tagged with: arrays
tagged with: jquery
has answer: http://stackoverflow.com/a/28714838
tagged with: multidimensional-array
answer count: 4
type: UnansweredQuestion

http://stackoverflow.com/a/28732222
score: 1
has body: You need to specify a position value for the map. In the style parameter add position:relative;
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28723689
accepted answer of: http://stackoverflow.com/q/28723689
type: Answer
has comment: http://stackoverflow.com/comment/45775068
downvote count: 0

http://stackoverflow.com/comment/45644010
has text: @sbaglieri: That's something else.
type: QuestionComment
type: Comment
score: 2
comment on: http://stackoverflow.com/q/28675291

http://stackoverflow.com/q/28606379
answer count: 0
type: UnansweredQuestion
tagged with: system.web.optimization
has comment: http://stackoverflow.com/comment/45549918
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45525632
type: Question
tagged with: asp.net-mvc
has title: .net JavaScript minification breaks jQuery plugin
tagged with: javascript
has comment: http://stackoverflow.com/comment/45525853
tagged with: jquery
upvote count: 1
tagged with: minify
has comment: http://stackoverflow.com/comment/45517660
favorite count: 0
has body: I have a jQuery plugin that works fine when JS minification is turned off. As soon as you switch it on though a specific part of the plugin no longer works. The plugin: Is a password strength indicator plugin, which checks the input runs through some logic then highlights 1 - 5 indicator blocks depending on the number of conditions the user input has met. The plugin (minus large parts of the logic for brevity): $(function () { (function ($) { $.fn.strongPassword = function () { var updatePasswordStrengthIndicator = function (indicators, $context) { console.log("indicators ", indicators); //prints out correct value console.log("$context ", $context); //prints out object reference for (var i = 0; i <= indicators; i++) { //problem lies here then $context.siblings(".strong-password").children('.strong-password-indicator:nth-child(' + (i + 1) + ')').removeClass('normal').removeClass('pass').addClass('pass'); } } return this.each(function () { var $this = $(this); //code to insert HTML elements for password strength indicators $(" Password Strength Too Short ") .insertAfter($this); $this.keyup(function () { //create required variables //logic to work out password strength //call to update indicators updatePasswordStrengthIndicator(blocksToLight, $(this)); }); }); } }(jQuery)); }); Problem Area: The problem is with the function 'updatePasswordStrengthIndicator'. I traced out the values from the two arguments 'indicators' renders out the number of blocks and '$context' renders out the HTML input both of which are correct. Turn on minification and the updatePasswordStrengthIndicator fails, no blocks light up even though the arguments are correct Here is the minified output: $(function () { (function (n) { n.fn.strongPassword = function () { var t = function (n, t) { console.log('indicators ', n), console.log('$context ', t); for (var i = 0; i <= n; i++) t.siblings('.strong-password').children('.strong-password-indicator:nth-child(' + (i + 1) + ')').removeClass('normal').remo…

http://stackoverflow.com/q/28735682
downvote count: 3
has answer: http://stackoverflow.com/a/28736929
upvote count: 1
possible better answer: http://stackoverflow.com/a/28735794
has answer: http://stackoverflow.com/a/28735794
type: Question
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45756208
tagged with: ajax
answer count: 2
accepted answer: http://stackoverflow.com/a/28736929
tagged with: http://stackoverflow.com/tag/html
has title: I am trying to implement an AJAX call. What am I doing wrong?
favorite count: 0
tagged with: php
type: AnsweredQuestion
has body: This is my HTML text: Search! This is Javascript: ajaxCall() { var xmlhttp = new XMLHttpRequest(); var url = "http://localhost:8080/CSE%205335%20Project%20One/userInfo.php"; xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { myFunction(xmlhttp.responseText); } } xmlhttp.open("GET", url, true); xmlhttp.send('searchdb'); function myFunction(response) { var obj = JSON.parse(response); document.getElementById("democity").innerHTML = obj.city; document.getElementById("demodes").innerHTML = obj.description; document.getElementById("latlon").innerHTML = obj.latitude + "," + obj.longitude; } } And this is where I am trying to display the response that I am receiving from the PHP file: The output of the PHP file is stored in $outp and it is in the JSON format. Any help appreciated. Thank you. !!UPDATE!! function ajaxCall() { var xmlhttp = new XMLHttpRequest(); var url = "http://localhost:8080/CSE%205335%20Project%20One/userInfo.php"; xmlhttp.onreadystatechange=function() { xmlhttp.open("GET", url, true); xmlhttp.send('searchdb'); if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { myFunction(xmlhttp.responseText); } } } function myFunction(response) { var obj = JSON.parse(response); document.getElementById("democity").innerHTML = obj.city; document.getElementById("demodes").innerHTML = obj.description; document.getElementById("latlon").innerHTML = obj.latitude + "," + obj.longitude; } This is how the improvised code looks. Still not working.

http://stackoverflow.com/a/37074518
answers question: http://stackoverflow.com/q/28651028
downvote count: 0
has body: I realize this thread is 1 year + old, but it helped me, albeit with a different module. I installed mongoose-post-findv0.0.2 and this issue started. To fix it, I used the suggestions and navigated to \node_modules\mongoose-post-find\node_modules\bson\ext and opened the index.js file. The file starts off with a try catch block trying to require the correct bson version try { // Load the precompiled win32 binary if(process.platform == "win32" &amp;&amp; process.arch == "x64") { bson = require('./win32/x64/bson'); } else if(process.platform == "win32" &amp;&amp; process.arch == "ia32") { bson = require('./win32/ia32/bson'); } else { bson = require('../build/Release/bson'); } } catch(err) { // Attempt to load the release bson version try { bson = require('../browser_build/bson'); } catch (err) { console.dir(err) console.error("js-bson: Failed to load c++ bson extension, using pure JS version"); bson = require('../lib/bson/bson'); } } this is the corrected version. What was happening is it tried to load bson from ../build/Release/bson, couldn't find it and fell into the catch. There is tried to load bson again from ../build/Release/bson and of course failed. So I changes the path in the catch to look in ../browser_build/bson. This resolved the error. I post this for completeness.
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/45604959
type: QuestionComment
comment on: http://stackoverflow.com/q/28616541
has text: @Kato thanks for the input. And yes I will see if I can reproduce the problem in a simplified form. But I guess I was looking for confirmation that this was in fact an odd behavior. Being new to Firebase, I wasn't sure if this was or was not a desired behavior, I could make arguments either way in my head.
score: 0
type: Comment

http://stackoverflow.com/comment/45714013
type: Comment
comment on: http://stackoverflow.com/a/28712653
has text: Thank you for your suggestion. If I just change the datatype to "json" (and do no other changes), I get a parseerror, SyntaxError: Invalid character. Is there something in the C# code that needs to be modified? Does returning a set of integers (as opposed to a string) cause problems when using Ajax?
score: 0
type: AnswerComment

http://stackoverflow.com/a/28667793
has body: can create another set of xml called custom_red_checkbox.xml &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;item android:drawable="@drawable/option_unselected_red" android:state_checked="false" android:color="#ff0000"/&gt; &lt;item android:drawable="@drawable/option_selected" android:state_checked="true"/&gt; and your code modify to if(yes.isChecked()) {check.setButtonDrawable(mContext.getResources().getDrawable( R.drawable.custom_checkbox));} else {check.setButtonDrawable(mContext.getResources().getDrawable( R.drawable.custom_red_checkbox));}
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28664078
answers question: http://stackoverflow.com/q/28664078

http://stackoverflow.com/a/28731509
has comment: http://stackoverflow.com/comment/45749761
answers question: http://stackoverflow.com/q/28731406
has comment: http://stackoverflow.com/comment/45750278
score: 0
has comment: http://stackoverflow.com/comment/45750348
has comment: http://stackoverflow.com/comment/45750055
has comment: http://stackoverflow.com/comment/45751176
has comment: http://stackoverflow.com/comment/45750128
has comment: http://stackoverflow.com/comment/45750310
type: Answer
has comment: http://stackoverflow.com/comment/45749916
has body: Change the three first lines to, and everything should work fine. if (isset($_GET["comicID"])) { $comic = $_GET["comicID"];

http://stackoverflow.com/q/28663823
tagged with: javascript
tagged with: jquery
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/28669404
has comment: http://stackoverflow.com/comment/45632542
has answer: http://stackoverflow.com/a/28663929
favorite count: 0
has title: Filter in JQuery
has body: I am new to JavaScript. I need to filter (show/hide) lines by chosen option(All - show all rows, Closed - hide all options except Closed, Opened - only 'Opened' rows.). Where am I doing something wrong? I want to understand it. Here is my code: HTML: All Closed Opened ... ... JS: $( document ).ready(function() { $('.btn').on('click', '#status-filter', function() { var selectOption = $('#select option:selected').text(); $('.row').each(function(selectOption) { if ($('.row[data-row-choice]') == 'All') { $(this).show(); } else if ($('.row[data-row-choice]') != selectOption) { $(this).hide(); }; }); }); }); EDIT: I mistook that 'All' - all rows('Opened' and 'Closed'), i.e. 'All' contains 'Opened' and 'Closed'. And I corrected another code.
possible better answer: http://stackoverflow.com/a/28663929
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/28669404
upvote count: 3
type: Question

http://stackoverflow.com/q/28594278
has title: How to read FPS measurments in Mac 'Instruments' (Core Animation) while debuggin Mobile Safari on iPad comparing to Chrome Dev Tools FPS reading?
has body: I'm using Yosemite and OSX Xcode 'Instruments' (Core Animation) to measure FPS in my iPadMini Mobile Safari browser app. However, the reading I get looks contrary to the reading you get while using 'timeline' and Chrome Dev Tools. Please see the image from 'Inststruments': and Dev Tools Timeline: When you don't perform any action (fire no events) in Dev Tools you get 60fps+ (see the image above) and that what I would expect. However, in Mac 'Instruments' - Core Animation - in the same state you have ~7fps and FPS rate rises as soon as you start fiddling with the application (fire some events). I'm confused and would appreciate any help.
answer count: 0
type: UnansweredQuestion
score: 3
tagged with: frame-rate
upvote count: 3
type: Question
tagged with: ios
tagged with: javascript
tagged with: xcode
downvote count: 0
tagged with: ipad
favorite count: 0

http://stackoverflow.com/q/28614519
type: Question
tagged with: null
has comment: http://stackoverflow.com/comment/45533298
tagged with: javascript
has title: Why is null value getting converted into string "null"?
downvote count: 0
has comment: http://stackoverflow.com/comment/45532539
tagged with: string
has body: I have a form at the client side in JavaScript which has a field named commEmail. When user hit submit, the commEmail remains null and it is sent back to the back end which is in Java. Here, the commEmail that I get it being converted in a string "null" instead of identifying it as a null. How can i fix that? This is my code @POST @Produces(MediaType.APPLICATION_JSON) @Path("/{userId}") // specifies the relative path for a resource class public void updateUser(@Auth Jwt jwt, @FormParam (value="firstName") String firstName, @FormParam (value="lastName") String lastName, @FormParam (value="commEmail") String commEmail, @Suspended final AsyncResponse asyncResponse) { // Here when i look into the values, the value of commEmail is "null" (a string) instead of null.
has comment: http://stackoverflow.com/comment/45532328
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45532384
answer count: 0
score: 1
tagged with: java
upvote count: 1

http://stackoverflow.com/comment/45582192
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28641494
has text: Checked before and just now. No errors in console. I am doing this on a local MAMP PRO server (same directory) but that should not matter.
type: AnswerComment

http://stackoverflow.com/q/28715799
answer count: 3
linked to: http://stackoverflow.com/q/36871241
has answer: http://stackoverflow.com/a/28828621
tagged with: permissions
upvote count: 2
type: UnansweredQuestion
has title: Add an Editor for script to run, then Remove them - temporary Editor permission
has answer: http://stackoverflow.com/a/28821820
score: 2
has comment: http://stackoverflow.com/comment/87645619
has body: I shared a spreadsheet with a sheet named "times". This sheet is range protected to other users, but them must view and have to sort it in several ways. I create some menus with menuEntries.push etc... wrote the scripts for sort this sheet in all the ways i need, but only people I set as administrator can sort using my menu. The others can't to do it cause they can't execute the script on range protected. I would like to grant permission to everybody only during the script exectuting, the code should sound something like this above ( that don't works ) function Editors() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var targetSheet = ss.getSheetByName("times"); var user = SpreadsheetApp.getActive().getEditors(); var permission = targetSheet.getSheetProtection(); permission.addUser(user); SpreadsheetApp.flush(); var tableRange = "orario!b7:ap209"; var tableRange = "times"; var range = ss.getRange(tableRange); range.sort( { column: 2, ascending: true } ); permission.removeUser(user) targetSheet.setSheetProtection(permission) } ...if someone can help me .... thanks in advance....
linked to: http://stackoverflow.com/q/28778327
type: Question
tagged with: google-apps-script
has comment: http://stackoverflow.com/comment/45850623
tagged with: google-sheets
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28787582

http://stackoverflow.com/a/28699943
accepted answer of: http://stackoverflow.com/q/28698825
has comment: http://stackoverflow.com/comment/45690376
upvote count: 2
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/45690472
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28698825
has body: In my opinion there are multiple problems in your code. First of all, it's not a matter of binding and unbinding events, it's a problem of rebinding a new click event each time you call your fill method, you should extract your click listener from this function. conception problem :) You also shouldn't check the presence of data-state, but instead you should check its value, more efficient. $( document ).ready( function() { var q = []; q[1] = [3, "1", "Musik", "Welches Hotel ist sehr musikalisch?", "Hotel California", "Riu Hotel", "Tokio Hotel", "Hotel Mama"]; q[2] = [2, "1", "Musik", "Was sitzt in einer Konservendose, singt und liest Nachrichten vor?", "ein Schwammoli", "ein Radioli", "ein Tivoli", "ein Tivoli"]; q[3] = [4, "1", "Musik", "dd", "ein Schwammoli", "ein Radioli", "ein Tivoli", "ein Tivoli"]; var fill = function( data ) { $( "#number" ).html( data[1]); $( "#cat" ).html( data[2]); $( "#ques span" ).html( data[3]); $( "#answ .answ:nth-child(1) button" ).html( data[4]); $( "#answ .answ:nth-child(2) button" ).html( data[5]); $( "#answ .answ:nth-child(3) button" ).html( data[6]); $( "#answ .answ:nth-child(4) button" ).html( data[7]); $( "#answ .answ button" ).attr( "data-state", "0" ); $( "#answ .answ:nth-child(" + data[0] + ") button" ).attr( "data-state", "1" ); } var clear = function() { $( "#answ .answ button" ).removeAttr( "class" ); $( "#answ .answ button" ).removeAttr( "data-state" ); } var count = 1; function next() { clear(); fill( q[count] ); count++; } next(); $( "#answ" ).on('click', '.answ button', function(){ var button = $(this); console.log(button.attr( "data-state" )); if(button.hasClass('clicked')){ newClass = ( 1 == button.attr( "data-state" ) ) ? 'good' : 'bad'; button.removeClass('clicked').addClass(newClass); setTimeout( next, 3000 ); } else { button.addClass('clicked'); } }); }); Working demo here :)
has comment: http://stackoverflow.com/comment/45690399

http://stackoverflow.com/comment/65623982
type: Comment
type: QuestionComment
has text: This [possible duplicate](http://stackoverflow.com/questions/6038613/get-the-duration-of-a-touch-in-javascript) has answers with code (partially using JQuery).
score: 0
comment on: http://stackoverflow.com/q/28706231

http://stackoverflow.com/comment/45651330
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28679129
has text: I am still think that the second call is happing prior to the function being called.

http://stackoverflow.com/q/28723049
answer count: 5
has comment: http://stackoverflow.com/comment/45733089
has answer: http://stackoverflow.com/a/28723440
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28723413
has answer: http://stackoverflow.com/a/28723364
upvote count: 1
has title: Array.splice inside a for loop causing errors
has body: im using Angular ng-repeat to display $scope.currentMessageList array i also have a remove button bound via ng-click to the remove function, which looks like this: remove: function () { for (var i = 0; i &lt; 25; i++) { var index = i; $scope.currentMessageList.splice(index, 1); console.log($scope.currentMessageList.length + 'left'); } } There are 25 items in this collection, when I call the remove function, I get this output: 24left 23left 22left 21left 20left 19left 18left 17left 16left 15left 14left 13left 13times X 12left If I replace the for loop with angular.forEach I get "12 left" only once, still it doesn`t remove more than 13 items Ive also tried to use angular.apply, than I get digest already in progress error
type: Question
possible better answer: http://stackoverflow.com/a/28723364
tagged with: javascript
has answer: http://stackoverflow.com/a/28723428
linked to: http://stackoverflow.com/q/1232040
has answer: http://stackoverflow.com/a/28723413
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45733191
has comment: http://stackoverflow.com/comment/45733308
has answer: http://stackoverflow.com/a/28723377

http://stackoverflow.com/a/28733898
has comment: http://stackoverflow.com/comment/45757592
type: Answer
accepted answer of: http://stackoverflow.com/q/28728614
answers question: http://stackoverflow.com/q/28728614
has body: What you are asking for is NOT possible without a browser-specific plugin that runs on the client machine itself (which an ActiveX control does). ActiveX is primarily an InternetExplorer-only technology, however there have been plugins in the past to add ActiveX support to other browsers. Not sure any of them have survived over time. But either way, ActiveX is a Windows-only technology, so it won't work on other platforms. The current trend in browser technology is to try moving AWAY from plugins as much as possible, relying on features built-in to HTML5 and JavaScript themselves instead. AFAIK, the only cross-browser solution I can think of is using a signed Java applet to load a DLL via JNI: Load .DLL with applet and use it on client However, Java applets are not very popular anymore in lieu of Flash and HTML5, and even some browsers disable Java by default nowadays. So I don't think it is a very viable solution if you are trying to target a wide audience. But for an isolated audience, it may be a viable option.
upvote count: 3
score: 3
has comment: http://stackoverflow.com/comment/45758256
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45759833

http://stackoverflow.com/comment/45589258
comment on: http://stackoverflow.com/a/28645022
type: Comment
score: 0
type: AnswerComment
has text: I mean, sometimes it _does_ make sense to leave content struck out, but probably only for the cases when a popular correct answer becomes obsolete.

http://stackoverflow.com/a/28604629
upvote count: 3
answers question: http://stackoverflow.com/q/28604512
accepted answer of: http://stackoverflow.com/q/28604512
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45514135
downvote count: 0
has body: If you know the path to the images from the site root you can do the following in MVC: @Url.Content("~/images/my-image.jpg") The "~/" will map from the site root. EDIT: If you're working within a JS file and struggling with relative paths maybe you could add a 'basepath' variable to the top of the file and work with that: var basePath = "http://www.mywebsite.com/images"; Then in your code, your image URL returned would be something like: var imgUrl = basePath + "/my-image.jpg";
has comment: http://stackoverflow.com/comment/45514198
type: Answer
score: 3

http://stackoverflow.com/comment/45537489
type: Comment
has text: Now I need to figure out how to loop this behaviour. Forcing the animation to start again after 1'30''. I know it's asking for too much but would you be so kind to help me with that one?
type: AnswerComment
comment on: http://stackoverflow.com/a/28617061
score: 0

http://stackoverflow.com/comment/45538287
score: 0
type: Comment
type: QuestionComment
has text: @Nit I just fixed it.
comment on: http://stackoverflow.com/q/28617041

http://stackoverflow.com/a/28652189
has comment: http://stackoverflow.com/comment/45616316
has body: If canEdit is not going to change after the initial assignment then you can use a one time bind introduced in angular 1.3. ng-show="::canEdit". https://docs.angularjs.org/guide/expression If you really want to group the &lt;li&gt; tags then you will need to wrap them in an html element and put the ng-show on it I don't think you need to worry about too many watchers though. I believe (though am not certain) that angular will only assign a single watcher to canEdit as it is a single variable that is being bound in multiple locations
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28651924

http://stackoverflow.com/comment/45700703
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28705503
has text: If you can see a each in my posted source than I do, otherwise I don't. :) I posted all I'm using. That's the wired thing about it.

http://stackoverflow.com/q/28677363
type: AnsweredQuestion
score: 1
type: Question
accepted answer: http://stackoverflow.com/a/28677537
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I have the following code also in jsfiddle: http://jsfiddle.net/n3pdahtv/ $(document).ready(function(){ $("#somebox").bootstrapSwitch(); $("#somebox").bootstrapSwitch().on("switchChange.bootstrapSwitch", function (event, state) { alert("Switch pressed"); }); }); &lt;input type="checkbox" name="somebox" id="somebox" value="40" data-size="mini" data-handle-width="55" data-label-width="30" data-on-text="active" data-off-text="inactive" checked&gt; The problem is that when you click on the white area inbetween "active" and "inactive" the switch doesn't visually move from one side to the other. The event fires the alert regardless. The switch is taken from this website (http://www.bootstrap-switch.org/) and I have the bootstrap/jquery/bootstrap-switch references in the head section. The examples from that website work when you click on the white area but I have no idea why...
favorite count: 0
has title: Bootstrap Switch fires switchChange event but doesn't visually change
has answer: http://stackoverflow.com/a/28677537
tagged with: http://stackoverflow.com/tag/html
tagged with: css
downvote count: 0
tagged with: twitter-bootstrap

http://stackoverflow.com/comment/45557134
comment on: http://stackoverflow.com/q/28627189
score: 1
has text: No, that `size` method that you create in `methods` is never accessing the any local variables. Those `size` variables in `circles()` or `lines()` are not local either due to coffeescripts scoping rules. It *always* refers to the global variable you've created.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45724420
has text: have you tried anything from your side?
comment on: http://stackoverflow.com/q/28718744
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28603232
tagged with: resize
tagged with: browser
score: 0
has answer: http://stackoverflow.com/a/28603621
answer count: 1
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/7022787
has title: Resizing Browser Window
type: Question
has body: Is there any JS or html script to resize browser window after click on ahref link? Site1: Window (750x400px) ---click and resize---> Site2: Window (full size)
tagged with: javascript

http://stackoverflow.com/comment/45655786
has text: $("#results").text(data); <- remove this and it should work
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28681512
score: 2

http://stackoverflow.com/q/28611780
score: -3
downvote count: 3
type: Question
has answer: http://stackoverflow.com/a/28612079
has title: How to generate random number between any four numbers in javascript?
tagged with: javascript
has comment: http://stackoverflow.com/comment/45527472
answer count: 3
upvote count: 0
has answer: http://stackoverflow.com/a/28611914
favorite count: 0
has body: How to generate random number between any four numbers??? For example, I have these four numbers: 1,3,7,9 and the random number I want must be one of these numbers. Can anyone please tell me how to do it in JavaScript???
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28611980

http://stackoverflow.com/a/28749764
has comment: http://stackoverflow.com/comment/45781474
has comment: http://stackoverflow.com/comment/45782334
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45781898
has comment: http://stackoverflow.com/comment/45782536
has comment: http://stackoverflow.com/comment/45782874
type: Answer
has comment: http://stackoverflow.com/comment/45782780
accepted answer of: http://stackoverflow.com/q/28749471
answers question: http://stackoverflow.com/q/28749471
score: 10
has comment: http://stackoverflow.com/comment/45782984
has comment: http://stackoverflow.com/comment/45783124
upvote count: 10
has body: Like this; var DataSchema = new Schema({ properties: { title: { type: String, required: true }, description: { type: String, required: true }, date: { type:Date, default:Date.now } }, geometry: { coordinates: { type: [Number], index: '2dsphere'} } }); Here is your update route handler, it converts coordinates string to number array; app.post('/mountain_rescue', function (req, res) { new rescueData({ properties: { title: req.body.title, description: req.body.description }, geometry: { coordinates:req.body.coordinates.split(',').map(Number) } }).save(function (e, result) { console.log(result); }); res.redirect('/mountain_rescue'); });

http://stackoverflow.com/comment/45595695
type: AnswerComment
has text: just to test, if you put "localhost.../mainmenu" in your browser when running ionic serve, does that load up the correct page?
type: Comment
comment on: http://stackoverflow.com/a/28640227
score: 0

http://stackoverflow.com/comment/45596027
comment on: http://stackoverflow.com/q/28648468
score: 0
type: QuestionComment
type: Comment
has text: @FaresM, I have been watching the console and I have noticed that when I get these errors that it is always after an AJAX call. Should I be looking at the AJAX call itself as a possible source of the error?

http://stackoverflow.com/q/28728994
has title: Multiple Instances of bxslider inside ng-repeat
tagged with: angularjs-directive
has answer: http://stackoverflow.com/a/28729517
accepted answer: http://stackoverflow.com/a/28729517
tagged with: javascript
upvote count: 2
answer count: 1
tagged with: angularjs-ng-repeat
has body: I have created directive to load the bxslider because of the ng-repeat issue with it. Problem : Multiple Instances of bxslider is generated because of ng-repeat over the directive. When i am trying to wrap that div inside a another ng-repeat i am getting multiple instance of bxslider created one over the other. JSFIDDLE: http://jsfiddle.net/z27fJ/15/ APP.JS var app = angular.module('myApp', []); app.directive('startslider',function() { return { restrict: 'A', replace: true, template: '&lt;ul class="bxslider"&gt;' + '&lt;li ng-repeat="picture in pictures"&gt;' + '&lt;img ng-src="{{picture.src}}" alt="" /&gt;' + '&lt;/li&gt;' + '&lt;/ul&gt;', link: function(scope, elm, attrs) { elm.ready(function() { $("." + $(elm[0]).attr('class')).bxSlider({ mode: 'fade', autoControls: true, slideWidth: 360, slideHeight:600 }); }); } }; }); app.controller('MainCtrl', function($scope) { $scope.base = 'http://bxslider.com'; $scope.pictures = [ {src: $scope.base + '/images/730_200/hill_fence.jpg' }, {src: $scope.base + '/images/730_100/tree_root.jpg' }, {src: $scope.base + '/images/730_150/me_trees.jpg' } ]; }); HTML : &lt;div class="a" ng-repeat="t in [1,2,3]"&gt; &lt;div startslider&gt;&lt;/div&gt; &lt;/div&gt; I have tried to search for similar questions and had no luck with that. Any help will be really appreciated and Thanks for your time.
favorite count: 0
tagged with: angularjs
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: bxslider
type: Question

http://stackoverflow.com/comment/45530317
comment on: http://stackoverflow.com/a/28612029
type: AnswerComment
score: 0
has text: in that case you could use an attribute directive, that directive can receive a parameter indicating which permission it needs to check, then your directive should use a service to verify the permission on the server, when you receive the response, either show or hide the element. Keep in mind that to make it really secure, your server should return only the html (template) that the user has access, so you keep your security check entirely on the server.
type: Comment

http://stackoverflow.com/q/28618281
type: UnansweredQuestion
score: 2
downvote count: 0
tagged with: javascript
type: Question
has title: Device orientation - headtracker
has answer: http://stackoverflow.com/a/35119696
favorite count: 0
upvote count: 2
tagged with: device-orientation
answer count: 1
has body: if(window.DeviceOrientationEvent) { window.addEventListener('deviceorientation', function(event) { var alpha = event.alpha; } So, I need to get value from 0-180 for servo. I have thought about something like this alpha = 90+ (absolutely_first_value_from_event.alpha-event.alpha); And my problem is, that I don't know how to get only first value from event.alpha ... code isn't complete becouse I just need help with getting and storing first value from event.alpha Thank you for reply

http://stackoverflow.com/q/28656675
tagged with: ajax
has comment: http://stackoverflow.com/comment/45611842
has answer: http://stackoverflow.com/a/28658655
type: UnansweredQuestion
has body: I'm using the loop to create array of elements(links) and then attaching them with event handlers(one function for all) and adding to the DOM. But event handler react only then I click on the last link. Code: xGetUsers = new XMLHttpRequest(); xGetUsers.open("GET","dialogs.php",true); xGetUsers.send(); xGetUsers.onreadystatechange = function(){ if (xGetUsers.readyState==4 && xGetUsers.status==200){ var jUsers=eval("("+xGetUsers.responseText+")"); if(jUsers){ var length = jUsers.length; var dialogLink = []; for(var i=0; i<length; i++) { dialogLink[i] = document.createElement("a"); dialogLink[i].innerHTML = "Go dialog"; dialogLink[i].usrn = jUsers[i][0]; dialogLink[i].userID = parseInt(jUsers[i][3]); dialogLink[i].id = i; dialogLink[i].onclick = getDialog; var userinfo = ' '+jUsers[i][0]; if(jUsers[i][1]!=0) userinfo += '('+jUsers[i][1]+')'; userinfo += ' '+jUsers[i][2]+' '; main_div.innerHTML += userinfo; main_div.appendChild(dialogLink[i]); } } } } } getDialog() function: function getDialog(){ enduser_id = this.userID; enduser_name = this.usrn; main_div.innerHTML = ' Send '; xLoadMessages.open("GET","get_messages.php?get_id="+enduser_id,true); xLoadMessages.send(); field = document.getElementById("resz"); document.getElementById("send_button").onclick = function(){ if(field.value!=""){ var message="id="+enduser_id+"&message="+field.value; xSendMessage.open("POST","add_message.php",true); xSendMessage.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xSendMessage.send(message); } return false; } setTimeout(setRefresh, 3000); return false; } It react only on last link. I searched for a long time and tried different ways for adding event handler but nothing helped. Help please(.
has title: Javascript attaching event handler in loop
has comment: http://stackoverflow.com/comment/45611532
has comment: http://stackoverflow.com/comment/45610664
type: Question
has comment: http://stackoverflow.com/comment/45611086
score: 0
has comment: http://stackoverflow.com/comment/45611134
answer count: 1
tagged with: javascript
tagged with: dom-events

http://stackoverflow.com/comment/45708438
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28709212
has text: Put your code up on jsfiddle or something similar and point me at it.
type: AnswerComment

http://stackoverflow.com/q/28716476
tagged with: google-maps
answer count: 1
tagged with: jquery
tagged with: ajax
has title: Ajax call to an API return error HTTP/1.1 405 Method Not Allowed
has answer: http://stackoverflow.com/a/28717731
type: AnsweredQuestion
has body: I wrote a very simple application (on page) which has a map where users can draw circles on it. The first circle is Source and the next circles would be destinations. I have to make an Ajax call to an API URL in order to get all the cell Ids inside the circles that user drew on the map. Here is what I have tried till now: Drawing tools Please select your source place by using drawing tools on the map. Now you can select one or more destination on the map using the same drawing tools Run Code My problem: When I draw a circle on the map, I see this error on the console: OPTIONS https://api.dandelion.eu/datagems/v2/SpazioDati/milano-grid/data [HTTP/1.1 405 Method Not Allowed 350ms] and when I click on it, I see this: I would appreciate all your ideas, Thanks
type: Question
accepted answer: http://stackoverflow.com/a/28717731
tagged with: javascript
score: 0
tagged with: cors
has comment: http://stackoverflow.com/comment/45720547

http://stackoverflow.com/q/28723751
has body: In one of my applications in order to simplify logic / heavy db stuff I created a mechanism that relies on the javascript bitwise '&amp;' operator. However this seems to act weird in some occasions. 1 &amp; 0 =&gt; 0; 11 &amp; 00 =&gt; 0; 111 &amp; 000 =&gt; 0; 111 &amp; 100 =&gt; 100 everything ok so far.. but when I try to do this: 1100 &amp; 0011 =&gt; 8 ; 1100 &amp; 1111 =&gt; 1092 I get weird results, instead of 0 or 1100. I found out that this happens due to some 'javascript interpretation in a specific base' stuff, however I wonder if there is a solution to this.
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28723843
answer count: 3
tagged with: bitwise-and
has answer: http://stackoverflow.com/a/29260562
has comment: http://stackoverflow.com/comment/45734376
has answer: http://stackoverflow.com/a/28723947
tagged with: binary
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45734400
type: Question
tagged with: bitwise-operators
has title: javascript bitwise and yielding weird results

http://stackoverflow.com/comment/45498942
type: QuestionComment
type: Comment
has text: What line of code is giving you that error? (Also, is it really "object not found"? That's a weird error.) Their might be no `.trim()` function on the String prototype in IE8.
comment on: http://stackoverflow.com/q/28596095
score: 0

http://stackoverflow.com/comment/45533858
score: 0
type: AnswerComment
type: Comment
has text: Yes! Simon, Just a little correction, I added ^ in front of the expression, only to match those items that start with the given expression. But This works great! http://jsfiddle.net/hjcvtqzh/10/ I'll mark yours as answer, I guess If you wanna edit it with this solution?
comment on: http://stackoverflow.com/a/28614436

http://stackoverflow.com/comment/103184441
has text: @TempO'rary in your click handler set some state which is the id or index of the clicked item, then in render, render the alternate class if the current item is the clicked item.
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28732295

http://stackoverflow.com/comment/45547553
type: Comment
comment on: http://stackoverflow.com/a/28622886
has text: That just resulted in the literal _tag[tagk]_ in my resulting source, the compiler isn't translating the tagk to the actual value (in this case host/user/method).
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45540802
score: 0
type: Comment
type: QuestionComment
has text: Show the php output to be able to help you more
comment on: http://stackoverflow.com/q/28618820

http://stackoverflow.com/q/28716774
tagged with: jquery
has title: jQuery autocomplete UI - doesn't work
favorite count: 0
has comment: http://stackoverflow.com/comment/45721464
downvote count: 0
type: Question
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/45721229
has answer: http://stackoverflow.com/a/28717048
accepted answer: http://stackoverflow.com/a/28717048
upvote count: 1
answer count: 1
has body: I am trying to make an autocomplete widget that will display item's codes returned from a database. I have successfully made it so my database will return the appropriate JSON response. The problem now is I don't know why the drop-down list doesn't show up. Here's the code down below: &lt;input type="text" id="search" class="form-control" placeholder=""&gt; &lt;form action="post" action="" id="spareParts" class="spareparts"&gt; &lt;/form&gt; $('#search').keyup(function(event) { var search = $(this).val(); if($.trim(search).length){ var arr = []; $.ajax({ url: 'get_spareparts', type: 'POST', dataType: 'JSON', data: {item: search}, success: function (data) { arr = $.parseJSON( data ); console.log(arr);// CONSOLE.LOG WORKS WELL //[Object { id="1", value="25.00", desc="Fuel pump", more...}] // AUTOCOMPLETE DOESN'T WORK $('#spareParts').autocomplete({ minLength:0, source: arr }); } }); } });
tagged with: javascript

http://stackoverflow.com/a/34281655
answers question: http://stackoverflow.com/q/28620479
has body: A simpler, cleaner and more readable solution. class ClipBoardText { constructor() { console.log('constructor'); this.restrict = 'A'; this.controller = ClipBoardTextController; } link(scope, element, attr, ctr) { console.log('ctr', ctr); console.log('ZeroClipboard in link', ctr.ZeroClipboard); console.log('q in link', ctr.q); } static directiveFactory() { return new ClipBoardText(); } } // do not $inject like this // ClipBoardText.$inject = ['$q']; class ClipBoardTextController { constructor(q) { this.q = q; this.ZeroClipboard = 'zeroclipboard'; } } ClipBoardTextController.$inject = ['$q']; export default ClipBoardText.directiveFactory; You cannot get $q in link function, this in link will be undefined or null. exploring-es6-classes-in-angularjs-1-x#_section-factories when Angular invokes the link function, it is no longer in the context of the class instance, and therefore this.$interval will be undefined So make use of the controller function in the directive, and inject dependencies or anything that you want to access in the link function.
has comment: http://stackoverflow.com/comment/68068174
upvote count: 21
has comment: http://stackoverflow.com/comment/61638489
type: Answer
downvote count: 0
score: 21

http://stackoverflow.com/comment/45682030
type: QuestionComment
has text: @IvanSivak sent the same, but no debugger got attached server side
score: 0
comment on: http://stackoverflow.com/q/28695587
type: Comment

http://stackoverflow.com/comment/45521370
comment on: http://stackoverflow.com/q/28608659
type: Comment
type: QuestionComment
has text: Good spot. Thank you
score: 0

http://stackoverflow.com/q/28601350
score: 3
has comment: http://stackoverflow.com/comment/45508443
upvote count: 3
has body: I have searched and found out code snippet for getting a value for particular field in a PDF using javascript in Acrobat. But I need to get all fields as key-value pair in javascript. I tried some of the code but it won't work for me. if(this.hostContainer) { var names = new Array(); names[0] = this.getField("personal.name").value.toString(); names[1] = this.getField("personal.loginname").value.toString(); try{ this.hostContainer.postMessage(names); } catch(e){ app.alert(e.message); } } PDF file looks like below, Name : x (editable) Age : 36 (editable) Sex : male (editable) But the form fields in PDF may vary.
type: Question
downvote count: 0
has title: How to get all key-value pairs of a PDF form fields using javascript in Acrobat?
tagged with: javascript
has answer: http://stackoverflow.com/a/28612071
answer count: 1
tagged with: acrobat
favorite count: 0
has comment: http://stackoverflow.com/comment/45508559
has comment: http://stackoverflow.com/comment/45508587
has comment: http://stackoverflow.com/comment/45508776
type: UnansweredQuestion

http://stackoverflow.com/q/28682265
tagged with: node.js
has comment: http://stackoverflow.com/comment/45657616
possible better answer: http://stackoverflow.com/a/28682385
score: 0
has answer: http://stackoverflow.com/a/28682348
accepted answer: http://stackoverflow.com/a/28682348
has comment: http://stackoverflow.com/comment/45681327
answer count: 3
has comment: http://stackoverflow.com/comment/45657480
has comment: http://stackoverflow.com/comment/45659603
tagged with: javascript
has comment: http://stackoverflow.com/comment/45681584
has comment: http://stackoverflow.com/comment/45681354
has comment: http://stackoverflow.com/comment/45681442
has answer: http://stackoverflow.com/a/28695626
has title: Node.js / Is for loop is Async?
type: AnsweredQuestion
has body: I have the following code: for (var i = 0; i &lt; files.length; i++) { var data = fs.readFileSync(files[i]); fs.appendFileSync("file_part", data); } Let's say I have 1000 files. Is it the for loop async? Or My application will wait until it will finish the process? If it sync, how I make it async? so each iterate will be async? Edit: This code is part of a server code, using express. We get a lot of https request, and serves the client. One of the operation is to appends files of 1MB to one big file. The server should return 200 if the operation success, 500 otherwise. The problem is that if the code above (the for loop) is executed, The express module stop serving other clients, and it "busy" with this request. I try to use async.eachSeries (because the order of the files has a meaning, so I have to use Series method), but it still stucks the server.
tagged with: asynchronous
linked to: http://stackoverflow.com/q/28087624
type: Question
has answer: http://stackoverflow.com/a/28682385
has comment: http://stackoverflow.com/comment/45681677
has comment: http://stackoverflow.com/comment/45657570

http://stackoverflow.com/comment/45679467
comment on: http://stackoverflow.com/a/28694256
has text: I edited my answer. You need to replace the original one with custom. @user2585622
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/95100217
comment on: http://stackoverflow.com/a/28675939
score: 0
type: AnswerComment
type: Comment
has text: Which version of jQuery you are using? Can you share your code?

http://stackoverflow.com/comment/45664804
comment on: http://stackoverflow.com/q/28685645
type: QuestionComment
type: Comment
has text: Might pay to write your jQuery properly, i.e. put your function declaration inside `$(document).ready()` and remove the onclick handler on the element in favour of a class e.g. "myclass" then assign a click handler in your document ready block e.g. `$('.myclass').click(dothis);`
score: 3

http://stackoverflow.com/comment/45775328
type: QuestionComment
has text: You've closed your table tag, this will break your markup. Move the to under the last
score: 1
comment on: http://stackoverflow.com/q/28746524
type: Comment

http://stackoverflow.com/q/28625914
tagged with: jquery
has answer: http://stackoverflow.com/a/28625997
has answer: http://stackoverflow.com/a/28625940
score: 0
has answer: http://stackoverflow.com/a/28625987
has title: jQuery Optimization - Dry
answer count: 4
tagged with: datedropper
tagged with: dry
has answer: http://stackoverflow.com/a/28625933
accepted answer: http://stackoverflow.com/a/28625933
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/13083106
has body: I've this simple situation: $("#check-in").dateDropper({ years_multiple: "10", format: "d-m-Y", minYear: "2015", maxYear: "2016", lang: "pt", animation: "bounce", placeholder: "Dia da entrada." }); $("#check-out").dateDropper({ years_multiple: "10", format: "d-m-Y", minYear: "2015", maxYear: "2016", lang: "pt", animation: "bounce", placeholder: "Dia da saída." }); The only difference is placeholder: "...". How can I optimize this code to not be repetitive (DRY)?
type: Question
possible better answer: http://stackoverflow.com/a/28625940
tagged with: javascript

http://stackoverflow.com/q/28638455
type: Question
has title: Fabric.js adding simple path not working
score: 0
has body: I'm trying to create a simple path object using Farbic.js. When the path is added to canvas, it does not appear to be positioned correctly. Here is my code: HTML &lt;canvas id="c" height="300" width="300"&gt;&lt;/canvas&gt; JS var canvas = new fabric.Canvas('c'); canvas.backgroundColor = '#f5f5f5'; var line = new fabric.Path('M 0 0 L 100 100',{ stroke: 'black', fill: '' }); canvas.add(line); According to the data I'm passing in, the path should start at point 0,0 and draw a line to point 100, 100. However, my line is actually being placed at point 50,50, as you can see by the alert. Why isn't the path starting at point 0,0? Here's a fiddle: http://jsfiddle.net/flyingL123/h14th5pf/3/
answer count: 1
has answer: http://stackoverflow.com/a/28638621
tagged with: fabricjs
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/8812086
tagged with: javascript

http://stackoverflow.com/q/28643775
favorite count: 0
tagged with: sequelize.js
answer count: 0
has comment: http://stackoverflow.com/comment/45594978
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/49813734
tagged with: node.js
score: 2
has comment: http://stackoverflow.com/comment/56337518
has title: Promise doesn't return from sequelize model instance method
type: Question
has body: Whenever I call my instance method, the promise is never returned. Instead, it is always undefined. // user model ... instanceMethods: { verifyPassword: function(password, done) { return bcrypt.compare(password, this.password, function(err, res) { return done(err, res); }); } }, Test: models.user.find(1).then(function(user) { return user.verifyPassword(password, function(error, result) { if(result) return models.item.create(....); }); }).catch(function(e) { console.log(e); }); Now, if the user enters a valid password but the item.create() fails, the error will NOT propagate back up to the outercatch() block. Instead, the program fails with: Possibly unhandled SequelizeValidationError: Validation error The problem is with verifyPassword() somehow not returning the promise. If I remove verifying, then everything will work; all errors are then caught in the catch(). Why does user.verifyPassword() only give undefined?
downvote count: 0
tagged with: javascript
tagged with: express

http://stackoverflow.com/comment/45517928
comment on: http://stackoverflow.com/a/28606806
score: 0
type: AnswerComment
type: Comment
has text: @MarcRasmussen Where're you calling your login function? If you do it from a directive, ie from `ngClick` f.x., you have to define it as an attribute on the scope. `$scope.login = login;`.

http://stackoverflow.com/a/28700125
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28699890
type: Answer
downvote count: 0
score: 1
has body: keydown and keypress will give you different values for event.keyCode. I guess you have to use keydown instead. Look this Keyevent Tester I just tested your code with keydown and keypress events: ... var showSearcherCustomerKeyCommand = function (event) { if (event.shiftKey &amp;&amp; event.keyCode == 49) { alert("Combination done ! (Fired by keydown event)"); } }; window.onkeydown = showSearcherCustomerKeyCommand; // alert 49 window.onkeypress = showSearcherCustomerKeyCommand; // alert 33 And... event will be the first parameter passed to your function. http://jsfiddle.net/01teg8yL/2/
accepted answer of: http://stackoverflow.com/q/28699890

http://stackoverflow.com/a/28660358
answers question: http://stackoverflow.com/q/28660281
score: 0
type: Answer
has body: I don't know python, but I guess the JavaScript equivalent is function data_validation(str) { if (str.length == 7 || str.length == 6) return /[0-9]{3}\/[0-9]{2,3}/.test(str); }

http://stackoverflow.com/a/28646226
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28645162
type: Answer
accepted answer of: http://stackoverflow.com/q/28645162
upvote count: 1
score: 1
has body: Note that in the Javascript SDK, save() is an async method which returns a promise (https://parse.com/docs/js/symbols/Parse.Object.html#save). In your code, response.success() is probably returning before the save() operation has been completed on all objects. Parallel Promises I would solve this by using parallel promises (You could also try an approach using serial promises, or using the saveAll method): var query = new Parse.Query("Profiles"); query.equalTo("user", request.object.get("user")); query.find().then(function(results) { var promises = []; for (var i = 0; i &lt; results.length; i++) { var pro = results[i]; pro.set("isDefault", false); promises.push(pro.save()); } return Parse.Promise.when(promises); }).then(function(result) { response.success(); },function(error){ response.error(); }); SaveAll Here is a solution using the saveAll method. According to the Parse JS docs, saveAll() doesn't return a promise. So the syntax here gets a little messy (I don't like mixing promises as I've done here, but I didn't want to modify your original code too much). var query = new Parse.Query("Profiles"); query.equalTo("user", request.object.get("user")); query.find().then(function(results) { for (var i = 0; i &lt; results.length; i++) { var pro = results[i]; pro.set("isDefault", false); } Parse.Object.saveAll(results, { success: function(list) { response.success(); }, error: function(error) { response.error(); } }); }, function(error){ response.error(); });

http://stackoverflow.com/a/28643613
score: 0
has body: You have some implementations which work in client and server side: Elemental Json is an entire implementation in java which works in server and client sides, take a look to its test cases to figure out how it works. It is very light weight and makes use of browser native optimisations in client side. GwtQuery has a data binding implementation for json objects. It works in both sides and performs very well. Just define an interface extending JsonBuilder and you can share it in server and client. Take a look to this test class to see the usage or to its documentation. BTW gquery uses elemental json in order not to depend on the controversial json.org library. Finally the classical AutoBeans in GWT is an option to handle JSON and bind it to POJOs. IMO it needs so much boiler-plate code.
answers question: http://stackoverflow.com/q/28630297
type: Answer

http://stackoverflow.com/q/28736704
type: Question
tagged with: replace
answer count: 2
accepted answer: http://stackoverflow.com/a/28736809
tagged with: arrays
downvote count: 0
tagged with: javascript
has title: Ruby - arrays check for and replace with
has body: Given: check_for = ["Lorem", "ipsum", "dolor", "sit", "amet"] replace_with = ["Donec", "ut", "libero", "sed", "arcu"] sentence = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur." How can I check the entire string in 'sentence' if it contains the words placed in the array 'check_for' and if they are found, replace with the words in 'replace_with'? Words in check_for can be replaced with words in replace_with with the same index: check_for[idx] should be replaced with replace_with[idx] I've done something "similar" with Javascript using nested loops. For some reason this isn't working with Ruby. My idea with nested loops was to split sentence into array and using while loops with i and j. So sentence[i] would start at 0: sentence[i] == check_for[j] then: sentence[i] = replace_with[j] Aside from this idea not working, I'm certain there is a more straight forward way in Ruby. Case insensitive is ok.
has answer: http://stackoverflow.com/a/28742106
favorite count: 0
tagged with: ruby
possible better answer: http://stackoverflow.com/a/28742106
has answer: http://stackoverflow.com/a/28736809
type: AnsweredQuestion
score: 1
upvote count: 1
tagged with: loops

http://stackoverflow.com/comment/45750739
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28732214
has text: You can try for a [CSS solution](http://stackoverflow.com/q/18813299/2030565) which I find preferable to hooking into javascript events.

http://stackoverflow.com/comment/45582967
has text: @ArnaldoIgnacioGasparVéjar Ah, nice :) I included `isMatch` in my answer. Thanks :)
comment on: http://stackoverflow.com/q/28632281
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45574376
has text: It's not clear what you want. Do you want to obtain `[12, 4]` as result – where the first item is the largest first item in the "parent"'s array – or do you want to sort all the values using the first item as index? To be clear, in the second case you just sort the original array, so you would obtain another multi-dimensional array as result.
score: 0
comment on: http://stackoverflow.com/a/28635565
type: Comment
type: AnswerComment

http://stackoverflow.com/q/28693256
has title: CartoDb + Google Maps Polygon
score: 0
has body: I am using cartodb(google map) to draw polylines and then inserting a polygon in google maps. The problem is, two maps load, on top of each other. One with the cartodb polylines and one with the polygon. I need them to be on the same map. Not sure what I am doing wrong. function main() { var map; var sql; // sql query object for querying CartoDB SQL API var sublayers = []; // create google maps map var mapOptions = { zoom: 12, center: new google.maps.LatLng(26.178347,50.6116694), mapTypeId: google.maps.MapTypeId.HYBRID, panControl: true, panControlOptions: { position: google.maps.ControlPosition.TOP_RIGHT }, zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.LARGE, position: google.maps.ControlPosition.TOP_RIGHT }, }; map = new google.maps.Map(document.getElementById('map'), mapOptions); // create layer and add to the map, then add some interactive elements cartodb.createLayer(map, 'http://zbahrain.cartodb.com/api/v2/viz/f5073bec-b841-11e4-b79c-0e4fddd5de28/viz.json') .addTo(map) .on('done', function(layer) { var subLayerOptions = { sql: "SELECT * FROM roadscomplete where block = '525'"} var sublayer = layer.getSubLayer(0); sublayer.set(subLayerOptions); sublayers.push(sublayer); sublayer.on('error', function(err) { cartodb.log.log('error: ' + err); }); }) .on('error', function() { cartodb.log.log("some error occurred"); }); map = new google.maps.Map(document.getElementById('map'), mapOptions); // Define the LatLng coordinates for the polygon's path. var triangleCoords = [ new google.maps.LatLng(26.1750729378,50.5527011926),new google.maps.LatLng(26.1750278514,50.5528370586),new google.maps.LatLng(26.1749037197,50.5527864969),new google.maps.LatLng(26.1749497896,50.5526475251),new google.maps.LatLng(26.1750711189,50.5526969966),new google.maps.LatLng(26.1750729378,50.5527011926), ]; // Construct the polygon. var bermudaTriangle = new google.maps.Polygon({ paths: triangleCoords, strokeColor: '#FFF', strokeOpacity: 0.8, strokeWeight: 2, fillC…
type: Question
tagged with: google-maps
tagged with: cartodb
has answer: http://stackoverflow.com/a/28693818
tagged with: javascript
answer count: 1
type: UnansweredQuestion

http://stackoverflow.com/comment/48539040
score: 0
type: Comment
has text: thank you this fixed my issue as well. Are you aware of any other solutions?
comment on: http://stackoverflow.com/a/28618965
type: AnswerComment

http://stackoverflow.com/a/28728974
score: -1
answers question: http://stackoverflow.com/q/28728865
downvote count: 1
upvote count: 0
has comment: http://stackoverflow.com/comment/45744232
type: Answer
has body: use this in jQuery $("input[type=checkbox]:not(:checked)").attr("value"); well for get and do some with all unchecked checkbox you can collect it into array... and send it on submit to server var aUnchecked = new Array(); $("input[type=checkbox]:not(:checked)").each(fucntoin(){ aUnchecked.push($(this).attr("name")); }

http://stackoverflow.com/comment/76515636
has text: This is the best way of doing that.
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/35492169

http://stackoverflow.com/comment/45692690
comment on: http://stackoverflow.com/a/28700154
type: AnswerComment
score: 0
type: Comment
has text: Good solution. Shame it makes the markup messy but at least its valid. _"The HTML Table Body Element ( ) defines one or more rows as the body of its parent element when no elements are children of the parent."_ https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tbody

http://stackoverflow.com/comment/45496737
type: Comment
comment on: http://stackoverflow.com/q/28594152
score: 0
has text: OK. What I was asking was more whether you are calling getDataFrom() directly in the controller function, or from your UI in some way. Is it called when the controller initializes, or, for example, when a button is clicked?
type: QuestionComment

http://stackoverflow.com/a/28761839
downvote count: 0
answers question: http://stackoverflow.com/q/28699834
has body: I finally get rid of my trouble by getting my xml content with ajax from jquery.
accepted answer of: http://stackoverflow.com/q/28699834
type: Answer
upvote count: 1
score: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/45770819
has text: Why not set it to max allowed width right from the start? Or expand it to that full width on focus
comment on: http://stackoverflow.com/q/28744017
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/70457921
score: 0
type: AnswerComment
has text: But, how to get grecaptcha.getResponse()?
type: Comment
comment on: http://stackoverflow.com/a/30591741

http://stackoverflow.com/q/28746348
has body: We have a baffling issue whereby when we try to open a modal dialog box from a parent page it opens with 2 vertical scrollbars next to each other. One controls the modal box, the other one controls the main page behind it. To have 2 scrollbars is not ideal and have tried to implement a solution for this. We added some javascript in the dialog box page which would set the style to overflow:hidden when the modal dialog is open. &lt;script&gt; function myOnLoad() { window.parent.$('body').css('overflow', 'hidden'); } and used.... &lt;body onload="myOnLoad()"&gt; This works and effectively removes the scrollbar in the page behind it (i.e it does what it should) however we also want to set the overflow back to ‘auto’ when the modal dialog is closed… We have done this by adding this code.. &lt;script type="text/javascript"&gt; // close Modal $("#close").click(function () { window.parent.$('body').css('overflow', 'auto'); window.parent.$("iframe").attr('src', ''); window.parent.$(".modalDialog").removeClass('show'); }); However this does not seem to work as the modal dialog closes but the scrollbar is still hidden on the main page. Can anyone tell me what I might be doing wrong here? I have tried different overflow properties but nothing seems to work
answer count: 3
has answer: http://stackoverflow.com/a/28746540
has title: 2 Scrollbars visible when I open a modal dialog
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
accepted answer: http://stackoverflow.com/a/28746684
tagged with: css
type: AnsweredQuestion
downvote count: 0
possible better answer: http://stackoverflow.com/a/28746540
score: 1
has answer: http://stackoverflow.com/a/28746684
has answer: http://stackoverflow.com/a/29362146
type: Question
has comment: http://stackoverflow.com/comment/45775213
tagged with: modal-dialog
has comment: http://stackoverflow.com/comment/45775349
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45569413
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28634502
has text: @A.Wolff, Thanks for the tips. But my issue is something else. I don't need to use onsubmit, I submit the form myself in code. I need to know when the request has completed, not when it's sent. :)
score: 0

http://stackoverflow.com/comment/45616453
has text: @DeniSpasovski It still says I have to wait an hour, so I'll accept it as soon as I can.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28635946

http://stackoverflow.com/q/28708798
tagged with: javascript
answer count: 3
accepted answer: http://stackoverflow.com/a/28708854
favorite count: 0
tagged with: hex
possible better answer: http://stackoverflow.com/a/28709657
has answer: http://stackoverflow.com/a/28709657
type: AnsweredQuestion
upvote count: 5
has answer: http://stackoverflow.com/a/56398373
has title: Does html5 canvas support hex colors with alpha?
has answer: http://stackoverflow.com/a/28708854
type: Question
has body: I was wondering If a square could be drawn in color #FF000000 then a circle inside of #00000000? This would be as drawing a square with black pixels then drawing over a circle with transparent pixels. As I understand hexadecimal colors basic are red, green, blue, but it looks like you can have a similar format as rgba but like argb in hex with 00 being totally transparent and FF being solid. It makes sense as in a png when you can have transparent pixels that the alpha value should also translate to the hex as a legitimate and manipulative value. Hex colors with 8 characters don't seem standard at all though (normally 6 long) as I have first seen them today on an android app and was wondering if they are (with want of better wording - please edit if unclear) legit. Is this a legit color #00000000? It would be invisible but black where-as this would be as I understand solid black: #FF000000;
tagged with: canvas
score: 5
downvote count: 0

http://stackoverflow.com/a/46291530
accepted answer of: http://stackoverflow.com/q/28610365
answers question: http://stackoverflow.com/q/28610365
has body: Use modern JavaScript! EventTarget.addEventListener("click", (event) => { // Do something cool }, {once : true}); A Boolean indicating that the listener should be invoked at most once after being added. If true, the listener would be automatically removed when invoked. - MDN web docs All modern browsers support this feature Other reference
type: AcceptedAnswer
upvote count: 143
score: 142
type: Answer
has comment: http://stackoverflow.com/comment/84153803
downvote count: 1

http://stackoverflow.com/a/28604789
answers question: http://stackoverflow.com/q/28604610
has comment: http://stackoverflow.com/comment/45515644
score: -1
has body: No need for ajax to check a form, why not just a few lines of javascript? Like "On click, if the 'e-mail' input field is empty, throw an alert" etc. There are many form validation plug-ins out there, like jQuery inline form validation, just google it. See : http://www.w3schools.com/js/js_validation.asp
upvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45515361
downvote count: 1

http://stackoverflow.com/a/28620487
score: 1
answers question: http://stackoverflow.com/q/28618570
has body: @Claies comment is correct. When you reference a template file in a directive, angular has to fetch it. It defers compilation and linking until after it loads the template. Your test is evaluating the outcome before the template has been fetched. You can include the template in a script tag or use the $templateCache.put() method to put the template in the cache manually before you run your test. beforeEach(ngModule('app.directives')); var scope, compile beforeEach(inject(function($rootScope, $compile, $templateCache){ scope = $rootScope.$new(); compile = $compile; $templateCache.put('downloadHeader.html', ' Hello World! '); })); it('Replaces the element with the appropriate content', function(){ var element = compile('<download-detail-header></download-detail-header>')(scope); expect(element.html()).to.equal(' Hello World! '); });
downvote count: 0
has comment: http://stackoverflow.com/comment/45543630
type: Answer
upvote count: 1

http://stackoverflow.com/a/28634390
accepted answer of: http://stackoverflow.com/q/28634019
has comment: http://stackoverflow.com/comment/45569473
answers question: http://stackoverflow.com/q/28634019
has comment: http://stackoverflow.com/comment/45568687
has comment: http://stackoverflow.com/comment/45569047
has comment: http://stackoverflow.com/comment/45569297
has comment: http://stackoverflow.com/comment/45569031
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45569184
has body: Try doing it like so: document.getElementById("enterInput").addEventListener("click", getInput ); function getInput() { var val = document.getElementById("inputLine").value; //do something with val document.getElementById("inputLine").value=""; return val; } See this demo Or to fetch it as a variable with getInput(): document.getElementById("enterInput").addEventListener("click", function(event){ var val = getInput(); alert(val); }); function getInput() { var val = document.getElementById("inputLine").value; document.getElementById("inputLine").value=""; return val; } See this demo
has comment: http://stackoverflow.com/comment/45568711
type: Answer
has comment: http://stackoverflow.com/comment/45568808

http://stackoverflow.com/comment/45670103
type: Comment
has text: Added at the top of my gulpfile.js just after i require('gulp') I Just add a var path = require(path);
comment on: http://stackoverflow.com/a/28688669
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45719292
has text: how? but u deleted ur answer
comment on: http://stackoverflow.com/q/28698141
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28705135
answers question: http://stackoverflow.com/q/28702524
upvote count: 4
downvote count: 0
score: 4
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45706188
accepted answer of: http://stackoverflow.com/q/28702524
type: Answer
has comment: http://stackoverflow.com/comment/45719633
has comment: http://stackoverflow.com/comment/45707086
has body: I think what's going on is the caller isn't giving this function a chance to finish saving the role. The cloud function should wait until the role is saved before invoking response.success() or error(). Here's a promise-returning rewrite of the same code. Easier on the eyes, I think, and clearer about asynch tasks done serially. This puts you in more firm control of the response. Parse.Cloud.define("signupAsBasicUser", function(request, response) { signupAsBasicUser(request.params.name, request.params.password, request.params.email).then(function(user) { response.success(user); }, function(error) { response.error(error); }); }); // return a promise fulfilled with a signed-up user who is added to the 'Basic User" role // function signupAsBasicUser(name, password, email) { Parse.Cloud.useMasterKey(); var user = new Parse.User(); user.set("username", name); user.set("password", password); user.set("email", email); return user.signUp().then(function() { var query = new Parse.Query(Parse.Role); query.equalTo("name", 'Basic User'); return query.find(); }).then(function(roles) { if (roles.length &lt; 1) return Parse.Promise.error("no such role"); roles[0].getUsers().add(user); return roles[0].save(); }).then(function() { return user; }); }

http://stackoverflow.com/comment/45851699
has text: I am glad you solved your problem, but this does not actually answer the original question. Someone else reading it in one of the Review Queues might well DV it. The answer I posted works fine ([see this Fiddle](https://dotnetfiddle.net/TiQ23z)). Also, your new JSON fails JSONLint.
comment on: http://stackoverflow.com/a/28749706
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45718114
comment on: http://stackoverflow.com/q/28715077
score: 0
type: Comment
type: QuestionComment
has text: Anytime one or more requests is running, `counter` and `check` won't be the same. Other than that, I don't see what the question is.

http://stackoverflow.com/q/28663377
has body: I'm trying to write a function that changes the picture on the website according to the day. When I do this the picture shows up as broken. Can anyone tell me why? Is it because I have a bunch of styles applied to the picture in CSS? var now = new Date (); var day = now.getDay(); if(day == 0) document.getElementById("food").src = "images/salad.jpg"; There is my javascript, and here is the corresponding html: &lt;section &gt; &lt;img id='food' src='#' &gt;&lt;/img&gt; &lt;/section&gt;
has comment: http://stackoverflow.com/comment/45621915
tagged with: http://stackoverflow.com/tag/html
has title: Javascript: Update img src by id, depending on the day
score: -2
tagged with: css
has comment: http://stackoverflow.com/comment/45621779
answer count: 2
downvote count: 2
has answer: http://stackoverflow.com/a/28663472
has comment: http://stackoverflow.com/comment/45621826
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45621890
has comment: http://stackoverflow.com/comment/45621730
has comment: http://stackoverflow.com/comment/45621786
upvote count: 0
has answer: http://stackoverflow.com/a/28663459
tagged with: javascript
favorite count: 0
type: Question

http://stackoverflow.com/comment/45681584
type: Comment
comment on: http://stackoverflow.com/q/28682265
type: QuestionComment
has text: @Bergi: I will give example. I have file_1 and file_2. I need to append it in this order: file_1::file_2. Now, If I will use async method, the file can be append in wrong order (file_2::file_1), due to the fact I don't know when it will be executed.
score: 0

http://stackoverflow.com/a/28658954
has body: You might be able to achieve this effect with the ::after pseudo-element. Just change the content property as appropriate based on some class on the button. A simplified example: $(function () { $('#toggle').click(function () { $(this).toggleClass('on'); }); }); .icon::after { content: '+'; } .text::after { content: 'Home'; } .on .icon::after { content: '-' } .on .text::after { content: 'Back' }
type: Answer
answers question: http://stackoverflow.com/q/28658763
score: 0

arbitrary-precision
tags question: http://stackoverflow.com/q/28708787
tag name: arbitrary-precision
type: Tag

http://stackoverflow.com/q/28732814
type: AnsweredQuestion
tagged with: jwt
score: 3
tagged with: javascript
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/36019680
downvote count: 0
has title: Authentication with username & password with node js, AngularJs and JWT
linked to: http://stackoverflow.com/q/28759590
favorite count: 0
has answer: http://stackoverflow.com/a/28734530
accepted answer: http://stackoverflow.com/a/28734530
tagged with: angularjs
tagged with: node.js
has answer: http://stackoverflow.com/a/36019680
upvote count: 3
has body: I am creating an production angularJs application. Now ive created parts of my RESTFul API this API generates a user object on login however i am not keen on sending the password unhashed / un incrypted over the HTTP header. To give you some insight of my API: on login: var jwt = require('jwt-simple'); // Route: /login module.exports = function (express, sequelize, router) { var DataTypes = require("sequelize"); var crypto = require('crypto'); var User = sequelize.define('user', { id: DataTypes.INTEGER, username: DataTypes.STRING, name: DataTypes.STRING, organization_id: DataTypes.INTEGER, type_id: DataTypes.INTEGER, division_id: DataTypes.INTEGER }, { freezeTableName: true, instanceMethods: { retrieveByNamePassword: function (username, onSuccess, onError) { User.find({where: {username: username}}, {raw: true}) .then(onSuccess).catch(onError); } } } ); router.route('/login') .post(function (req, res) { var user = User.build(); var username = req.body.username || ''; var password = req.body.password || ''; if (username == '' || password == '') { res.status(401); res.json({ "status": 401, "message": "Invalid credentials" }); return; } user.retrieveByNamePassword(username, function (users) { if (users) { // If authentication is success, we will generate a token // and dispatch it to the client res.json(genToken(users)); return; } else { // If authentication fails, we send a 401 back res.status(401); res.json({ "status": 401, "message": "Invalid credentials" }); return; } }, function (error) { res.status(401); res.json({ "status": 401, "message": "Invalid credentials" }); return; }); }); var genToken = function(user) { var expires = expiresIn(7); // 7 days var token = jwt.encode({ exp: expires, user_id: user.id, organization_id: user.organization_id, type_id: user.type_id, division_id: user.division_id }, require('./config/secret')()); return { token: token, expires: expires, user: user }; }; var expiresIn = function(numDays) { var dateObj = new Date(); return dateObj.s…

http://stackoverflow.com/q/28624843
score: 0
has answer: http://stackoverflow.com/a/28863152
answer count: 1
type: UnansweredQuestion
has body: Good day! My script processing form submission on spreadsheet side. function onSubmit(e) { var obj, scriptProperties, counter; var prop = 'submissions'; obj = raw_answer_to_raw_obj(e.values);//this function pack answer into object scriptProperties = PropertiesService.getScriptProperties(); counter = scriptProperties.getProperty(prop); if (counter==null) counter = 0; counter++; scriptProperties.setProperty(prop, counter); new_answer_processing(obj); } with calls at the end main processing function wich I can test emulating the obj. new_answer_processing() function calls function create_ss_in_folder only once: function create_ss_in_folder(folder_name, name, root) { var ss, id, file, folder; Logger.log('creating spreadsheet...'); ss = SpreadsheetApp.create(name); id = ss.getId(); Logger.log('ss id: ' + id); file = DriveApp.getFileById(id); var folder = get_folder_by_name(folder_name, root); folder.addFile(file); DriveApp.getRootFolder().removeFile(file); return ss; } Singleton of call proved by logfile and call counter submissions (you can watch video http://youtu.be/DTawqYPa44A) but in fact it's make two spreadsheets. This error occurs not each time when the form submits and never if I emulate submission by script. Is it a reason for issue or I miss something?
has comment: http://stackoverflow.com/comment/45555389
type: Question
tagged with: google-sheets
has comment: http://stackoverflow.com/comment/45560529
tagged with: javascript
tagged with: google-apps-script
has title: Google script creates two spreadsheets instead of one

http://stackoverflow.com/a/28719701
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28693392
type: Answer
has body: Use fetchAll: new channelModel() .fetchAll() .then(function (channels) { channels.forEach(function(channel) { // do something with each channel }); // or just respond with JSON array assuming this is an Express app: res.send(channels.toJSON()); }) I haven't actually tried the forEach function, but according to bookshelf.js documentation it should work. If you're doing a REST service, you probably want to just serialize the collection (array) as JSON.
accepted answer of: http://stackoverflow.com/q/28693392
score: 0

http://stackoverflow.com/q/28706827
tagged with: data-visualization
has body: I am using google datavisualization charts. I have a datatable with 2 columns and 4 rows. I need to display this data into a single stacked bar chart as shown below Sample of my data : var data = new google.visualization.DataTable(); data.addColumn('string', 'name'); data.addColumn('number', 'count'); data.addRows([ ['abc', 321], ['def', 163], ['ghi', 125], ['jkl', 197] ]); I have tried using column chart and bar chart by enabling isStacked:true , but no luck. Is there a way to display the data in a single stacked chart as shown in the image. I don't mind whether it is a bar chart or column chart. I would appreciate if someone can help me. Thanks.
score: 1
upvote count: 1
has title: Google data visualization stacked bar charts using two data sets
type: Question
has answer: http://stackoverflow.com/a/28707013
tagged with: charts
downvote count: 0
tagged with: javascript
tagged with: bar-chart
answer count: 1
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/45736147
type: Comment
type: QuestionComment
has text: Thanks guys, i fixed the issue by using userdate.toLocaleString() in the array.
comment on: http://stackoverflow.com/q/28723999
score: 0

http://stackoverflow.com/q/28745515
tagged with: zend-framework2
has answer: http://stackoverflow.com/a/28746118
tagged with: php
type: Question
has title: Json Rest API: Best solution for getting multiple bits of data
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has body: I am working on a Restful web service with JSON using Zend Framework 2. And the client side will run on AngularJS. Now I have one big question? Description: I have a post, and that post contains a style. (My program creates the relation between StyleId and Id) So my db looks like this Posts Table Id Name StyleId Styles Table Id Style Questions: Which of the 3 solutions is the best one (fastest, most performance, best practice): Get all the styles from the getList() function but then you have styles that you don't need. Send multiple request to the get($id) function to get the styles that I need. Rewrite the getList() function from Posts so that I also returns styles like the following json: { posts : { id: 1, name: "test", styleId: 1 }, styles: { id: 1, style: "teststyle" } If you need more info that I forgot please comment and I will add!
accepted answer: http://stackoverflow.com/a/28746118
answer count: 1
tagged with: javascript
score: 0
tagged with: angularjs

http://stackoverflow.com/comment/45552819
type: QuestionComment
comment on: http://stackoverflow.com/q/28625943
type: Comment
score: 3
has text: `var canvas = this;` could be the problem. In what context is the function getting called? To switch the relMouseCoords Function into the canvas context you can call the function like this: `relMouseCoords.call(canvasCtx, event);`

http://stackoverflow.com/a/28671877
answers question: http://stackoverflow.com/q/28671205
type: Answer
score: 0
has body: HTML ... CSS (only if you target a HTML version less than 5.) .mainrepeater_link { display: block; }

http://stackoverflow.com/a/28651777
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28650342
has comment: http://stackoverflow.com/comment/45617050
type: Answer
has comment: http://stackoverflow.com/comment/45606851
has comment: http://stackoverflow.com/comment/45605837
downvote count: 0
score: 1
has body: At the start of the app, save the beginning window width and the beginning canvas size. var originalWindowWidth=window.innerWidth; var canvas=document.getElementById('canvas'); var originalCanvasWidth=canvas.width; var originalCanvasHeight=canvas.height; Listen for the window resize event Calculate by how much the window width as changed scale=window.innerWidth/originalWindowWidth; If your canvas content is complete &amp; unchanging, you can rescale your canvas with CSS. This way you don't have to redraw the canvas content. 4a. (option#1) Scale using CSS: // rescale both CSS width &amp; height by the SAME SCALE FACTOR $('#canvas').css('width',originalCanvasWidth*scale); $('#canvas').css('width',originalCanvasWidth*scale); If your canvas content is not complete &amp; unchanging, you should rescale your canvas element itself. This causes all canvas content to be lost so you must redraw it. You can use the context.scale command to automatically redraw your content at the new scale factor. Using this method is also less likely to result in pixelated content versus resizing with CSS which "stretches" &amp; "squeezes" existing pixels to fit the new CSS size. 4b. (Option#2) Scale the canvas element itself var canvas=document.getElementById("myCanvas"); var ctx=canvas.getContext("2d"); canvas.width=originalCanvasWidth*scale; canvas.height=originalCanvasHeight*scale; context.scale(scale,scale); // now reissue all the drawing commands // (no need to adjust coordinates or sizes -- context.scale does that for you!
has comment: http://stackoverflow.com/comment/45616938
accepted answer of: http://stackoverflow.com/q/28650342

http://stackoverflow.com/q/28675921
tagged with: angularjs
has title: AngualrJS 1.3 manually update binding with one time binding
type: UnansweredQuestion
score: 11
has answer: http://stackoverflow.com/a/28676178
has comment: http://stackoverflow.com/comment/45646544
has body: I want to use one-time binding in my view. That's all working well and good. However on a button click I want vm.list to refresh. I can't seem to figure out how to manually trigger vm.list to update. Perhaps one time binding is not the answer? here is a jsfiddle boilerplate example: http://jsfiddle.net/KamelJabber/e4nexvay/2/ (function () { var c1 = function Controller1() { var vm = this; var addCount = 1; vm.list = [{ Id: 1, Text: "Blue One" }, { Id: 2, Text: "Blue Two" }, { Id: 3, Text: "Blue Three" }]; vm.AddnRefresh = function () { vm.list.push({ Id: vm.list.length, Text: "Add " + addCount }); addCount++; //force a refresh of vm.list } }; var app = angular.module('myApp', []); app.controller('Controller1', c1); })(); LOTS of other stuff going on causing digest updates so really don't want to update list unless "Add" is called"
type: Question
has comment: http://stackoverflow.com/comment/45645715
has answer: http://stackoverflow.com/a/31365810
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45646790
has answer: http://stackoverflow.com/a/41247975
answer count: 3
upvote count: 11
favorite count: 0
has comment: http://stackoverflow.com/comment/45647064

http://stackoverflow.com/a/28717048
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: The autocomplete with AJAX loaded data should be configured differently. source property can be a function which accepts a callback parameter. You should feed this callback with data loaded from server. Also you don't need to bind keyup event manually. Your code will become: $('#search').autocomplete({ minLength: 0, source: function(request, response) { $.ajax({ url: 'get_spareparts', type: 'POST', dataType: 'JSON', data: {item: request.term} }).done(function(data) { response(data.map(function(el) { return { value: el.value, label: el.desc }; })) }); } });
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28716774
answers question: http://stackoverflow.com/q/28716774
has comment: http://stackoverflow.com/comment/45721493

http://stackoverflow.com/q/28602030
favorite count: 0
type: UnansweredQuestion
tagged with: python
score: 2
upvote count: 2
tagged with: iframe
has title: Phantomjs with Selenium not processing iframe javascripts when try login to instagram
tagged with: selenium
type: Question
tagged with: phantomjs
has comment: http://stackoverflow.com/comment/45513757
tagged with: javascript
has comment: http://stackoverflow.com/comment/45512305
has body: I'm using python, with Selenium and PhantomJs So I try to login to instagram but phantomjs is not processing iframes javascripts, when I try to do same thing with firefox all is ok. my_iframe = self.driver.find_element_by_css_selector("iframe.hiFrame") self.driver.switch_to.frame(my_iframe) email = WebDriverWait(self.driver, 50).until( EC.visibility_of_element_located((By.CSS_SELECTOR,"input[name='username']"))) it gives timeout exception.Am I doing something wrong? Maybe there is any headless browser else I can use in selenium?
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/29657535

http://stackoverflow.com/comment/61166205
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28670632
has text: @DavidAnderton, I don't know why spacebars doesn't support that, all I can say is that it doesn't. But it might be because spacebars is responsible for the view, and it's good practice to keep computations (such as equal-expressions) away from the view, so you only need the send the view the model is should render (but if you ask me, not being allowed to use equal expressions in the views is too extreme).
type: AnswerComment

http://stackoverflow.com/a/28649834
type: Answer
has comment: http://stackoverflow.com/comment/45598439
has body: The issue to me looks like a trailing parentheses at the end. Try this: $.fn.contenthover = function(method) { if (methods[method]) { return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); } else if (typeof method === 'object' || !method) { return methods.init.apply(this, arguments); } else { $.error('Method '+ method +' does not exist in contentHover plugin.'); } };
accepted answer of: http://stackoverflow.com/q/28649570
answers question: http://stackoverflow.com/q/28649570
has comment: http://stackoverflow.com/comment/45597411
has comment: http://stackoverflow.com/comment/45597292
has comment: http://stackoverflow.com/comment/45597189
has comment: http://stackoverflow.com/comment/45598532
has comment: http://stackoverflow.com/comment/45597321
has comment: http://stackoverflow.com/comment/45597575
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/45597379

http://stackoverflow.com/comment/45576482
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28638408
has text: What's `app.js`? Is that your Node.js server? The variables that are available to you in your Node server won't be available in your client-facing JavaScript. They don't share the same scope. However, you can look into using [Browserify](http://browserify.org/), a JS pre-compiler, to also `require` myModule in your client-side JavaScript.

http://stackoverflow.com/q/28743055
possible better answer: http://stackoverflow.com/a/28743374
answer count: 2
has answer: http://stackoverflow.com/a/28743114
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Jquery on('click').... Function Execute only once
accepted answer: http://stackoverflow.com/a/28743114
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
has comment: http://stackoverflow.com/comment/45768975
upvote count: 1
has comment: http://stackoverflow.com/comment/45768949
type: Question
has body: So I got : var current = $('.article.active'); $('div').on("click", function() { if(current.next('.article').hasClass('hide')){ $(current).addClass('hide'); $(current).next('.article').removeClass('hide'); }; }); And Html: So when I click on the div the code works, but only once. I want to be executed multiple times for every div. JSFIDDLE: http://jsfiddle.net/9xrpuru9/
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28743374
score: 1

http://stackoverflow.com/comment/45595362
score: 0
type: AnswerComment
has text: Yes.. fine. It is not working because of I just created the input dynamically I think
type: Comment
comment on: http://stackoverflow.com/a/28648478

http://stackoverflow.com/q/28701440
upvote count: 0
score: -2
has title: How to do a function with a select option value
answer count: 1
tagged with: javascript
favorite count: 0
has body: I have a form with two input select, the second input only can be enable if the first one was selected. And I'm having doubts. I tried to do an onclick event, but failed. Can someone help me? (sorry for the broken english)
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28701560
has comment: http://stackoverflow.com/comment/45692926
downvote count: 2
has comment: http://stackoverflow.com/comment/45693003
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28701560

http://stackoverflow.com/comment/45682867
type: QuestionComment
comment on: http://stackoverflow.com/q/28690021
has text: Have you tried creating two google analytics with the same URL?
score: 0
type: Comment

http://stackoverflow.com/a/28630552
type: Answer
has comment: http://stackoverflow.com/comment/45561694
has comment: http://stackoverflow.com/comment/45561574
score: 0
has body: If I understand correctly you want to check if user is logged in based on tittle? Then: if($('tittle').text() == loggedInTittle) { //user is logged in so change image e.g $('.navLoggedOut').removeClass('.navLoggedOut').addClass('.navLogin'); }
has comment: http://stackoverflow.com/comment/45561644
has comment: http://stackoverflow.com/comment/45561344
answers question: http://stackoverflow.com/q/28630296

http://stackoverflow.com/q/28629513
type: Question
accepted answer: http://stackoverflow.com/a/28629736
has comment: http://stackoverflow.com/comment/45559500
tagged with: javascript
tagged with: firefox
answer count: 1
has answer: http://stackoverflow.com/a/28629736
has title: Click button to change select-element. Script only works in Chrome
has body: I'm trying write a script that allows a button click to change selected option in a select-element. This script is working in Chrome, but not in Firefox, how come? http://jsfiddle.net/orjan/hsvp7pt8/ var searchOption = $('.container .select-box option:selected').text(); var searchValue = $('.container .select-box option:selected').val(); $('.container').each(function () { $(this).children('.select-box').attr('value', searchValue); if ($(this).find('.select-box option:selected').val() == 'articles') { $(this).toggleClass('active'); } }); $('.container .select-label').click(function () { $(this).parent().toggleClass('active'); if ($(this).siblings('.select-box').children('option:selected').val() == 'option-a') { $(this).siblings('.select-box').children('option:selected').removeAttr('selected'); $(this).siblings('.select-box').children('option[value="option-b"]').attr('selected', 'selected'); var searchValue = $('.container .select-box option:selected').val(); } else { $(this).siblings('.select-box').children('option:selected').removeAttr('selected'); $(this).siblings('.select-box').children('option[value="option-a"]').attr('selected', 'selected'); var searchValue = $('.container .select-box option:selected').val(); } $(this).siblings('.select-box').attr('value', searchValue); });
type: AnsweredQuestion
score: 0
tagged with: select
tagged with: google-chrome

http://stackoverflow.com/a/28695729
has body: ([A-Z])(?=[A-Z][a-z])|([^A-Z])(?=[A-Z])|([A-Za-z])(?=[^A-Za-z]) Javascript doesn't support lookbehind: (?&lt;= So make the lookbehind a group and replace it later. Replace by $1$2$3 . See demo. https://regex101.com/r/aI4rA5/11 var re = /([A-Z])(?=[A-Z][a-z])|([^A-Z])(?=[A-Z])|([A-Za-z])(?=[^A-Za-z])/gm; var str = 'AllPeople\nPeopleCRB\nPeople'; var subst = '$1$2$3 '; var result = str.replace(re, subst);
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45685324
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45682381
accepted answer of: http://stackoverflow.com/q/28695172
has comment: http://stackoverflow.com/comment/45682873
has comment: http://stackoverflow.com/comment/45682659
answers question: http://stackoverflow.com/q/28695172

http://stackoverflow.com/q/28636686
has title: Change an forEach depending on the locale
answer count: 1
has body: &lt;% if (locale === 'pt') { data[i].info.pt.forEach(function(info) { %&gt; &lt;li&gt;&lt;%= info %&gt;&lt;/li&gt; &lt;% }); %&gt; &lt;% } else if (locale === 'en') { data[i].info.en.forEach(function(info) { %&gt; &lt;li&gt;&lt;%= info %&gt;&lt;/li&gt; &lt;% } else if (locale === 'es') { data[i].info.es.forEach(function(info) { %&gt; &lt;li&gt;&lt;%= info %&gt;&lt;/li&gt; &lt;% } %&gt; I have a variable called locale, which changes the value according to the language of the site, and I'm doing this forEach on an object, depending on the value of the locale, is there any way to make this better? I was trying like this: &lt;% data[i].info. + locale + .forEach(function(info) { %&gt; &lt;li&gt;&lt;% info %&gt;&lt;/li&gt; &lt;% }); %&gt; But it seems that I can not.
tagged with: javascript
tagged with: ejs
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28636752
type: Question
tagged with: node.js
score: 0
has answer: http://stackoverflow.com/a/28636752

http://stackoverflow.com/comment/45660513
comment on: http://stackoverflow.com/q/28683822
has text: What have you tried so far? You have only presented the html code and no javascript.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45764177
comment on: http://stackoverflow.com/a/28739541
has text: @BobbyShark use `#([a-zA-Z]+)`
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/a/28745177
type: Answer
answers question: http://stackoverflow.com/q/28744992
has comment: http://stackoverflow.com/comment/45774043
score: 1
has comment: http://stackoverflow.com/comment/45776964
upvote count: 1
has comment: http://stackoverflow.com/comment/45777316
downvote count: 0
has comment: http://stackoverflow.com/comment/45776241
has body: You need to send across the data using application/x-www-form-urlencoded. $http({ method: 'POST', url: 'http://localhost:8080/wall/addpost', data: $.param({post: x, user: y}), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }) See this answer for more details How can I post data as form data instead of a request payload? Also your function definition should be @RequestMapping(value = "/addpost", method = RequestMethod.POST, headers = "Accept=application/json") public @ResponseBody String addpost(@RequestParam PostDto post, @RequestParam UserDto user) { postservice.addPost(post, user); return "post inserted"; }
has comment: http://stackoverflow.com/comment/45775853

http://stackoverflow.com/a/28690725
has body: It's not prototype, but seems it's that you are looking for https://lodash.com/docs#pick
answers question: http://stackoverflow.com/q/28690555
downvote count: 0
score: 1
upvote count: 1
type: Answer

http://stackoverflow.com/q/28646215
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28647106
score: 0
has body: I am workig on bootstrap super admin templet. I add bootstrap modal in my page. but it appears statically on page load. withought toggle it. I already include bootstrap js file so it is no issue. I tried to solve this issue and I get some solution. But it is not proper. I write this code on document ready : $(document).ready(function() { $('#question-form').modal(); $('#question-form').modal('hide'); }); So each time I have to call modal(); then I have to hide it. I can use hide directly it is not working. before $('#question-form').modal(); after $('#question-form').modal(); I added some screens, Hope you find diffrences. Before initilize modal it is totally like static HTML. after calling modal() it works normally. but by this solution it pop up and hide on every page load. Please help ;)
has title: bootstrap modal appers statcallyon page load
tagged with: twitter-bootstrap-3
tagged with: twitter-bootstrap
type: UnansweredQuestion
type: Question
answer count: 1
tagged with: bootstrap-modal

http://stackoverflow.com/a/28692252
has body: You can use: $('td a').click(function(){ alert($(this).closest('tr').attr('id')); });
answers question: http://stackoverflow.com/q/28692229
upvote count: 3
score: 3
downvote count: 0
type: Answer

http://stackoverflow.com/a/28702738
answers question: http://stackoverflow.com/q/28699255
has comment: http://stackoverflow.com/comment/45695410
score: 12
has body: After reading your question and comments, I'm still a little confused, but maybe this will help. First off, learn to use Chrome's Dev Tools. They are awesome! The most important thing you need to know for now is this: To use console.log: In your JavaScript, write a line like console.log('Hello World!'); Open that page in Google Chrome Press F12 To Toggle (Open/Close) the DevTools It will probably be on the Resources tab, this is a good place to check all your resources are loaded, but not what you're looking for. Click on the tab labeled Console Viola! You should see Hello World! if that line of JS has run. Welcome to awesomsauce! Now as to an easier visual for resize testing, try the following jQuery enhanced JavaScript: (commented for explanations, remove comments if you please) // This first line is the same as JavaScript's `document.ready = function() {} // This simply starts your code running as soon as the document is loaded and ready to go // It's safe to use in &lt;head&gt; or in &lt;body&gt; and will always ensure your JS is running with the page load $(function() { // Here I use .on instead of direct reference to the event as this is just good practice4 with jQuery // You'll later learn you can use this with prewritten methods to "turn on/off" methods asigned to specific events $(window).on('resize', function(e) { // Little JS Tip, No need to write `var` 50thousand times. Just use a comma and write your new variable var x = $(this).width(), // variable for window width assigned to `x` y = $(this).height(), // variable for window height assigned to `y` z = x/y, // your conversion you were using in the code you have in your question, there's plenty of different ways to test for size changes, do some Googling on "aspect ratio" as it's usually best way to go // this next line is a little complicated // It's assigning a variable based on result of an `inline if statement` // What it says: if (element with id 'myOutput' exist) then assign that element and empty …
type: Answer
upvote count: 12
downvote count: 0
has comment: http://stackoverflow.com/comment/62287830

http://stackoverflow.com/comment/45529131
has text: Why are you replacing the element inside the `$timeout` and not during, say, the compile phase?
type: Comment
comment on: http://stackoverflow.com/q/28611747
type: QuestionComment
score: 0

http://stackoverflow.com/q/28702713
has answer: http://stackoverflow.com/a/29361899
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28901951
answer count: 2
downvote count: 0
has title: MEANIO Cluster of 4 to run only once for a scheduled Job?
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has body: What I want to see happen is have the MEAN spin up all four of the clusters. then run a scheduled job to email my customers every day at 20:30 .Currently runs more than once. How do I accomplish this? 'use strict'; var mean = require('meanio'); var cluster = require('cluster'); var schedule = require('node-schedule'); var z = schedule.scheduleJob('30 20 * * *', function() { console.log('test the scheduler') }); if (cluster.isMaster) { // Count the machine's CPUs var cpuCount = require('os').cpus().length; // Create a worker for each CPU for (var i = 0; i &lt; cpuCount; i += 1) { console.log ('forking ',i); cluster.fork(); } // Listen for dying workers cluster.on('exit', function (worker) { // Replace the dead worker, we're not sentimental console.log('Worker ' + worker.id + ' died :('); cluster.fork(); }); } else { var workerId = 0; if (!cluster.isMaster) { workerId = cluster.worker.id; } mean.serve({ workerid: workerId /* more options placeholder*/ }, function (app, config) { var port = config.https &amp;&amp; config.https.port ? config.https.port : config.http.port; console.log('Mean app started on port ' + port + ' (' + process.env.NODE_ENV + ') cluster.worker.id:', workerId); }); } OUTPUT forking 0 forking 1 forking 2 forking 3 Mean app started on port 3000 (development) cluster.worker.id: 1 Mean app started on port 3000 (development) cluster.worker.id: 2 Mean app started on port 3000 (development) cluster.worker.id: 3 Mean app started on port 3000 (development) cluster.worker.id: 4 test the scheduler test the scheduler test the scheduler test the scheduler test the scheduler
tagged with: node.js
tagged with: mean.io
score: 2

http://stackoverflow.com/a/28660668
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28660096
answers question: http://stackoverflow.com/q/28660096
has comment: http://stackoverflow.com/comment/45617682
type: Answer
has body: The responsible for saying how much your page will scroll down is scrollTop: $(target).offset().top, so, if you want to offset -230px just subtract 230 from $(target).offset().top. But, if you do this in your current code it will not work, because you are changing the hash using location.hash = target;. When you do this, your browser will locate the hash and jump to it (without animating, just jumping). Observe this demo: http://jsfiddle.net/pcyn2fvk/ If you click in the anchor, the page will scroll down to the content and after the scroll it will jump (this is caused by location.hash = target;). Here is the demo without using location.hash = target;: http://jsfiddle.net/pcyn2fvk/1/ I assume you will need to change the hash, so, you can try a different approach, like this one explained by Lea Verou (http://lea.verou.me/2011/05/change-url-hash-without-page-jump/) that uses the History API instead of location.hash. There are some other approaches, for example, you can remove the id of your target section (the one you clicked to scroll to) when you click to the anchor, then, when you change the location using location.hash, the browser will not find the clicked id, and will not jump to it, then, after that, you can reassign the id to your section. Hope it helps!
has comment: http://stackoverflow.com/comment/45617834
has comment: http://stackoverflow.com/comment/45617911

http://stackoverflow.com/q/28709146
score: 10
tagged with: javascript
tagged with: jquery
has body: Could someone please explain why this code isn't working: $('form').on('submit', function (e) { e.preventDefault(); var first = $('.first').val(); var next = $(".next").val(); alert(first + " " + next); }); http://jsfiddle.net/cj1hysf3/ It seems to work fine when I remove one of the two inputs but having them both there messes it up.
has comment: http://stackoverflow.com/comment/45707461
answer count: 3
linked to: http://stackoverflow.com/q/29943
downvote count: 0
has comment: http://stackoverflow.com/comment/45707464
favorite count: 0
has answer: http://stackoverflow.com/a/28709297
has answer: http://stackoverflow.com/a/28709245
has comment: http://stackoverflow.com/comment/45707418
type: AnsweredQuestion
tagged with: forms
accepted answer: http://stackoverflow.com/a/28709297
upvote count: 10
possible better answer: http://stackoverflow.com/a/28709364
type: Question
has answer: http://stackoverflow.com/a/28709364
has title: Form with two inputs not submitting?

http://stackoverflow.com/a/28654009
accepted answer of: http://stackoverflow.com/q/28653997
has body: You can use the function parseInt to convert the strings to numbers. mathOp: function(){ if (this.get('operator') == '+'){ var result = parseInt(this.get('opr1'), 10) + parseInt(this.get('opr2'), 10); alert(result); } }
answers question: http://stackoverflow.com/q/28653997
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/comment/45741581
comment on: http://stackoverflow.com/q/28727480
has text: yes I need to send to html that display the audio to the user after professed in J query
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45582102
type: AnswerComment
comment on: http://stackoverflow.com/a/28641546
type: Comment
score: 0
has text: Thanks for clarifying the difference, I was mainly looking for the reason behind performance impact. +1

http://stackoverflow.com/q/28671636
favorite count: 0
tagged with: regex
has comment: http://stackoverflow.com/comment/45636979
upvote count: 0
has answer: http://stackoverflow.com/a/28671781
has comment: http://stackoverflow.com/comment/45637121
type: Question
type: AnsweredQuestion
has title: Customize Regular Expression
accepted answer: http://stackoverflow.com/a/28939467
score: -1
has comment: http://stackoverflow.com/comment/45669050
answer count: 2
possible better answer: http://stackoverflow.com/a/28671781
has answer: http://stackoverflow.com/a/28939467
downvote count: 1
tagged with: javascript
has body: This is my regular expression - /(\d{1,2}?h$)|(\d{1,2}h(?=\s+))/i there is two 1.(\d{1,2}?h$) and 2.(\d{1,2}h(?=\s+) for same. but difference is that first for end of string(h) and second for space after 'h' i want to combine this two possibilities. and when string is like 144h at that time it return 44h but i need null when there is more than two digits. and i need single (combine) expression for 1.strating of string 14h -: 14h at ahmedabad. 2.space before 14h string -: at ahmedabad 14h. 3.ending of string 14h -: at ahmedabad 14h 4.space after 14h string -: at ahmedabad 14h in meeting

http://stackoverflow.com/a/42001592
upvote count: 1
score: 1
downvote count: 0
has body: In order to receive events, you need to listen into 'Firebase' provided events which are put, patch, keep-alive etc... I have tried and it works. You can refer following code snippet, if (typeof (EventSource) !== "undefined") { var source = new EventSource("https://xxxxxxxxx.firebaseio.com/TestNode.json"); source.onmessage = function (event) { document.getElementById("result").innerHTML += event.data + "&lt;br&gt;"; }; source.addEventListener("message", function (e) { console.log(e.data); }, false); source.addEventListener("open", function (e) { console.log("Connection was opened."); }, false); source.addEventListener("error", function (e) { console.log("Error - connection was lost."); }, false); //magic goes here! source.addEventListener("patch", function (e) { console.log("Patch UP - " + e.data); }, false); //And here! source.addEventListener("put", function (e) { console.log("Put UP - " + e.data); }, false); } else { document.getElementById("result").innerHTML = "Sorry, your browser does not support server-sent events..."; } Refer following documents, https://firebase.google.com/docs/database/rest/retrieve-data https://firebase.google.com/docs/reference/rest/database/
answers question: http://stackoverflow.com/q/28673164
type: Answer

http://stackoverflow.com/q/28607423
has comment: http://stackoverflow.com/comment/45520224
score: 0
has answer: http://stackoverflow.com/a/28608605
answer count: 3
has comment: http://stackoverflow.com/comment/45518924
has comment: http://stackoverflow.com/comment/45520760
tagged with: jquery
has comment: http://stackoverflow.com/comment/45520192
has title: How to pass data to fancybox function?
has answer: http://stackoverflow.com/a/28608406
tagged with: http://stackoverflow.com/tag/html
tagged with: fancybox
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45519062
possible better answer: http://stackoverflow.com/a/28608486
type: Question
accepted answer: http://stackoverflow.com/a/28608406
has answer: http://stackoverflow.com/a/28608486
tagged with: argument-passing
has comment: http://stackoverflow.com/comment/45519206
tagged with: javascript
has comment: http://stackoverflow.com/comment/45520721
has body: I have wrote following code: html: js: $(".fancybox") .fancybox({ beforeLoad: function () { alert(this); this.title = $(this.element).attr('caption'); } }); I want to show text taken from data attribute before image will show(page1 or page2). Please, help to modify me code. http://jsfiddle.net/9GwUu/25/

http://stackoverflow.com/q/28690412
score: 0
has body: I have a from where I want to bind all the nested input fields of each radio button to it's option so I can show the results when it's clicked. For example if option1 is selected the only results shown would be nested inputs of option1. How can I do it using knockout.js and jQuery? ... ... ... What is the right syntax to write an if statement block in knockout.js that checks radio buttons value? var viewModel = { optionRadio: ko.observable("option1"), input1: ko.observable(), input2: ko.observable(), input3: ko.observable(false), input4: ko.observable(false), optionValues: ["Alpha", "Beta", "Gamma"], selectedOptionValue: ko.observable("Gamma") }; ko.applyBindings(viewModel); var jsonData = ko.toJSON(viewModel); Option 1 Input 1 Input 2 option 1 option 2 Option 2 Some content here Option 3 Some other content here
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28692133
has comment: http://stackoverflow.com/comment/45675352
has title: how to bind nested inputs using knockoutjs
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45673190
has comment: http://stackoverflow.com/comment/45673015
accepted answer: http://stackoverflow.com/a/28692133
tagged with: knockout.js
type: Question
tagged with: javascript

http://stackoverflow.com/comment/69524206
has text: Pa3k.m you cant changing color when just using video..
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28734633

http://stackoverflow.com/q/28619537
upvote count: 2
has title: unit testing angular issue with window location assign
has body: In my ctrl, I have this code to navigate to a page after the function has completed its work. $scope.myFunction = function(){ //other code window.location.assign(url); } My test code looks like this. describe('TEST', function () { var window; beforeEach(module(function($provide) { //dummy window window = { location:{href:function(){return 'dummy'},assign:function() {return 'dummy1'}} }; // We register our new $window instead of the old $provide.constant('$window',window); })); it("should test",function(){ $scope.myfunction(); }); }); The error that I get is ..Some of your tests did a full page reload! and the test fails. I've followed the issue documented here (Unit testing the AngularJS $window service), but the same approach doesn't work for me. any idea?
linked to: http://stackoverflow.com/q/21645614
type: Question
tagged with: mocking
tagged with: javascript
tagged with: mocha.js
has answer: http://stackoverflow.com/a/28620584
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28620584
tagged with: angular-mock
type: AnsweredQuestion
score: 2

http://stackoverflow.com/comment/45609628
type: Comment
comment on: http://stackoverflow.com/a/28656541
score: 0
type: AnswerComment
has text: All the data stored in the arrays variable. It contains arrays generated from your map input parameter. First item in those arrays are the mainKey = your date.

http://stackoverflow.com/a/28679030
has comment: http://stackoverflow.com/comment/45651336
has body: In a Liferay portlet, put that piece of code : LiferayPortletURL urlLogin = PortletURLFactoryUtil.create( request, "58", themeDisplay.getPlid(), PortletRequest.ACTION_PHASE); urlLogin.setWindowState(LiferayWindowState.EXCLUSIVE); urlLogin.setParameter("_58_struts_action", "/login/login"); urlLogin.setParameter("_58_login", _your_login); urlLogin.setParameter("_58_password",_your_password); urlLogin.setParameter("_58_rememberMeCheckbox", "false"); urlLogin.setParameter("_58_redirect", _write_an_url_to_be redirected_after_successful_login); urlLogin.setParameter("_58_doActionAfterLogin", "false"); urlLogin.setParameter("_58_saveLastPath", _your_previous_url); 58 is the portletId of the Liferay Login portlet. Then, have a look at your urlLogin.toString() to understand how is it build. Regards
answers question: http://stackoverflow.com/q/28678434
score: 0
type: Answer

http://stackoverflow.com/q/28693087
score: -1
has title: Add a form after ul
type: Question
has answer: http://stackoverflow.com/a/28693139
downvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28693571
possible better answer: http://stackoverflow.com/a/28693138
has answer: http://stackoverflow.com/a/28693125
accepted answer: http://stackoverflow.com/a/28693125
tagged with: http://stackoverflow.com/tag/html
has body: How i can add form after ul? Here is my code: Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ratione repudiandae possimus dolore perferendis vel magni odio in architecto corrupti consequuntur. Add comment Lorem ipsum dolor sit amet, consectetur. Lorem ipsum. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ratione repudiandae possimus dolore perferendis vel magni odio in architecto corrupti consequuntur. Add comment Lorem ipsum dolor sit amet, consectetur. Lorem ipsum. Lorem ipsum dolor sit amet. and jquery: $('.open').on('click', function(event) { event.preventDefault(); $(this).parent().after(' '); }); question is: how i can add form after ul list, currently is inserted after article. Here is demo: DEMO EDIT: How add form after article if ul after article not exist? ANSWER: $('.quick_reply').on('click', function(event) { event.preventDefault(); if ($(this).parent().next('ul').length > 0) { $(this).parent().next('ul').after(' '); } else { $(this).parent().after(' '); } });
tagged with: append
answer count: 4
upvote count: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28693138
has comment: http://stackoverflow.com/comment/45677279

http://stackoverflow.com/q/28712207
downvote count: 0
answer count: 1
tagged with: jquery
tagged with: interact.js
favorite count: 0
tagged with: drag-and-drop
tagged with: twitter-bootstrap
accepted answer: http://stackoverflow.com/a/28717702
type: AnsweredQuestion
upvote count: 3
type: Question
has title: Cannot get interact.js drag & drop interactions to work with Boostrap elements
tagged with: javascript
has body: I'm attempting to get interact.js to work with Bootstrap list items. I have a very simple setup, but unfortunately I can't get it to work. HTML (div containing two Bootstrap panels - one with some draggable list items, and another with two dropzones): Draggables asdf bbq Drop Areas drop stuff here drop more stuff here CSS: #visualizer-panel .leftStuff { float: left; } #visualizer-panel .rightStuff { float: right; } /* Visual cursor hint for draggable */ #visualizer-panel .draggable:hover { cursor: move; } /* Drag & Drop */ #visualizer-panel .draggable { -webkit-transform: translate(0px, 0px); transform: translate(0px, 0px); } #visualizer-panel .drop-active { border-color: red; } #visualizer-panel .drag-drop.can-drop { background-color: #4e4; } #visualizer-panel .drop-target { background-color: #29e; } And Javascript: // Initialize Interact.js Drag & Drop interact('.draggable').draggable({ inertia: true, restrict: { restriction: "#visualizer-panel", endOnly: true, elementRect: { top: 0, left: 0, bottom: 1, right: 1 } }, onend: function(event) { console.log(event); } }); interact('.dropzone').dropzone({ accept: '.draggable', overlap: 0.01, // add / remove dropzone feedback ondropactivate: function (event) { event.target.classList.add('drop-active'); }, ondropdeactivate: function (event) { event.target.classList.remove('drop-active'); }, // add / remove dropzone feedback ondragenter: function (event) { var draggableElement = event.relatedTarget, dropzoneElement = event.target; dropzoneElement.classList.add('drop-target'); draggableElement.classList.add('can-drop'); }, ondragleave: function (event) { event.target.classList.remove('drop-target'); event.relatedTarget.classList.remove('can-drop'); }, // drop successful ondrop: function (event) { console.log(event); } }); Here is a jsfiddle link for the code above: http://jsfiddle.net/hf27hn0c/6/ As you can see, it's not possible to drag & drop the list items into the dropzones. I understand that I'll likely have to remove …
has answer: http://stackoverflow.com/a/28717702
score: 3

http://stackoverflow.com/comment/45767319
type: Comment
comment on: http://stackoverflow.com/q/28742092
score: 0
has text: yes but only in the last iteration will do the callback, i thought that would do the trick...
type: QuestionComment

http://stackoverflow.com/comment/45741815
score: 1
comment on: http://stackoverflow.com/q/28727620
has text: curious why you use ` ` to load html page?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28735381
score: -1
has title: Need help working out "Total" button for fence price calculator
type: Question
upvote count: 0
tagged with: javascript
has body: I'm writing a program that calculates the cost of building a fence. The fence can either be built out of Chainlink ($25) or Wood ($35), can include an addition of 1- 3 gates (each individual one costing $165) and includes a tax of 9%. I've gotten almost all of it done, however now my problem is figuring out what to set the total "onclick" as . I currently have it read as "'total = "fence_function()"'", but I'm pretty sure this is wrong. I also don't for the life of me know what to set "onchange" as. Here's the code in full: Fence Price Calculator Fence Price Calculator Length Fences Gates Chainlink 1 Clear Width Wooden 2 Total 3
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: calculator
favorite count: 0
has comment: http://stackoverflow.com/comment/45755771
type: UnansweredQuestion
downvote count: 1
has answer: http://stackoverflow.com/a/28735591

http://stackoverflow.com/q/28746216
has answer: http://stackoverflow.com/a/28746630
has comment: http://stackoverflow.com/comment/45774803
possible better answer: http://stackoverflow.com/a/28746382
type: Question
has answer: http://stackoverflow.com/a/28746357
has answer: http://stackoverflow.com/a/28746479
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: colors
has comment: http://stackoverflow.com/comment/45774986
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/45774921
has comment: http://stackoverflow.com/comment/45774670
answer count: 4
score: 2
accepted answer: http://stackoverflow.com/a/28746479
upvote count: 2
has body: I want to change #demo border color by clicking on it, but it only changes when in css color is not given. I want to change my #demo div border color from transparent to red. Help me please :) Paslėpti daiktai CSS: .pagrindas { position: relative; } .daiktas { width:50px; background-color: transparent; border:3px solid; border-radius: 100%; position:relative; left:195px; top:7px; padding:0px; margin:0px; height:50px; } img { position: absolute; top: 0px; left: 0px; }
has title: HTML changing div color. Code not working
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28746382
has comment: http://stackoverflow.com/comment/45775238

http://stackoverflow.com/a/28678428
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45650364
has comment: http://stackoverflow.com/comment/45650243
has comment: http://stackoverflow.com/comment/45650074
upvote count: 1
type: Answer
has body: Using the map function of array. var originalArray = [{"MtmDate":"2014-10-24", "MouldingID":"1233B", "ID":38, "Mtm01":5.10, "Mtm02":6.63,"Mtm03":5.84 }, {"MtmDate":"2014-10-25", "MouldingID":"1233B", "ID":39, "Mtm01":5.13, "Mtm02":6.21,"Mtm03":6.64 }, {"MtmDate":"2014-10-26", "MouldingID":"1233B", "ID":40, "Mtm01":5.68, "Mtm02":5.95,"Mtm03":6.37 }, ... ] var expectedArray = originalArray.map(function(v){ return {mtm:v.ID, values:v} })
has comment: http://stackoverflow.com/comment/45650550
answers question: http://stackoverflow.com/q/28678207

http://stackoverflow.com/q/28622701
has answer: http://stackoverflow.com/a/28623113
type: AnsweredQuestion
downvote count: 3
type: Question
tagged with: c#
score: -2
possible better answer: http://stackoverflow.com/a/28622831
tagged with: javascript
tagged with: jquery
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28622791
accepted answer: http://stackoverflow.com/a/28622791
favorite count: 0
has title: Javascript not calling function because syntax error
has body: In C# i am creating string for design of div and in which i am calling javascript function and latter appening it to div. In c# i have done as below: innerHTML.Append(@" $" + Convert.ToString(dt.Rows[i]["price"]) + " "); Here there is anchor tag as: here window.open is not getting called becase some syntax problems. When i do inspect element in chrome : How can i format it in C# so that it views correctly.??? EDIT 1 Error:
has answer: http://stackoverflow.com/a/28622831
upvote count: 1

http://stackoverflow.com/q/28634864
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45570316
has body: ajax call to web api returning 404 not found. Requested URL: /home/api/DeveloperApi/. I havent included home in the url in the ajax call? Would it be something to do with routing? heres my javascript function GetDevelopers() { $.ajax({ type: "GET", url: 'api/DeveloperApi', dataType: 'json', contentType: 'application/json', success: function (data) { alert("Success"); }, error: function (data) { Alert("ERROR"); } }); } $(document).ready(function () { GetDevelopers(); }); and my api public class DeveloperApiController : ApiController { private IDeveloperRepository _repo; public DeveloperApiController(IDeveloperRepository _repo) { this._repo = _repo; } public IEnumerable&lt;Developer&gt; GetDevelopers() { return _repo.GetDevelopers(); } } my api route which is the default config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } );
tagged with: c#
type: Question
tagged with: asp.net-web-api
tagged with: javascript
has comment: http://stackoverflow.com/comment/45570170
has comment: http://stackoverflow.com/comment/77921390
tagged with: asp.net
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/45569659
has comment: http://stackoverflow.com/comment/45570025
has title: ajax call to web api returning 404 not found
has comment: http://stackoverflow.com/comment/45569643

http://stackoverflow.com/comment/45598771
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28650591
type: AnswerComment
has text: Ahh thank you, I don't know how I didn't think about that! Cheers.

http://stackoverflow.com/comment/45756368
type: Comment
score: 2
has text: This is an anti-pattern in angular. The way you need to do it is to actually have the tooltip in the DOM hidden and make it visible using ng-show/ng-if when some scope state changes based on your mouse overs.
type: QuestionComment
comment on: http://stackoverflow.com/q/28735793

http://stackoverflow.com/comment/45635893
score: 1
has text: @Mayhem the function I wrote name is Scrollit() ... anyway you got a point and I tried the "pagecreate" & "pageshow" and the rest of the events from the jQuery Mobile and nothing worked!
comment on: http://stackoverflow.com/q/28658927
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/113663979
type: AnswerComment
has text: this answer should be updated as the lodash way and functions has changed.
type: Comment
comment on: http://stackoverflow.com/a/28726560
score: 3

http://stackoverflow.com/comment/45601208
type: Comment
has text: @Bergi actually I had a pretty good understanding of the concepts when I wrote the question, but thanks to yourself and Guffa I now have an excellent understanding.
comment on: http://stackoverflow.com/a/28651614
score: 1
type: AnswerComment

http://stackoverflow.com/q/28661314
favorite count: 0
tagged with: css
score: 2
type: AnsweredQuestion
tagged with: css-transitions
has title: fade in then fade out after some time by using css-transitions
has answer: http://stackoverflow.com/a/28661379
type: Question
accepted answer: http://stackoverflow.com/a/28661379
possible better answer: http://stackoverflow.com/a/28661349
tagged with: javascript
has body: I'd like to fade in, wait some time, then fade out an element of homepage using jQuery's addClass and removeClass This JS-code fades in the div but doesn't fade it out. I'm using jQuery 2.1.3 if ($("#save-success").hasClass("fadeout")){ $("#save-success").removeClass("fadeout").addClass("fadein", function() { $(this).delay(2000).removeClass("fadein").addClass("fadeout"); }) } I've got this CSS: .fadein, .fadeout { opacity: 0; transition: opacity 0.4s ease-in-out; } .fadein { opacity: 1; } this HTML: &lt;div id="save-success" class="fadeout"&gt; Successfully saved &lt;/div&gt;
upvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/28661349
downvote count: 0
tagged with: jquery

http://stackoverflow.com/q/28730665
has answer: http://stackoverflow.com/a/28730968
has comment: http://stackoverflow.com/comment/45747833
favorite count: 0
tagged with: parsing
has comment: http://stackoverflow.com/comment/45747729
score: 2
has comment: http://stackoverflow.com/comment/45747732
upvote count: 2
type: Question
has answer: http://stackoverflow.com/a/28730762
has answer: http://stackoverflow.com/a/28730839
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28730968
possible better answer: http://stackoverflow.com/a/28730762
has title: Should I toString() before I parseFloat() in javascript
has comment: http://stackoverflow.com/comment/45747760
downvote count: 0
tagged with: javascript
has body: I have a value in my project that I need to parseFloat(). The trick is that the value may be null, int or a string, but it will always be a number. My question is, is it best practice to toString() my value before parseFloat(). .ex: var num = null; num = parseFloat(num.toString()) Would this be correct, or should I just do this?: var num = null; num = parseFloat(num)
answer count: 3

http://stackoverflow.com/comment/45618078
has text: @sanjaypoyzer, if your file is big you shouldn't be reading the whole contents in memory as you currently do. So before thinking about how to append a record to such a file you should think about how to determine if the record id doesn't already exist. The `jsonfile` module still loads the entire file in memory so you have a problem at this stage. And if you already can afford loading the entire file in memory, then Brad's solution will help you.
type: AnswerComment
comment on: http://stackoverflow.com/a/28661311
score: 0
type: Comment

http://stackoverflow.com/q/28741363
has answer: http://stackoverflow.com/a/28741402
accepted answer: http://stackoverflow.com/a/28741402
has comment: http://stackoverflow.com/comment/45766158
answer count: 4
type: AnsweredQuestion
has title: Validating Input in javascript didn't work
has answer: http://stackoverflow.com/a/28741659
type: Question
has body: why this simple javascript code didn't run properly http://codepen.io/anon/pen/wBXKQY html Score: js function validateForm() { var score = document.getElementById("score").value; var scoreReg = /^\s*(\+|-)?\d+\s*$/; if (score.match(scoreReg)) { alert("the score pass"); return false; } } i just need to perform validation that is beyond the capabilities of the HTML5 input attributes.
has answer: http://stackoverflow.com/a/28741932
possible better answer: http://stackoverflow.com/a/28741659
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45766004
has answer: http://stackoverflow.com/a/28741678
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45595718
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28648967
has text: You cannot close any window using `window.close()`. You can only close windows that you opened manually using `window.open()`. If your browser has settings to allow pop-ups from your site, then `window.open(aaa.href, aaa.target)' will a new window with your `mmmmm.html` and `tab1.close()` will close that. In case your browser blocks your pop-up, you will get an error for calling close() on a window that doesn't exist.

http://stackoverflow.com/comment/45693603
type: AnswerComment
score: 0
type: Comment
has text: I meant sender.value() where sender is the combobox widget
comment on: http://stackoverflow.com/a/28668148

http://stackoverflow.com/comment/45517179
type: QuestionComment
has text: Could you maybe give an example for that? I mean didn't I have tried the same already?
type: Comment
comment on: http://stackoverflow.com/q/28605609
score: 0

http://stackoverflow.com/comment/45540893
type: Comment
type: QuestionComment
score: 0
has text: The issues I had with regex101.com was a result of being under the PHP tab, not javascript
comment on: http://stackoverflow.com/q/28618723

http://stackoverflow.com/a/28658692
downvote count: 0
answers question: http://stackoverflow.com/q/28658472
type: Answer
upvote count: 1
score: 1
has body: You want something like this : &lt;section&gt; &lt;div id="outer"&gt; &lt;div id="inner"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; section, #outer, #inner { padding: 20px; display: block; } section { background: url('http://st.depositphotos.com/1907633/3138/i/950/depositphotos_31380901-Abstract-metal-molecules-medical-background.jpg') no-repeat center center; } #outer { background-color: rgba(255, 255, 255, 0.5); } #inner { background-color: gray; } Link to jsfiddle: http://jsfiddle.net/77xyo575/

http://stackoverflow.com/a/28739067
accepted answer of: http://stackoverflow.com/q/28738832
answers question: http://stackoverflow.com/q/28738832
type: AcceptedAnswer
score: 1
type: Answer
upvote count: 1
has body: MDN: When setting a property on a JavaScript array when the property is a valid array index and that index is outside the current bounds of the array, the engine will update the array's length The length property is therefore not updating as you're using keys rather than numberical indexes. Since Array is also an Object, what you're doing is just attaching a property to it, which has no effect on length property whatsoever.
downvote count: 0

http://stackoverflow.com/q/28714916
possible better answer: http://stackoverflow.com/a/28715324
has title: How to change CSS of child element inside parent element Using jQuery onclick event?
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45717484
has comment: http://stackoverflow.com/comment/45717532
has answer: http://stackoverflow.com/a/28714998
accepted answer: http://stackoverflow.com/a/28714953
type: Question
has body: I have two menu icons, both classed .menuentry, with the IDs #topicicon and #searchicon, in a menubar. Beneath them are two larger divs, #topiclist and #searchform, both initially set to display:none;. What I would like to do is click each menu icon and display the corresponding larger div underneath, as well as getting rid of the other larger div if it has been display previously. So, for example, when I click #topicicon, it displays #topiclist and hides #searchform. The code is being used on this website, in the menubar at the top: http://bonfiredog.co.uk/bonfog And this is the code that I am using. HTML: &lt;div id="topicicon"&gt;&lt;img src="topic_icon.png" /&gt;&lt;/div&gt; &lt;div id="searchform"&gt;&lt;img src="search_icon.png" /&gt;&lt;/div&gt; &lt;div id="topiclist"&gt;&lt;/div&gt; &lt;div id="searchform"&gt;&lt;/div&gt; CSS: #topiclist { display:none; } #searchform { display:none; } jQuery: $("#topicicon").click(function(){ $("#topiclist").css("display", "visible"); $("#searchform").css("display", "none"); }, function(){ $("#formlist").css("display", "hidden"); }); Not working as of now...
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28715324
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28714953

http://stackoverflow.com/comment/45746074
has text: `this` depends on how you call the function. `new example().getB()`.
score: 0
comment on: http://stackoverflow.com/q/28729895
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28643327
has answer: http://stackoverflow.com/a/28643357
downvote count: 1
type: Question
has body: i want to change the values inside of class but its not changing here my code //html a b c d //javascript var box = document.getElementsByClassName('box'); var after = ['html', 'css', 'js' , 'jquery'] for (i = 0; i < box.length; i++) { box[i].value = after[i]; }
tagged with: javascript
has answer: http://stackoverflow.com/a/28643455
has comment: http://stackoverflow.com/comment/45584942
answer count: 2
has title: the values inside class not changing
favorite count: 0
has comment: http://stackoverflow.com/comment/45584947
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/45584952
score: 0
has comment: http://stackoverflow.com/comment/45584955
upvote count: 1

http://stackoverflow.com/q/28747746
accepted answer: http://stackoverflow.com/a/28748420
has comment: http://stackoverflow.com/comment/45778602
has comment: http://stackoverflow.com/comment/45777903
tagged with: animation
tagged with: css
tagged with: ellipse
type: AnsweredQuestion
upvote count: 3
has comment: http://stackoverflow.com/comment/45778396
type: Question
has title: Cycle through oval/elliptical object with CSS or JavaScript
has answer: http://stackoverflow.com/a/28748420
has comment: http://stackoverflow.com/comment/45777793
tagged with: javascript
has comment: http://stackoverflow.com/comment/45778456
has body: There's a small challenge that has taken my sleep for a few days. I didn't get success in all my attempts. To be honest, I didn't even get close. So, basically I need to animate the object (sun) so that it travels continuously along the path of the oval. When the sun is "in the sky" (that is, on the red part of the oval shown below) it should be visible, but it should not be visible when it is "below the horizon" (the light gray part of the oval below). I've seen many solutions with perfectly round objects, but none with an oval/elliptical object. I can't use a canvas here and it'll need to be responsive, but I can use CSS3 and some JavaScript plugin. Here is a link with my "sandbox", if you wanted to use it. http://codepen.io/caio/pen/pvKoJx Only to view the dashed, you can create an object with these properties. .path { border: 3px dashed black; border-radius: 100%; height: 360px; left: calc(50% - 295px); position: absolute; top: 165px; width: 590px; }
score: 3
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45777856
favorite count: 0

http://stackoverflow.com/comment/45747892
type: QuestionComment
comment on: http://stackoverflow.com/q/28730667
score: 0
type: Comment
has text: I am running an editor that (I BELEIVE) removes any "odd" characters from imputed text. http://markitup.jaysalvat.com/home/

http://stackoverflow.com/comment/45542215
comment on: http://stackoverflow.com/a/28619411
type: Comment
score: 0
type: AnswerComment
has text: the animation is almost still the same, comes up from top left. But it displays on the right side of the share button

http://stackoverflow.com/q/28737025
answer count: 2
has comment: http://stackoverflow.com/comment/45758547
possible better answer: http://stackoverflow.com/a/28737330
accepted answer: http://stackoverflow.com/a/28737265
has comment: http://stackoverflow.com/comment/45758558
has comment: http://stackoverflow.com/comment/45758398
tagged with: javascript
has answer: http://stackoverflow.com/a/28737330
favorite count: 0
score: 0
type: AnsweredQuestion
upvote count: 1
linked to: http://stackoverflow.com/q/5016313
has comment: http://stackoverflow.com/comment/45758523
downvote count: 1
type: Question
duplicate of: http://stackoverflow.com/q/5016313
has title: Create array of 24 with odd numbers as null
has body: Here's my code: var myArray = new Array(); for (var i = 0; i &lt; 24; i++ ){ myArray.push([i]); } How can I add/replace null values where there's 1, 3, 5, 7, 9...... ?
has answer: http://stackoverflow.com/a/28737265

http://stackoverflow.com/comment/45506456
comment on: http://stackoverflow.com/q/28599671
score: 0
type: Comment
type: QuestionComment
has text: Here is the [fiddle](http://jsfiddle.net/897fb0mj/1/)

http://stackoverflow.com/a/28660730
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28654203
answers question: http://stackoverflow.com/q/28654203
has body: The path of the file containing the worker onmessage declaration is relative to the html file - not the calling script file. I got it working by making the following edit: var myWorker = new Worker('../Scripts/worker.js');

http://stackoverflow.com/comment/109183697
has text: The link below shows related compatibility information: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/stack
comment on: http://stackoverflow.com/a/47105238
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/28634236
type: Answer
answers question: http://stackoverflow.com/q/28633826
has body: I would recommend the plugin DocBlockr for Sublime Text (I don't use Coda). To install it, just install the Package Control, open the command palette (Ctrl + Shift + P), type package control install package (I personally do pci), then search for DocBlockr. It will not change your normal comments, but it will do this : /** press tab or enter /** * */ It will also add lines accordingly, e.g: /** * cursor on this line */ press enter /** * cursor on this line * */
score: 2
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/45500228
score: 0
type: AnswerComment
type: Comment
has text: I think you're missing msIE & you might want to return `0` instead of `-1`: the first is equivalent for `false` which can then be used as a boolean ; the last is read as `true`so you function will always return `true`.
comment on: http://stackoverflow.com/a/28596440

http://stackoverflow.com/q/28629648
type: AnsweredQuestion
downvote count: 0
score: 13
type: Question
linked to: http://stackoverflow.com/q/42376287
tagged with: param
has answer: http://stackoverflow.com/a/28629791
possible better answer: http://stackoverflow.com/a/28629860
has answer: http://stackoverflow.com/a/69703945
tagged with: javascript
upvote count: 13
accepted answer: http://stackoverflow.com/a/28636388
has title: jQuery append params to url
tagged with: url
has answer: http://stackoverflow.com/a/28636388
has body: I like the way jQuery's $.ajax() method allows to specify request url: { url: 'http://domain.com/?param=1', data{ param2: '2' } } $.ajax() method will (probably) call $.param() on provided data and optionally append it to provided URL. My question is: is this type of url manipulation available outside of $.ajax() call? For example, I want to open a popup window, and I would like to construct URL in the same way that I do with $.ajax(). I have written a function which does this, but I have a feeling I am reinventing the wheel and duplicating already existing function of jQuery: var prepareUrl = function( url, data ) { var params = $.param( data ); if ( params.length &gt; 0 ) { // url contains a query string if ( url.indexOf( '?' ) &gt; -1 ) { // get last char of url var lastChar = url.substr( url.length - 1 ); // Append &amp; to the end of url if required if ( lastChar != '&amp;' &amp;&amp; lastChar != '?' ) { url += '&amp;'; } } else // url doesn't contain a query string { url += '?'; } url += params; } return url; } thanks!
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28629860
has answer: http://stackoverflow.com/a/28629799
answer count: 5

http://stackoverflow.com/comment/45622044
score: 0
type: QuestionComment
type: Comment
has text: possible duplicate of [Internationalization inside JavaScript](http://stackoverflow.com/questions/934175/internationalization-inside-javascript)
comment on: http://stackoverflow.com/q/28646980

http://stackoverflow.com/q/28731994
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has body: I have javascript code that generates a link that, when clicked, is supposed to download a JSON file. The generated link is something like: download The link works fine in Chrome and Firefox (the file downloads), but Safari displays the JSON in the browser window instead of downloading. I tried changing the mime-type to application/octet-stream but Safari still displays it instead of downloading. Is it possible to get Safari to download this file instead of showing it without having all Safari users reconfigure their browser settings and hopefully without being forced to zip the file? Thanks!
tagged with: safari
score: 1
tagged with: http://stackoverflow.com/tag/json
type: Question
has title: Safari shows the contents of JSON files instead of downloading them
tagged with: javascript
has answer: http://stackoverflow.com/a/28732394

http://stackoverflow.com/q/28596169
has comment: http://stackoverflow.com/comment/45499099
upvote count: 0
has comment: http://stackoverflow.com/comment/45499646
has comment: http://stackoverflow.com/comment/45499071
has comment: http://stackoverflow.com/comment/45499336
type: Question
has comment: http://stackoverflow.com/comment/45499268
linked to: http://stackoverflow.com/q/28460760
score: -2
has title: Clicking on Dice won't work (javascript)
downvote count: 2
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I am trying to initialize a die and roll it based on a click. This is what I have come up with so far. It works when I call roll in the console, but it won't work when I click. function Dice() { this.die = randInt(0,5); this.icons = "⚀⚁⚂⚃⚄⚅"; this.el = "&lt;d6&gt;" + this.icons.charAt(this.die) + "&lt;/d6&gt;"; } Dice.prototype.render = function() { $( "d6" ).remove(); $("body").append(this.el); } Dice.prototype.roll = function() { this.die = randInt(0,5); this.el = "&lt;d6&gt;" + this.icons.charAt(this.die) + "&lt;/d6&gt;"; this.render(); } Here is my click function that I've been trying out. Any help? var dice = this; $("this.el").click(function(){ dice.roll(); });
has comment: http://stackoverflow.com/comment/45499479
has comment: http://stackoverflow.com/comment/45498877
has answer: http://stackoverflow.com/a/28596624
accepted answer: http://stackoverflow.com/a/28596624
type: AnsweredQuestion

http://stackoverflow.com/a/47636869
has comment: http://stackoverflow.com/comment/118659603
upvote count: 1
has comment: http://stackoverflow.com/comment/118584552
score: 1
has comment: http://stackoverflow.com/comment/87917650
answers question: http://stackoverflow.com/q/28749519
has body: You could use a setTimeout to go to the link after the animation. var someData = 'foo'; //This value is irrelevant, just there for syntactical consistency. $("#link").on("click", function() { setTimeout(doThisAfterTimeExpires,2000); $(this).animate({width: "100px", height: "100px", opacity: "0"}, 150); }); function doThisAfterTimeExpires(){ var form = $("&lt;form method='POST'&gt;&lt;/form&gt;"); form.attr("action", "http://someurl.com"); var input = $("&lt;input type='hidden'/&gt;"); input.val(someData); form.append(input); $(document.body).append(form); form.submit(); }
downvote count: 0
type: Answer

http://stackoverflow.com/a/28715233
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45719327
has comment: http://stackoverflow.com/comment/45718559
has comment: http://stackoverflow.com/comment/45721199
answers question: http://stackoverflow.com/q/28714638
has comment: http://stackoverflow.com/comment/45718969
score: 0
has comment: http://stackoverflow.com/comment/45718853
has comment: http://stackoverflow.com/comment/45721948
has body: You can use FormData to send files in XMLHttpRequest like below . Although Chrome &amp; FF support it well, it works only in IE10 or above. var xhr = new XMLHttpRequest(); var file = document.getElementById("fileUpload"); var formData = new FormData(); formData.append("upload", file.files[0]); xhr.open("post", "your-url", true); xhr.setRequestHeader("Content-Type", "multipart/form-data"); xhr.upload.onload = function(event){ // handle successful upload }; xhr.send(formData);
type: Answer
has comment: http://stackoverflow.com/comment/45720725

http://stackoverflow.com/q/28748714
answer count: 1
tagged with: jquery
favorite count: 0
has body: I want change current Idx(index) in input name, after remove inputs. At the beginning of the input names of the is as: row 1 : airline[0] flight_time[0] flight_number[0] row 2 : dOfv[] row 3 : airline[2] flight_time[2] flight_number[2] now, after remove row 2, i want change input name in other rows like this: row 1 : airline[0] flight_time[0] flight_number[0] row 3 : airline[1] flight_time[1] flight_number[1] DEMO: http://jsfiddle.net/5nykq0e6/ what do i do? Html: 1. X 2. X 3. X JS: $(document).on('click', 'a.remove_input', function(e) { e.preventDefault(); $(this).closest('div.one').remove(); $('.one').each(function(i, el) { //return parseInt($.trim(text)) - 1; var text = $(el).text(); var currentIdx = parseInt(str.match(/\d+/)[0], 10); $(el).text('name', str.replace(currentIdx, i)); }) })
tagged with: regex
has comment: http://stackoverflow.com/comment/45779669
type: AnsweredQuestion
downvote count: 2
has answer: http://stackoverflow.com/a/28748857
has title: Change current Index input dynamic jQuery
tagged with: each
has comment: http://stackoverflow.com/comment/45779527
type: Question
score: -2
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28748857
upvote count: 0

http://stackoverflow.com/a/28607277
score: 2
answers question: http://stackoverflow.com/q/28597419
downvote count: 0
type: Answer
upvote count: 2
has body: As an alternative you could use: B1 Saves you the jquery part. JS to alert the ID: function reply_click(clicked_id) { alert(clicked_id); } Cheers, Valentin

http://stackoverflow.com/comment/45773205
comment on: http://stackoverflow.com/a/28744975
type: AnswerComment
score: 0
type: Comment
has text: I did edit my original code but to no success...I can't seem to find out why he does not include the "people" model correctlyµ

http://stackoverflow.com/a/28668850
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28666309
has body: There is a windows 7 cordova https://github.com/otcshare/cordova-win7 More info: http://www.raymondcamden.com/2012/07/12/Windows-7-version-of-PhoneGapCordova New link https://github.com/fabriceds/cordova-win7 And I have forked it so it will never be deleted https://github.com/jcesarmobile/cordova-win7
answers question: http://stackoverflow.com/q/28666309
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/45632520
downvote count: 0
has comment: http://stackoverflow.com/comment/45672182
has comment: http://stackoverflow.com/comment/45672429
has comment: http://stackoverflow.com/comment/45634165
score: 4
has comment: http://stackoverflow.com/comment/55349120
has comment: http://stackoverflow.com/comment/55348233

http://stackoverflow.com/a/28632775
has comment: http://stackoverflow.com/comment/45566322
has comment: http://stackoverflow.com/comment/45565819
type: Answer
has body: It only returns 1 URL because it only returns the first one. You should encode your entire array and loop in the success function like so: PHP: $id = $_GET['id']; $data = file_get_contents('__url'); parse_str($data); $array = explode(',', $url_encoded_fmt_stream_map); echo json_encode($array); JS: $.ajax({ url:"file.php", dataType: 'jsonp', data: {id: id}, success:function(response){ var res = JSON.parse(res); $.each(res, function(key, index){ $('body').append(index); }); } });
has comment: http://stackoverflow.com/comment/45565992
answers question: http://stackoverflow.com/q/28632637
upvote count: 5
has comment: http://stackoverflow.com/comment/45568624
score: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/45567293

http://stackoverflow.com/comment/45658714
has text: Here, `datasource` is the name of your variable in directive `scope`, not the attribute name. Use `datasource: "=datasource"` so you can use `datasource` attribute in your HTML. `datasource: "="` works too (shortcut for using same name as attribute)
type: QuestionComment
comment on: http://stackoverflow.com/q/28682899
type: Comment
score: 2

http://stackoverflow.com/a/28624189
downvote count: 0
has comment: http://stackoverflow.com/comment/45549861
upvote count: 2
has body: From documentation: Insert Records can be inserted to a collection with insert collection.insert(docs[[, options], callback]) So what you want can be done via callback function. I think you can solve your task User.addUser = function(db, email, username, password, firstname, lastname, company, twitter, callback){ var _id = new mongodb.ObjectID(); db.get('users').insert({ _id: _id, email : email, verified : false, password : password, username : username, firstname : firstname, lastname : lastname, company : company, twitter : twitter, rank : config.RANK_USER }, callback); }; So callback function will be called when insertion is completed. It receive two arguments: error and result. function callback(err, res){ // some actions } Read this question, it can help!
accepted answer of: http://stackoverflow.com/q/28623910
answers question: http://stackoverflow.com/q/28623910
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/45550040
score: 2

http://stackoverflow.com/q/28633021
score: 6
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29122711
upvote count: 6
tagged with: java
type: Question
tagged with: libgdx
has comment: http://stackoverflow.com/comment/45586628
tagged with: javascript
has comment: http://stackoverflow.com/comment/45601943
has comment: http://stackoverflow.com/comment/45584930
has answer: http://stackoverflow.com/a/32165412
answer count: 2
downvote count: 0
has body: So, I made a libgdx project trough the gradle setup and programmed my game. When i launch it on desktop, everything is ok, but when I try to run the html I get the following error: :html:draftCompileGwt FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':html:draftCompileGwt'. &gt; Process 'command 'C:\Program Files\Java\jdk1.8.0_25\bin\java.exe'' finished with non-zero exit value 1 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 16.256 secs Process 'command 'C:\Program Files\Java\jdk1.8.0_25\bin\java.exe'' finished with non-zero exit value 1 17:40:11: External task execution finished 'superDev'. I have searched the internet, but I haven't found anything useful. What could be the cause of the problem? Update: Running with --stacktrace: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':html:draftCompileGwt'. &gt; Process 'command 'C:\Program Files\Java\jdk1.8.0_25\bin\java.exe''finished with non-zero exit value 1 * Try: Run with --info or --debug option to get more log output. * Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':html:draftCompileGwt'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46) at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42) at org.gradle.ap…
favorite count: 0
type: UnansweredQuestion
has title: Why can't I launch my LibGDX project on html?

http://stackoverflow.com/q/28612145
has body: I am trying to animate the adding and removal of an ImageOverlay on my map. Basically, TileLayer has this getContainer() function which allows to retrieve the html element corresponding to the layer. I can then call a fadeIn() or fadeOut() function to animate it like so: $(tileLayer.getContainer()).fadeOut(5000, function(){ map.removeLayer(tileLayer); }); I would like to reproduce the same behaviour with my ImageOverlay, but there are no functions that enable to get the image element (leaflet docs). Is there any way to do this?
tagged with: javascript
answer count: 1
has answer: http://stackoverflow.com/a/28613878
tagged with: jquery
has title: Animation when add or remove ImageOverlay in Leaflet API
type: AnsweredQuestion
tagged with: leaflet
accepted answer: http://stackoverflow.com/a/28613878
score: 0
type: Question

http://stackoverflow.com/a/31589991
has body: Just a quick answer here. In short: you can't get specified styles with today's API's. I was able to solve my specific problem by temporarily turning off font-boosting by using text-size-adjust (prefixed with -webkit- for Safari).
type: Answer
accepted answer of: http://stackoverflow.com/q/28616257
score: 0
answers question: http://stackoverflow.com/q/28616257
type: AcceptedAnswer

http://stackoverflow.com/comment/45612149
score: 0
type: Comment
type: QuestionComment
has text: Regarding your linked JS Fiddle demo: `Uncaught ReferenceError: moveButton is not defined`
comment on: http://stackoverflow.com/q/28658121

http://stackoverflow.com/comment/45648262
type: Comment
type: QuestionComment
has text: Please explain what change you made to add another slide. Showing us a wall of markup doesn't do that.
comment on: http://stackoverflow.com/q/28677546
score: 0

http://stackoverflow.com/comment/45714000
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28713028
has text: use should not use same library two versions , its not recommend.

http://stackoverflow.com/comment/45517750
comment on: http://stackoverflow.com/a/28606789
type: Comment
has text: Check simple example.
score: 0
type: AnswerComment

http://stackoverflow.com/a/28699881
answers question: http://stackoverflow.com/q/28699733
has comment: http://stackoverflow.com/comment/45690294
has comment: http://stackoverflow.com/comment/45690062
score: 0
has comment: http://stackoverflow.com/comment/45690646
has comment: http://stackoverflow.com/comment/45690165
has comment: http://stackoverflow.com/comment/45690407
type: Answer
has body: currentNode points to the root, because then it can recursively traverse the document subtree, calling each childNode as the root of its own tree. It is not necessarily pointing to the root of the document, just the root node the tree was created with. See tree traversal

http://stackoverflow.com/a/28625600
has body: You can use sort to achieve this if you implement you own custom sort function. Something like this: function sortFunc(a, b) { if (a.name &lt; b.name) return -1; else if (a.name &gt; b.name) return 1; else { if (a.lastname &lt; b.lastname) return 1; else if (a.lastname &gt; b.lastname) return -1; else { if (a.marks &lt; b.marks) return 1; else if (a.marks &gt; b.marks) return -1; } return 0; } } console.log(data1.sort(sortFunc)); Example fiddle
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45553339
answers question: http://stackoverflow.com/q/28625506
has comment: http://stackoverflow.com/comment/45553245
upvote count: 2
has comment: http://stackoverflow.com/comment/45553191
has comment: http://stackoverflow.com/comment/45553087

http://stackoverflow.com/comment/45685219
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28687795
has text: thanks i just realize to use $('#myModal').modal('hide'); on my jQuery. thanks mate

http://stackoverflow.com/q/28596579
has body: I'm new to programming and this is my first question I've had to post. What I'm trying to do is use ng-bind-html to place five image files into the div that is being created by ng-repeat. These five image files will differ between each element from the ng-repeat. {{newGame.price}} {{newGame.description}} {{newGame.numberReviews}} reviews I also have this in myApp, and no problems with sce being undefined etc. $scope.html = getStars(newGame); $scope.trustedHtml = $sce.trustAsHtml($scope.html); If I replace the newGame in getStars(newGame) with something defined under the scope the code works, however using newGame (trying to match with the temporary variable from ng-repeat = "newGame in myGamesList"), nothing appears. How can I make it so newGame is recognized as each element that is being iterated upon? The function getStars has the following code $scope.getStars = function(game) { var numStars = (game.numberStars); iconString = ''; for (i=0; i<Math.floor(numStars); i++) { iconString += ' ' } if (numStars%1 == 0.5) { iconString += ' ' } for (j=0; j<(5-Math.ceil(numStars)); j++) { iconString += ' ' } return iconString; }; In case that is helpful. To clarify, I need each newGame in myGamesList to be the parameter that is input to the getStars function. Sorry if this is hard to follow, but I tried to cover all my bases!
accepted answer: http://stackoverflow.com/a/28597121
tagged with: ng-bind-html
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has title: ng-bind-html using a function not recognizing temporary variable form ng-repeat
tagged with: angularjs
has answer: http://stackoverflow.com/a/28597121
tagged with: http://stackoverflow.com/tag/html
tagged with: angularjs-ng-repeat
score: 2
type: AnsweredQuestion
upvote count: 2
type: Question

xpath
tags question: http://stackoverflow.com/q/28697837
tags question: http://stackoverflow.com/q/28731524
tags question: http://stackoverflow.com/q/28635191
tag name: xpath
tags question: http://stackoverflow.com/q/28599111
tags question: http://stackoverflow.com/q/28670235
tags question: http://stackoverflow.com/q/28653570
tags question: http://stackoverflow.com/q/28719340
type: Tag

http://stackoverflow.com/comment/45554934
score: 1
has text: The short answer is you can't do this. The `onbeforeunload` event can *only* be used to trigger that popup, it can't be used for anything else. Your only options for something like this are to attach an event to every outbound link on your page. However, there is no way to directly capture an event for someone leaving via other means (manually typing a url, closing the tab etc).
comment on: http://stackoverflow.com/q/28627111
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45735574
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28723361
has text: What value are you using to test?
score: 0

http://stackoverflow.com/comment/45514276
type: Comment
has text: Yes! when I will go to view source, code from test.js should be displayed on view source.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28604668

http://stackoverflow.com/comment/50464257
has text: Where in the world are the *built-in* class methods even documented? (`beforeCreate`, `beforeValidate`, etc)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28616900
type: AnswerComment

http://stackoverflow.com/q/28710100
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28954894
accepted answer: http://stackoverflow.com/a/28954894
has body: Im developing an app for android devices, and found that samsung galaxy S4 specifically, has extremely poor performance when app/web page uses canvas. Odd thing is, that its not always the case. I have tested 2 sample apps. http://ie.microsoft.com/testdrive/Performance/FishIETank/Default.html and http://ie.microsoft.com/testdrive/Graphics/TouchEffects/Default.html the first one works fine, and outperforms my Nokia (which is dual core) and is expected. However, the other demo, is almost completely unresponsive and framerate is close to 1, where as all other devices render it fine. Since the first app runs well and the other one doesnt, it beggs the question, why ? First one has no event listeners, where as the other one has touch listeners. Could touchmove be the cause instead of canvas...or is that demo using some canvas features that the other one isnt, and thus has poor performance. I have read lots of topics about this issue, and none seem to have answer. Most are many months old...so i thought ill make a new topic. Is there any way to solve the canvas issue on Samsung S4 ... and potentially other android devices running 4.2.x. If any StackOverflow users here has S4, can you test both demos and confirm my observations?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46163464
downvote count: 0
has comment: http://stackoverflow.com/comment/45713612
has title: Some Android devices extremely slow when rendering canvas elements
has comment: http://stackoverflow.com/comment/45711558
score: 13
has comment: http://stackoverflow.com/comment/45743980
has comment: http://stackoverflow.com/comment/45711710
type: Question
tagged with: mobile
has comment: http://stackoverflow.com/comment/45709333
tagged with: javascript
upvote count: 13
tagged with: canvas
answer count: 1
has comment: http://stackoverflow.com/comment/45744327
favorite count: 0
tagged with: android

http://stackoverflow.com/comment/45734300
type: Comment
type: QuestionComment
has text: The spacing didn't matter, but was fixed. I will rewrite items2 using jQuery function to see if that fixes it. Stay tuned.
comment on: http://stackoverflow.com/q/28723225
score: 0

http://stackoverflow.com/comment/45604469
type: Comment
comment on: http://stackoverflow.com/a/28653701
has text: Would the jquery code go into a function embedded within a script tag?
score: 0
type: AnswerComment

http://stackoverflow.com/a/28615733
answers question: http://stackoverflow.com/q/28615689
has body: You need to cut the string, concatenate the pageno, and then pick up the string again: var contentString = ' '+ ' '+ ' '+ ' display info '+ ' '+ 'page number '+ pageno + ' page , link '+ ' '+ ' '; The String-conversion is not needed either, since JavaScript does that internally, much like Java has a toString() method on it's classes.
type: Answer
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28615689
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45744327
comment on: http://stackoverflow.com/q/28710100
type: Comment
type: QuestionComment
score: 3
has text: the performance depends on the Android Version, the phone firmware (different firmwares like CyanoGen, SlimSaberKat, Samsung Stock, Google Play Version... use different configurations for the GPU) and of course the browser used (Chrome / AOSP) . Check out `chrome://gpu` if you are using chrome browser to see if you are using accelerated HW canvas.

http://stackoverflow.com/comment/45597239
type: AnswerComment
score: 0
has text: Sorry, I don't get it. Do you mean to take out the fitBound function from inizialize(), put it in a new function, and call it from a new listener? I tried, but still nothing... Besides the resize event function, it seems fitBounds just does nothing when it's called on load.
type: Comment
comment on: http://stackoverflow.com/a/28649221

http://stackoverflow.com/comment/45622000
has text: Your "jsfiddle fail" link appears to show a working version (I'm using Chrome). What's a failure about it?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28663482
type: AnswerComment

http://stackoverflow.com/comment/45596312
has text: I suggest you use tabs within a single page. That way you'll have more control. And for your use case, where in the home page has to be reloaded you can just fire an Ajax call, get the updated content, update your home tab div just before moving focus to that tab :-)
comment on: http://stackoverflow.com/q/28648967
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28640853
linked to: http://stackoverflow.com/q/27255364
has body: I've been working with a function I found on stackoverflow here that works as far as I can tell by grouping the layers, dumping layer names into an array then ungrouping them. function getSelectedLayers(){ var idGrp = stringIDToTypeID( "groupLayersEvent" ); var descGrp = new ActionDescriptor(); var refGrp = new ActionReference(); refGrp.putEnumerated(charIDToTypeID( "Lyr " ),charIDToTypeID( "Ordn" ),charIDToTypeID( "Trgt" )); descGrp.putReference(charIDToTypeID( "null" ), refGrp ); executeAction( idGrp, descGrp, DialogModes.ALL ); var resultLayers=new Array(); for (var ix=0;ix&lt;app.activeDocument.activeLayer.layers.length;ix++){resultLayers.push(app.activeDocument.activeLayer.layers[ix])} var id8 = charIDToTypeID( "slct" ); var desc5 = new ActionDescriptor(); var id9 = charIDToTypeID( "null" ); var ref2 = new ActionReference(); var id10 = charIDToTypeID( "HstS" ); var id11 = charIDToTypeID( "Ordn" ); var id12 = charIDToTypeID( "Prvs" ); ref2.putEnumerated( id10, id11, id12 ); desc5.putReference( id9, ref2 ); executeAction( id8, desc5, DialogModes.NO ); return resultLayers; } var layers = getSelectedLayers(); Unfortunately when no layers are selected and this function is run Photoshop throws the message The command “Group Layers” is not currently available. Is there any way to at least return a null value when this happens without the script stalling? That way I could display a message about needing to select layers when it's null. OR Is there any way to determine that no layers are selected before the function tries to run the grouping function? Any help is greatly appreciated!
tagged with: photoshop-script
score: 0
type: Question
answer count: 1
tagged with: javascript
tagged with: photoshop
tagged with: photoshop-cs4
type: UnansweredQuestion
has title: Getting active layers with PS CC JS, failing with no layers selected
has answer: http://stackoverflow.com/a/28645996

http://stackoverflow.com/q/28605645
has title: Show inputs by number choose
has comment: http://stackoverflow.com/comment/45515897
has comment: http://stackoverflow.com/comment/45515789
has body: I wanted to build something and I just can't do that :O What i'v tried to do is something like.. If I write 2 in and input it will show me 2 inputs, if I write 3 it will show 3 inputs fields .. I'v tried to work on this with js but I don't success.. But I need that can't choose more than 10. Thanks for help, sorry for my bad English. Edit: I write this code: Select Low Normal High Critical But this code just write the selected text in the div. I want to if you select number (example 3) it will show 3 Div's
type: UnansweredQuestion
downvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/45516504
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45515704
upvote count: 0
answer count: 1
tagged with: arrays
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45515674
has answer: http://stackoverflow.com/a/28606040
tagged with: input

http://stackoverflow.com/a/28601239
type: Answer
has body: Here's what you can do. Using a directive you can keep track of each element and on the final element call a function that will calculate the height of each and find the tallest then set all elements to that height. You will need to use angular's $timeout in order to make sure that you don't check for the heights until after angular has finished manipulating the dom. Here's some code and below I've placed a link to a plunker. HTML &lt;div equalize-height&gt; &lt;div class="element-class" equalize-height-add="item" ng-repeat="item in items"&gt; &lt;div class="element-title" ng-bind="item.title"&gt;&lt;/div&gt; &lt;p class="element-text" ng-bind="item.description"&gt;&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; Angular .directive('equalizeHeight', ['$timeout', function($timeout){ return { restrict: 'A', controller: function($scope){ console.log('equalizeHeightFor - controller'); var elements = []; this.addElement = function(element){ console.log('adding element:', element); elements.push(element); console.log(elements); } // resize elements once the last element is found this.resize = function(){ $timeout(function(){ console.log('finding the tallest ...'); // find the tallest var tallest = 0, height; angular.forEach(elements, function(el){ height = el[0].offsetHeight; console.log('height:', height); if(height &gt; tallest) tallest = height; // console.log(el); }); console.log('tallest:', tallest); console.log('resizing ...'); // resize angular.forEach(elements, function(el){ el[0].style.height = tallest + 'px'; }); console.log('-- finished --'); }, 0); }; } }; }]) .directive('equalizeHeightAdd', [function($timeout){ return { restrict: 'A', require: '^^equalizeHeight', link: function(scope, element, attrs, ctrl_for){ console.log('equalizeHeightAdd - link'); // add element to list of elements ctrl_for.addElement(element); if(scope.$last) ctrl_for.resize(); } }; }]) Here's a link to a plunker too see it in action: http://plnkr.co/edit/X4jmwZ?p=preview
upvote count: 4
type: AcceptedAnswer
score: 4
accepted answer of: http://stackoverflow.com/q/28599626
downvote count: 0
answers question: http://stackoverflow.com/q/28599626

http://stackoverflow.com/comment/45614214
type: QuestionComment
has text: @tabz100.. good catch, it should be `window.XMLHttpRequest` or just `XMLHttpRequest`
comment on: http://stackoverflow.com/q/28659258
score: 0
type: Comment

http://stackoverflow.com/comment/45526386
has text: @MohitBhasi: `(...)` is the *grouping operator*. Just like you can do `!(x)` instead of `!x`. It's a bit unusual, but not wrong.
type: Comment
comment on: http://stackoverflow.com/a/28611233
type: AnswerComment
score: 0

http://stackoverflow.com/a/28729170
has comment: http://stackoverflow.com/comment/45744611
type: Answer
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/28729147
upvote count: 3
has body: The number 15 is divisible by both 3 and 5. If you don't test it first, then you'll never get there. So let's take 30 as an example. If you check 15 first, you'll see that it's divisible by 15. However, if you check either 5 or 3 first, it'll be flagged as being divisible by either of those.

http://stackoverflow.com/comment/45688383
type: AnswerComment
type: Comment
has text: worked - but only when it is in the slider template =) thank you !
score: 0
comment on: http://stackoverflow.com/a/28696961

http://stackoverflow.com/q/28697390
type: AnsweredQuestion
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45685595
has comment: http://stackoverflow.com/comment/45685071
type: Question
has body: Coming from a .net background, I want to refactor my html/js application. I am moving functions to a seperate js file. How do I (can I) structure my functions in a class hierarchy? myAppFunctions.ui Function A myAppFunctions.db Function B myApFunctions.math Function C I would like to add a js link to my page, and call them using, I.e. myAppFunctions.math.C Also, how do I return values to my top level calling code? I am not looking for inheritance, instantiating objects etc at this time. I just need a good way to structure my code so it makes sense. Thanks
answer count: 2
has comment: http://stackoverflow.com/comment/45684987
tagged with: javascript
upvote count: 1
has answer: http://stackoverflow.com/a/28697593
accepted answer: http://stackoverflow.com/a/28697593
possible better answer: http://stackoverflow.com/a/28697788
favorite count: 0
has answer: http://stackoverflow.com/a/28697788
has title: Javascript class hierarchy (Is there such a thing?)

http://stackoverflow.com/comment/45593599
score: 0
type: AnswerComment
type: Comment
has text: Ok, well before all text with the id `sizeable` could be made bigger or smaller when the user clicks the button, but with yours the text can either have the `id="plustext" onclick="resizeText(this,1)"` that will make it bigger or the ` World ` that will make it smaller, whereas before the text could either be made bigger or smaller.
comment on: http://stackoverflow.com/a/28647790

http://stackoverflow.com/a/29595598
type: Answer
answers question: http://stackoverflow.com/q/28717253
score: 0
has body: Most probably, what you need is to leverage the power of local storage. See here for a good introduction: http://www.w3schools.com/html/html5_webstorage.asp

http://stackoverflow.com/comment/45570322
comment on: http://stackoverflow.com/q/28635199
score: 0
type: Comment
type: QuestionComment
has text: PS: The div I'm capturing an snapshot of is a content-editable div with a background colour and html text within.

http://stackoverflow.com/a/28684220
type: Answer
downvote count: 0
score: 1
has body: I had hoped you could do it with just a find but apparently not. You have to use each to loop through all the elements. $(".btnClass").click(function(){ $(".testClass").each(function() { console.log($(this).attr('data-associateid')); }); }); View it here: http://jsfiddle.net/rt677qp5/
has comment: http://stackoverflow.com/comment/45661534
answers question: http://stackoverflow.com/q/28683910
upvote count: 1

http://stackoverflow.com/comment/45772503
type: AnswerComment
comment on: http://stackoverflow.com/a/28744854
score: 0
type: Comment
has text: @ThomasPereira: far as I know, there is no way to do this gobally and automatically for all variables and event listeners. You have to reset each global variable and unbind each listener one by one...

http://stackoverflow.com/comment/45553389
type: Comment
type: QuestionComment
has text: I know javascript but it is also run in sequential way So how javascript and node different ?
comment on: http://stackoverflow.com/q/28626093
score: 0

http://stackoverflow.com/comment/45692439
has text: my function also doesn't set these variables.
comment on: http://stackoverflow.com/a/28698695
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/28692547
has body: Mine works fine, does is what you needed to do ? $(function() { // configuration // button var add = $('#add'); // list container var listContainer = $('#list'); // click event for button add.on('click', function() { event.preventDefault(); // stop default behaviour of submit button // value of input inputValue = $('#input').val(); // add new list item listContainer.prepend(' ' + inputValue + ' '); // clear value input $('#input').val(''); }); }); Add Item
score: 2
has comment: http://stackoverflow.com/comment/45676864
upvote count: 3
type: AcceptedAnswer
downvote count: 1
accepted answer of: http://stackoverflow.com/q/28692345
type: Answer
has comment: http://stackoverflow.com/comment/45676436
answers question: http://stackoverflow.com/q/28692345

http://stackoverflow.com/q/28721301
upvote count: 2
type: Question
tagged with: split
tagged with: indexof
tagged with: javascript
has answer: http://stackoverflow.com/a/28721586
possible better answer: http://stackoverflow.com/a/28721453
has answer: http://stackoverflow.com/a/28721453
has answer: http://stackoverflow.com/a/28721413
score: 2
downvote count: 0
tagged with: string
has answer: http://stackoverflow.com/a/28721438
favorite count: 0
has comment: http://stackoverflow.com/comment/45729376
has body: I have a value - toggle-save_2 I want to extract the 2 part. The part after the underscore will always be what i need but the length of the former part, which in this case is toggle-save_, may vary (eg. notoggle-val_45). Though this length may vary it will always be separated from the end number by an underscore. Right now I am using this var current = this.id.split('_'); current = current[1]; to select the number. What would be cool is if I could pass a variable to the split to only give me the second index of the result from the split.
has title: Javascript selecting to save one index of split()
answer count: 4
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28721413

http://stackoverflow.com/q/28595742
has title: Chrome bug? Content not rendering multi-columns properly
accepted answer: http://stackoverflow.com/a/28618965
tagged with: http://stackoverflow.com/tag/html
answer count: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/45498296
tagged with: css
has comment: http://stackoverflow.com/comment/45500258
has comment: http://stackoverflow.com/comment/45502851
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/32727445
has answer: http://stackoverflow.com/a/37946599
has answer: http://stackoverflow.com/a/28618965
has body: I have this code: http://jsfiddle.net/zqdLzya2/ Which is a dead simple 3-column layout. When you hover an item some of them blink or just disappear for a second. Also when content moves up it goes over the title, disappear and renders fine. Some blinking also occurs when you scroll. Content is displayed fine but does not render. Update 1 Elements stop blinking when there's no CSS transition or transform. Update 2 Elements stop blinking or doing anything crazy when there's no transform so I've removed the read more button. Update 3 Bug has been reported here: https://code.google.com/p/chromium/issues/detail?id=460222 I've tried the same code on Opera, Firefox and Safari and they all seem to render fine. Is this a Chrome bug? Here some screenshots: Here is my naked HTML code: [title goes could be one line title or five] 2th of January, 2015 Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatum, debitis. Read More Here is my SCSS code: @mixin break-inside($content){ break-inside: $content; -webkit-column-break-inside: $content; } @mixin columns($count: 3, $gap: 10){ -webkit-column-count: $count; -moz-column-count: $count; column-count: $count; -webkit-column-gap: $gap; -moz-column-gap: $gap; column-gap: $gap; } .span-image-title { @include columns(3,1rem); .item { @include break-inside(avoid); display: inline-block; position:relative; overflow: hidden; width:100%; margin-bottom:rem(15px); } .item:hover { .desc-body { @include transition( 0.6s ease bottom , 0.3s ease background-color 0.2s ); bottom:0; background-color:#f4f4f4; } .desc { // @include transition( 0.3s ease border-bottom 0.5s ); // border-bottom:1px solid $text-color; } .entry-content, .blue-btn { opacity: 1; } } .image { height:370px; background-size:cover; background-repeat: no-repeat; background-position: center center; } .desc { position: relative; z-index:5; // border-bottom:1px solid transparent; } .entry-content, .blue-btn { @include transition( 0.5s ease opacity 0.3s , 0.3s ease trans…
has answer: http://stackoverflow.com/a/32727445
tagged with: google-chrome
has answer: http://stackoverflow.com/a/35580556
type: Question
score: 20
upvote count: 20
has comment: http://stackoverflow.com/comment/45498640
has comment: http://stackoverflow.com/comment/63341933
downvote count: 0
tagged with: javascript

object
tags question: http://stackoverflow.com/q/28630480
tag name: object
tags question: http://stackoverflow.com/q/28744690
tags question: http://stackoverflow.com/q/28604744
tags question: http://stackoverflow.com/q/28653609
tags question: http://stackoverflow.com/q/28749937
tags question: http://stackoverflow.com/q/28682452
tags question: http://stackoverflow.com/q/28604132
tags question: http://stackoverflow.com/q/28732846
tags question: http://stackoverflow.com/q/28636197
tags question: http://stackoverflow.com/q/28645297
tags question: http://stackoverflow.com/q/28729797
tags question: http://stackoverflow.com/q/28723353
tags question: http://stackoverflow.com/q/28646153
tags question: http://stackoverflow.com/q/28637232
tags question: http://stackoverflow.com/q/28720507
tags question: http://stackoverflow.com/q/28603799
tags question: http://stackoverflow.com/q/28612296
tags question: http://stackoverflow.com/q/28642017
tags question: http://stackoverflow.com/q/28686445
tags question: http://stackoverflow.com/q/28676313
tags question: http://stackoverflow.com/q/28649023
tags question: http://stackoverflow.com/q/28674041
tags question: http://stackoverflow.com/q/28719797
tags question: http://stackoverflow.com/q/28674549
tags question: http://stackoverflow.com/q/28609746
tags question: http://stackoverflow.com/q/28748619
tags question: http://stackoverflow.com/q/28640729
tags question: http://stackoverflow.com/q/28679781
type: Tag
tags question: http://stackoverflow.com/q/28648083
tags question: http://stackoverflow.com/q/28721551
tags question: http://stackoverflow.com/q/28611265
tags question: http://stackoverflow.com/q/28739198
tags question: http://stackoverflow.com/q/28632281
tags question: http://stackoverflow.com/q/28639324
tags question: http://stackoverflow.com/q/28646533

http://stackoverflow.com/a/28737836
answers question: http://stackoverflow.com/q/28737757
has comment: http://stackoverflow.com/comment/45759731
type: Answer
has comment: http://stackoverflow.com/comment/45760196
has body: instead of .attr('selected','selected');, try .prop('selected', true);
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28737757

http://stackoverflow.com/q/28619193
has comment: http://stackoverflow.com/comment/45541697
answer count: 2
has comment: http://stackoverflow.com/comment/45541343
tagged with: arrays
downvote count: 0
has comment: http://stackoverflow.com/comment/45541645
tagged with: javascript
tagged with: jquery
has body: So I have an array with 7 values: var names = ["Tom", "James", "Matthew", "Jordy", "Jeremy", "Jasper", "Jordy"] I need to get rid of both "Jordy", not just one, but both of them. I'm using plain JS and a bit of jQuery. I know I can filter out one of them, but I don't know how to do both. the result would have to be: var names = ["Tom", "James", "Matthew", "Jeremy", "Jasper"]
favorite count: 0
has comment: http://stackoverflow.com/comment/86519636
accepted answer: http://stackoverflow.com/a/28619459
has comment: http://stackoverflow.com/comment/45541271
has title: removing double values from array, not just the duplicate in javascript
has answer: http://stackoverflow.com/a/28619708
score: 2
type: AnsweredQuestion
upvote count: 2
possible better answer: http://stackoverflow.com/a/28619708
has comment: http://stackoverflow.com/comment/45541610
has comment: http://stackoverflow.com/comment/86609788
type: Question
has comment: http://stackoverflow.com/comment/45541321
has comment: http://stackoverflow.com/comment/45541589
has answer: http://stackoverflow.com/a/28619459

http://stackoverflow.com/q/28617609
tagged with: angularjs
has answer: http://stackoverflow.com/a/28618646
has body: Please have a look at this example: http://codepen.io/troywarr/pen/zxWLeZ I'm developing a similar form where I have some data that the user can opt out of entering by clicking a checkbox. I'm using ng-disabled to disable the pertinent field ("Age" in my example) when the checkbox is checked. That works fine if they click the checkbox before they enter data into the field. However, if they enter data into the field, then click the checkbox to disable it, the data both stays in the model and the view; it's just now locked from changes. Here's what I'd like to do: Even if the user has entered data into the field that they then disable, remove that data from the model. In the example, if the checkbox is checked and "Name" and "Age" are both filled out, I'd want my user object to still only be: { "name": "John" } whereas it's currently: { "name": "John", "age": 35 } Also, ideally: Remove the data from the view as well (i.e., empty out the "Age" field). Make that data removal (both from the model and view) reversible. If a user enters their age as 35, then they check the checkbox to disable it, they'll see the "Age" field empty (and the user model will also lose the age property). Then, if they uncheck the checkbox, the value 35 will return to both the "Age" field and the model. In other words, don't lose their work if they change their mind. Do this at scale (e.g., with a reusable directive, relatively simple expression, or other DRY approach), since my form is complex with numerous instances of this behavior, and there will be other similar forms to come. My first thought was that I need to either (basically the same thing, I think?): conditionally set ng-model for the "Age" field depending on the checked state of the checkbox unbind the "Age" field when the checkbox is checked, and re-bind it when unchecked But, how do I do that? Or is there a simpler approach? I've played around for a while, but can't find a combination of directives or other approach to do this, and…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45540528
has answer: http://stackoverflow.com/a/28617947
type: Question
tagged with: angularjs-directive
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28617947
tagged with: forms
tagged with: angularjs-scope
has title: In AngularJS, how to temporarily remove a model property when a form field is disabled?
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45540593
has comment: http://stackoverflow.com/comment/45540382
possible better answer: http://stackoverflow.com/a/28618646

http://stackoverflow.com/q/28670087
tagged with: jquery
has comment: http://stackoverflow.com/comment/45634207
has title: Locating where the jquery change comes from
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: On my megamenu, whenever I hover between unsorted lists I can see, in inspector, style being added overflow:hidden and height. This height causes the entire mega menu to 'jump' by about 10px. I have searched all my jquery, and I know I didn't put any such code in it, and tried finding if any of the added jquery libraries (superfish for instance) are adding it, but no luck. Is it possible in Chrome to somehow pinpoint where this change comes from? Or in Firefox? Because something must be adding that inline style, and I have no idea what.
score: 0
has answer: http://stackoverflow.com/a/28673107
has comment: http://stackoverflow.com/comment/45634125
answer count: 1
has comment: http://stackoverflow.com/comment/45637705
tagged with: javascript
has comment: http://stackoverflow.com/comment/45634599
type: UnansweredQuestion

http://stackoverflow.com/comment/45544107
has text: @JeffreyBosboom it's not working at all unfortunately! I just want to know why that may be. I thought I may be missing something someone could spot out
comment on: http://stackoverflow.com/q/28620819
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28632375
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28632798
tagged with: autoplay
has body: I have a jquery slider from http://tympanus.net/codrops/2013/02/26/full-width-image-slider/ I have installed the slider perfectly and its working fine, I need it to slide automatically when a user visits the website. I have no experience with jQuery and I'm unable to get this to autoplay. Here is the jQuery code for the slider; ;( function( $, window, undefined ) { 'use strict'; // global var Modernizr = window.Modernizr; $.CBPFWSlider = function( options, element ) { this.$el = $( element ); this._init( options ); }; // the options $.CBPFWSlider.defaults = { // default transition speed (ms) speed : 500, // default transition easing easing : 'ease' }; $.CBPFWSlider.prototype = { _init : function( options ) { // options this.options = $.extend( true, {}, $.CBPFWSlider.defaults, options ); // cache some elements and initialize some variables this._config(); // initialize/bind the events this._initEvents(); }, _config : function() { // the list of items this.$list = this.$el.children( 'ul' ); // the items (li elements) this.$items = this.$list.children( 'li' ); // total number of items this.itemsCount = this.$items.length; // support for CSS Transitions &amp; transforms this.support = Modernizr.csstransitions &amp;&amp; Modernizr.csstransforms; this.support3d = Modernizr.csstransforms3d; // transition end event name and transform name // transition end event name var transEndEventNames = { 'WebkitTransition' : 'webkitTransitionEnd', 'MozTransition' : 'transitionend', 'OTransition' : 'oTransitionEnd', 'msTransition' : 'MSTransitionEnd', 'transition' : 'transitionend' }, transformNames = { 'WebkitTransform' : '-webkit-transform', 'MozTransform' : '-moz-transform', 'OTransform' : '-o-transform', 'msTransform' : '-ms-transform', 'transform' : 'transform' }; if( this.support ) { this.transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ] + '.cbpFWSlider'; this.transformName = transformNames[ Modernizr.prefixed( 'transform' ) ]; } // current and old ite…
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/19927466
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28632798
type: Question
tagged with: slider
has title: I need my jquery slider to auto play

http://stackoverflow.com/a/28677313
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28676859
has body: I'm not sure that this can be accomplished via CSS. Now, you are checking against some values/elements that don't exist in your code (ie input[value=yes3]:checked, you don't have input with that value, check it for yourself). I don't understand what exactly you want to accomplish, but I will still try to help and since you're new let's keep it very basic: if ($('input[value=yes1]').is(':checked') &amp;&amp; $('input[value=yes2]').is(':checked')) { // this will fire only if input with values yes1 and yes2 is checked $('div_to_show').show(); // put your own selectors here $('div_to_hide').hide(); // put your own selectors here } if ($('input[value=no1]').is(':checked') &amp;&amp; $('input[value=no2]').is(':checked')) { // this will fire only if input with values no1 and no2 is checked $('some_other_div_to_show').show(); // put your own selectors here $('some_other_div_to_hide').hide(); // put your own selectors here } if ($('input[value=yes1]').is(':checked') &amp;&amp; $('input[value=no1]').is(':checked')) { # this will fire only if both input with values yes1 and no1 is checked $('some_other_div_to_show').show(); # put your own selectors here $('some_other_div_to_hide').hide(); # put your own selectors here } # and so on... just type in your conditions and that's it. If you need some other cases, just add them using this pattern or construct one complex else if statement with all your scenarios.

http://stackoverflow.com/q/28686935
type: Question
has comment: http://stackoverflow.com/comment/45666540
has comment: http://stackoverflow.com/comment/45666582
answer count: 1
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28687045
has body: I'm trying to learn more javascript and right now I'm just playing around with the event listener method. I've made a simple HTML document with a div that contains a background image. I've successfully made the image move upon the correct key press. What I want to do now is prevent the image to pass the edges of the window. I know that window.innerWidth and window.innerHeight gives me the size of the window, but I can't figure out how to use this to restrict the image's movement. The html: &lt;script type="text/javascript" src="code.js"&gt;&lt;/script&gt; &lt;/body&gt; &lt;/html&gt; Inside the style.css: body{ } #image{ position: absolute; height: 80px; width: 80px; background: url("../img/image.png"); background-size: 80px; background-repeat: no-repeat; } And inside the code.js: (function() { var image; var count, left, top; image = document.getElementById('image'); count = 30; left = 200; top = 200; image.style.left = left + "px"; image.style.top = top + "px"; document.addEventListener("keydown", function(event) { var key = event.keyCode || event.which; left = image.offsetLeft; top = image.offsetTop; switch(key) { case 37: left -= count; break; case 38: top -= count; break; case 39: left += count; break; case 40: top += count; break; } image.style.left = left + "px"; image.style.top = top + "px"; }); }); PS. I only want to use vanilla JavaScript for this. No jQuery please. :)
has title: Javascript, contain image inside windows edges
has comment: http://stackoverflow.com/comment/45666420
has comment: http://stackoverflow.com/comment/45666699
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28687045

http://stackoverflow.com/a/65066206
has body: You can set event listener on your video and remove controls on play
answers question: http://stackoverflow.com/q/28601762
score: 0
type: Answer

http://stackoverflow.com/comment/45884035
score: 0
type: AnswerComment
has text: yes, i already solve the problem very similar way. in chrome getting image is not problem. but in ie i did some tricks. first defined css rule to hide images in contenteditable div. then find image with jquery and get src parameters value and then send server.
type: Comment
comment on: http://stackoverflow.com/a/28799619

http://stackoverflow.com/a/28734832
has comment: http://stackoverflow.com/comment/45755356
downvote count: 0
has comment: http://stackoverflow.com/comment/45755244
has body: Just add a new circle to the end of your SVG: &lt;circle cx="100" cy="100" r="100" stroke ="#000" stroke-width="2" fill="none"/&gt; Demo fiddle here
answers question: http://stackoverflow.com/q/28734585
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45755040

http://stackoverflow.com/comment/45650978
type: AnswerComment
type: Comment
has text: I think I may be missing something. I tried out your code and made the query as I did above but when you select any month, it still shows the same thing.
comment on: http://stackoverflow.com/a/28678288
score: 0

http://stackoverflow.com/comment/45607950
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28655698
score: 0
has text: can you post your directory structure here?

http://stackoverflow.com/a/28740513
score: 1
has body: .ToolBar(toolbar =&gt; { toolbar.Template(@&lt;text&gt; &lt;div class="toolbar"&gt; @(Html.Kendo().Button() .Name("addbtn") .Content("Add New") .HtmlAttributes(new { type = "button", @class = "k-primary k-button k-button-icontext js-myKendoButton", @data_id = @Model.YourID, onclick = "onClick()" }) ) &lt;/div&gt; &lt;/text&gt;); }) And then you will grab the data-attribute with jQuery. $('.js-myKendoButton').attr('data-id'); More here: How to use dashes in HTML-5 data-* attributes in ASP.NET MVC
type: Answer
answers question: http://stackoverflow.com/q/28739962
upvote count: 1
has comment: http://stackoverflow.com/comment/45764788
downvote count: 0

http://stackoverflow.com/q/28746021
has title: Parse JSON into subsets
favorite count: 0
has answer: http://stackoverflow.com/a/28746838
answer count: 4
has answer: http://stackoverflow.com/a/28746342
upvote count: 2
possible better answer: http://stackoverflow.com/a/28746412
has body: The following is my JSON string and I would like to parse it on the client side into the 3 different column names (MAT_ETHNICITY, PAT_ETHNICITY, SEX) so I can put the values into a drop down list for each column. Should I just do three separate SQL calls and send it via three different server calls, parse it Server side or parse it client side by looping? Thanks [ { "REFCODE": "HIS", "DESCRIPTION": "Hispanic or Latino", "COLUMN_NAME": "MAT_ETHNICITY" }, { "REFCODE": "NHIS", "DESCRIPTION": "Not Hispanic or Latino", "COLUMN_NAME": "MAT_ETHNICITY" }, { "REFCODE": "UNK", "DESCRIPTION": "Unknown", "COLUMN_NAME": "MAT_ETHNICITY" }, { "REFCODE": "AMERIND", "DESCRIPTION": "American Indian/Alaska Native", "COLUMN_NAME": "PAT_ETHNICITY" }, { "REFCODE": "ASIAN", "DESCRIPTION": "Asian", "COLUMN_NAME": "PAT_ETHNICITY" }, { "REFCODE": "HAW", "DESCRIPTION": "Native Hawaiian or Other Pacific Islander", "COLUMN_NAME": "PAT_ETHNICITY" }, { "REFCODE": "AA", "DESCRIPTION": "Black or Africian American", "COLUMN_NAME": "PAT_ETHNICITY" }, { "REFCODE": "WHITE", "DESCRIPTION": "White", "COLUMN_NAME": "PAT_ETHNICITY" }, { "REFCODE": "MORE", "DESCRIPTION": "More than one race", "COLUMN_NAME": "PAT_ETHNICITY" }, { "REFCODE": "UNK", "DESCRIPTION": "Unknown", "COLUMN_NAME": "PAT_ETHNICITY" }, { "REFCODE": "M", "DESCRIPTION": "Male", "COLUMN_NAME": "SEX" }, { "REFCODE": "F", "DESCRIPTION": "Female", "COLUMN_NAME": "SEX" } ]
downvote count: 1
type: Question
linked to: http://stackoverflow.com/q/4653114
has answer: http://stackoverflow.com/a/28747043
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/28746838
has answer: http://stackoverflow.com/a/28746412
tagged with: javascript

http://stackoverflow.com/a/28659306
answers question: http://stackoverflow.com/q/28659102
score: 0
has body: $(function(){ $("#changeRank").change(function() { var rankId = this.value; //alert(rankId); //$.ajax({url: "/profile/parts/changeRank.php", type: "post", data: {"mapza": mapza}}); //$("body").load("/lib/tools/popups/content/ban.php"); $.ajax({ type: "POST", async: true, url: '/profile/parts/changeRank.php', data: { 'direction': 'up' }, success: function (msg) { alert('success: ' + JSON.stringify(msg)) }, error: function (err) { alert(err.responseText)} }); }); }); require_once('head.php'); require_once('../../lib/permissions.php'); session_start(); $user = "test"; if($_SESSION["user"] != $user &amp;&amp; checkPermission("staff.fakeLogin", $_SESSION["user"], $mhost, $muser, $mpass, $mdb)) $_SESSION["user"] = $user; echo json_encode($user); This sample code will let echo the username back to the page. The alert should show this.
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28659102

phantomjs
tags question: http://stackoverflow.com/q/28742292
tags question: http://stackoverflow.com/q/28605027
type: Tag
tags question: http://stackoverflow.com/q/28699997
tags question: http://stackoverflow.com/q/28705536
tag name: phantomjs
tags question: http://stackoverflow.com/q/28629729
tags question: http://stackoverflow.com/q/28643401
tags question: http://stackoverflow.com/q/28635191
tags question: http://stackoverflow.com/q/28602030
tags question: http://stackoverflow.com/q/28694897
tags question: http://stackoverflow.com/q/28686045
tags question: http://stackoverflow.com/q/28739098
tags question: http://stackoverflow.com/q/28648446
tags question: http://stackoverflow.com/q/28606650
tags question: http://stackoverflow.com/q/28703574
tags question: http://stackoverflow.com/q/28625193

http://stackoverflow.com/a/28702360
downvote count: 1
type: Answer
upvote count: 0
score: -1
answers question: http://stackoverflow.com/q/28702071
has body: why to hard using : get easy to add some id get the value : var checkAnswer = document.getElementById('theanswer').value;

http://stackoverflow.com/q/28610100
has comment: http://stackoverflow.com/comment/45524480
tagged with: http://stackoverflow.com/tag/html
has body: I'm struggling to figure this out: When user clicks on button it creates a png of whatever the content is in my "imagecontainer" element. Unfortunately it only adds a canvas with the png to the bottom of my page. How can I prevent it from doing that and let the png get straight into dowloads folder or new window?? Thank you so much. This is my code: $(function() { $("#savebutton").click(function() { html2canvas($(".imagecontainer"), { onrendered: function(canvas) { theCanvas = canvas; document.body.appendChild(canvas); canvas.toBlob(function(blob) { save(blob, "Dashboard.png"); }); } }); }); });
type: Question
has title: How can I download content of div using html2canvas and FileSaver in the dowllaods folder instead of in the browser?
answer count: 1
has comment: http://stackoverflow.com/comment/45524255
accepted answer: http://stackoverflow.com/a/28610280
score: 0
tagged with: javascript
tagged with: html2canvas
tagged with: jquery
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28610280

nodelist
type: Tag
tag name: nodelist
tags question: http://stackoverflow.com/q/28595705

http://stackoverflow.com/q/28631843
has comment: http://stackoverflow.com/comment/45574502
tagged with: css
answer count: 0
downvote count: 0
has comment: http://stackoverflow.com/comment/45564059
has title: Masonry - Extra Space Between Grid Boxes
score: 1
type: Question
tagged with: jquery-masonry
tagged with: masonry
tagged with: javascript
tagged with: jquery
upvote count: 1
favorite count: 0
has body: I am working on a dev version of a site and am trying to integrate Masonry with Pure.css to create a responsive grid that has the stacking appearance of Masonry. Sometimes it works, but many times I get extra spaces between the grid boxes. If I resize my browser or run through infinite scroll it seems to reset nicely, but the initial load is often off. I've tried implementing imagesLoaded, adding a $(window).load directive along with numerous other methods. I've even waited several seconds after everything has loaded to initialize masonry, and even then it was off. Here is my masonry function: function mason() { $('#deals').imagesLoaded(function(){ $('#deals').masonry({ itemSelector: '.outerdeal', columnWidth: '.outerdeal', containerStyle: null, isResizable: true }); }); } This is used for initialization. It is reloaded with $('#deals).masonry('reload'). I'm not sure if there are conflicts due to Pure.css (http://purecss.io/). Here is a link to the site with the bug: http://162.243.7.235/nyc
type: UnansweredQuestion

http://stackoverflow.com/q/28703784
score: 0
has comment: http://stackoverflow.com/comment/45697567
has comment: http://stackoverflow.com/comment/45697656
has body: Just beginning learning JavaScript; writing some calculators with relatively basic functions. I found the need to put multiple variable values in an option tag of a drop-down menu, and after researching I figured it would be easiest to put them in one string, then split them with the split() function, but regardless of the delimiter I specify, it acts as if there is none, and splits each character individually. Why? cu/ft Natural Gas(Via Storage Tank Burner, 65% Efficient)
has comment: http://stackoverflow.com/comment/45697695
has comment: http://stackoverflow.com/comment/45697620
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45697612
has title: Why Isn't My split() Delimiter Acknowledged?
linked to: http://stackoverflow.com/q/2435525
has comment: http://stackoverflow.com/comment/45697532
has comment: http://stackoverflow.com/comment/45698024
has answer: http://stackoverflow.com/a/28704731
has comment: http://stackoverflow.com/comment/45697949
type: Question
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45697396
has comment: http://stackoverflow.com/comment/45697740
linked to: http://stackoverflow.com/q/4696499
linked to: http://stackoverflow.com/q/254302

http://stackoverflow.com/comment/45812216
type: AnswerComment
comment on: http://stackoverflow.com/a/28725334
score: 0
type: Comment
has text: Web design is not my job at my company. My boss wanted me to try and tackle this project and I have received some good responses from Stackoverflow in the past. I thought it may be a simple fix. Sorry to bother you.

http://stackoverflow.com/comment/45584973
type: Comment
comment on: http://stackoverflow.com/a/28642648
has text: im sorry conecction problems... actually i chose your first opcion: you are here: 2 seconds you are here: 3 seconds you are here: 4 seconds but it doesnt work for me...
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45774053
type: Comment
has text: After removing grunt dependencies ?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28745597

http://stackoverflow.com/comment/126276298
type: Comment
has text: selectedOptions is no longer a property of target in Chrome Version 99.0.4844.51 (Official Build) (64-bit)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/47894683

http://stackoverflow.com/a/28680011
answers question: http://stackoverflow.com/q/28679914
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/45653003
upvote count: 4
score: 3
has body: The callback function for .toggle() happens after it's complete, not at the same time. In order for both to happen simultaneously (at least observed simultaneously, though there's likely some millisecond-delay), don't use the callback. Just execute them both: $("#mobileJ").toggle(); $("#botaojs").toggleClass("toggleclass");
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28679914
has comment: http://stackoverflow.com/comment/45652939

http://stackoverflow.com/comment/45549918
score: 0
has text: @JamesThorpe I've added the two additional code snippets showing the code that I'm using as a temporary fix which does work. I've also updated the original snippets.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28606379

http://stackoverflow.com/q/28663886
tagged with: socket.io
type: Question
has title: How can you "persist" socket.io connections?
tagged with: javascript
has comment: http://stackoverflow.com/comment/45622859
tagged with: express
score: 0
has comment: http://stackoverflow.com/comment/45624119
has comment: http://stackoverflow.com/comment/45622725
has body: I'm currently working on an app in Node.js which I'm writing in Express.js and uses Socket.io. However I am having trouble persisting data when a client is connected. When you refresh the page, Socket.io treats this as a disconnection and then a new connection. Does anyone know a method that could be used that doesn't use JavaScript timers to help persist a client that is connected?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45622844
tagged with: sockets
tagged with: node.js
answer count: 0
has comment: http://stackoverflow.com/comment/45670332

http://stackoverflow.com/comment/45752019
type: Comment
has text: This will remove from the screen, but if you want to remove from the map on the server site, you can use ajax to send an instruction, the JSP or servlet then can remove it for you.
type: AnswerComment
comment on: http://stackoverflow.com/a/28733037
score: 0

http://stackoverflow.com/comment/45611342
type: AnswerComment
has text: Also note the [priority update trick](http://stackoverflow.com/questions/26350747/chrome-notifications-update-or-create). If you do this on an interval, it will keep your notification shown.
score: 1
type: Comment
comment on: http://stackoverflow.com/a/28654804

http://stackoverflow.com/comment/46686049
has text: You can try this : http://stackoverflow.com/questions/15768047/loading-gzip-json-file-using-ajax If you will have problems you should use jquery append. I used the last, but i don't know what size, it will have.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28664363
type: Comment

http://stackoverflow.com/comment/45499460
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28595910
has text: yes that is what I'm trying to do. Without refreshing the page. Or at least just refreshing a small part, not the whole page. Nothing needs to be refreshed/perpended/appended on the page so don't need to refresh anything it seems like
score: 0

http://stackoverflow.com/comment/45728957
has text: Perfect. Seems I was getting very confused, especially when looking at other examples. But thank you very much R3tep.
type: AnswerComment
comment on: http://stackoverflow.com/a/28719456
score: 0
type: Comment

http://stackoverflow.com/q/28674110
linked to: http://stackoverflow.com/q/454202
type: Question
has title: Resize textarea width while typing using keyup
has answer: http://stackoverflow.com/a/28674229
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28674331
has comment: http://stackoverflow.com/comment/45641619
tagged with: jquery
has comment: http://stackoverflow.com/comment/45641646
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: There are two textareas which has the exact same text formatting. IDs are textareaA and textareaB. I've set some stuff to happen for textareaA keyup. My question is How do I set a textareaB to resize its WIDTH while the user is typing in textareaA? This is what I tried but no luck. $(document).on("click blur keyup", ".fT", function() { // keyup responds with textareaA var newWidth = $("#textareaA").val(); //does not work $("#textareaB").width(newWidth); });
type: UnansweredQuestion

http://stackoverflow.com/a/28700270
answers question: http://stackoverflow.com/q/28699708
has comment: http://stackoverflow.com/comment/45690987
score: 2
downvote count: 0
type: Answer
has body: For authentication you need to supply an additional HTTP header to your request: Authorization: Basic realm="Neo4j" &lt;base64&gt; where &lt;base64&gt; is the base64 encoded string of username:password. Not being a jquery ninja, but I guess the most simple way is to set the authorization header using ajax defaults: $.ajaxSetup({ headers: { "Authorization": 'Basic realm="Neo4j' &lt;base64&gt;'} }); When this default has been applied your $.post above should work.
upvote count: 2

http://stackoverflow.com/q/28726040
tagged with: php
has comment: http://stackoverflow.com/comment/45739113
downvote count: 0
score: 1
tagged with: forms
has comment: http://stackoverflow.com/comment/45738877
type: Question
has title: php .session_start show errors on contact.php from submit.php
has body: I need the errors on a form to show up from the submit.php onto the form page at contact.php I have tried with Session_Start, but it is not working. This is what I have so far. Contact.php <?php ob_start(); session_start(); if ($_SESSION["error"] != "") { echo $_SESSION["error"]; $_SESSION["error"] = ""; } ?> <?php echo $error; ?> Submit.php <?php ob_start(); session_start(); ?> <?php //fields $link_address = 'contact'; // page to redirect to $honeypot = ''; $error = ''; $name = 'Name'; $email = 'Email'; $comments = 'Message'; if(isset($_POST['contactus'])) { $honeypot = $_POST['email_confirm']; $name = $_POST['name']; $email = $_POST['email']; $comments = $_POST['comments']; // honeypot if($honeypot) exit(1); <?php //error messages if(trim($name) == 'Name') { $error = ' Need your Name '; } else if(trim($name) == '') { $error = ' Need your Name '; } else if(trim($email) == 'Email') { $error = ' Need your Email '; } else if(trim($email) == '') { $error = ' Need your Email '; } else if(!isEmail($email)) { $error = ' Need a valid email '; } else if(trim($comments) == 'Message') { $error = ' A Message is required '; } else if(trim($comments) == '') { $error = ' A Message is required '; } if($error == '') { if(get_magic_quotes_gpc()) { $comments = stripslashes($comments); } //email address $address = "mail@example.com"; //email message $e_subject = 'Web Message from: ' . $name . '.'; $e_body = "From: $name\nEmail: $email \r\n\nMessage:\n$comments\n\n\n"; $msg = $e_body . $e_content . $e_reply; if(mail($address, $e_subject, $msg, "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n")) { //success html page response echo " "; echo " Email Sent Successfully. "; echo " Thank you. The following was sent to us. $name $email $comments "; echo "CLOSE THIS MESSAGE"; echo " "; } else echo "Error. Mail not sent"; } } if(!isset($_POST['contactus']) || $error != '') // Do not edit. { ?> <?php } function isEmail($email) { // Email address verification, do not edit. return(preg…
upvote count: 1
has comment: http://stackoverflow.com/comment/45738619
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28726572
answer count: 1
has comment: http://stackoverflow.com/comment/45738910
type: UnansweredQuestion

http://stackoverflow.com/q/28736200
tagged with: http://stackoverflow.com/tag/html
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/45756823
type: Question
has body: Using bootstrap collapse plugin, how to give 'view more' option for larger content (like in some websites they given for larger comments)? How to fix the maximum height of the div and make additional contents hidden? When user clicks the view more option it will show all the full content. How can I code for this?
tagged with: javascript
has comment: http://stackoverflow.com/comment/45756868
tagged with: jquery
has title: to give 'view more' option for larger contents (like larger comments)- bootstrap
tagged with: twitter-bootstrap
type: UnansweredQuestion

http://stackoverflow.com/a/28595448
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45497834
has comment: http://stackoverflow.com/comment/45659535
upvote count: 2
has comment: http://stackoverflow.com/comment/45497676
has body: How close would stripping out spaces around words get you? It at least weeds out "hello 1" and such. Date.parse('hello 1'.replace(/\s*([a-z]+)\s*/i, "$1")); // NaN Date.parse('jan 1'.replace(/\s*([a-z]+)\s*/i, "$1")); // Valid [update] Ok, so we'll just replace any non-alphanumerics that fall between a letter and a number: replace(/([a-z])\W+(\d)/ig, "$1$2")
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28594455
answers question: http://stackoverflow.com/q/28594455

http://stackoverflow.com/a/28815274
answers question: http://stackoverflow.com/q/28612341
type: Answer
downvote count: 0
score: 1
has body: This is going to be changing very soon, it might already be in Canary too. Improved exception messages: https://plus.google.com/+AddyOsmani/posts/DdWkiKsvbA2
accepted answer of: http://stackoverflow.com/q/28612341
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/28669947
upvote count: 1
answer count: 1
tagged with: debugging
accepted answer: http://stackoverflow.com/a/28670453
tagged with: jquery-ui
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/45634353
favorite count: 0
has title: How to debug jQuery UI effect not working as expected
type: Question
has body: I am using the jQuery UI library for the shake effect. On my website, it works as expected for certain elements, but not for image elements within a d3.js canvas, for these images it just causes them to flicker. I suspect this may be because of other tags or attributes on these elements, but I have no idea how to begin debugging this issue? Should I use a JavaScript debugger, or try to disable certain attributes of these images? This is a pretty mysterious and frustrating bug, and I need some advice on how to fix it.
has answer: http://stackoverflow.com/a/28670453

http://stackoverflow.com/q/28688035
accepted answer: http://stackoverflow.com/a/28688821
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has title: Make javascript execute after javascript from add-on in firefox?
type: Question
tagged with: javascript
score: 0
tagged with: firefox-addon
has body: I recently installed the add-on leechblock, which keeps track of how long you browse on specific sites and blocks you if you exceed the limits you set for yourself. Unfortunately the page it shows when blocking a site is pretty ugly, so I set out to make my own html-page to show instead. On this html-page, in addition to a lot of other stuff, there is a link which gets you back to the page where you wanted to go originally (if the block has expired), which looks like this: back This lbClickHereLink is then set in the add-on code (in the file browser.js) as follows: // Update hyperlink to blocked page var clickHereLink = doc.getElementById("lbClickHereLink"); if (clickHereLink != null) { clickHereLink.setAttribute("href", blockedURL); } Now I am also using this html-page in other contexts (it's basically a to-do list), and I thought it would be really neat to only have this link if I actually got there from a blocked page. (Otherwise it's just empty anyway.) So I tried this (inside the html-document): But this doesn't work, because at the time the html-page is loaded, the script from the add-on apparently has not yet been executed. So the link is never there. So my question is: Is it possible to get the above script to execute after the code from the add-on has been executed? On a teach-a-man-to-fish side note: Can I get the firefox debugger to show me all the javascript code that's being executed on a page, not just what's in the html-document?
answer count: 1
has answer: http://stackoverflow.com/a/28688821

http://stackoverflow.com/a/28729890
type: Answer
answers question: http://stackoverflow.com/q/28729770
score: 0
has body: Simply you're exposing nothing. Do you have, for example, an index.html file? Try this: app.get("/", function(req, res) { res.sendfile("index.html"); });

storage
tag name: storage
tags question: http://stackoverflow.com/q/28669303
type: Tag

http://stackoverflow.com/a/28702271
score: 0
answers question: http://stackoverflow.com/q/28702171
type: Answer
has body: Both the approaches are same. First option would be recommended, if you want to do some more operations on same jquery element (i.e $("h1.logo")). In that case the local reference copy would be used. Now considering this example, both are same, in second option $("h1.logo") returns an instance of jquery element, same as first approach.

http://stackoverflow.com/comment/45690615
type: Comment
comment on: http://stackoverflow.com/a/28700263
has text: And if the Tweet looks like this: I love that you're a Leo.
score: 0
type: AnswerComment

http://stackoverflow.com/a/28669965
has comment: http://stackoverflow.com/comment/45634486
has comment: http://stackoverflow.com/comment/45634289
has comment: http://stackoverflow.com/comment/45634409
has comment: http://stackoverflow.com/comment/45634190
has body: Put your promt inside a while loop and continue asking for input until user gives any. do{ input = prompt("Give input"); }while(input == null || input == "" ); console.log(input); jsFiddle [Note : It's a way to fulfill your requirement that I won't suggest as it may annoy user. You can go with regular expression if you want user to complete your form.]
has comment: http://stackoverflow.com/comment/45634166
accepted answer of: http://stackoverflow.com/q/28669884
score: 12
downvote count: 2
answers question: http://stackoverflow.com/q/28669884
type: AcceptedAnswer
upvote count: 14
has comment: http://stackoverflow.com/comment/45634530
type: Answer

http://stackoverflow.com/comment/45537491
type: QuestionComment
has text: The plugin is empty, i was trying to create one for tests but i didn't even reach the function.
comment on: http://stackoverflow.com/q/28617121
score: 0
type: Comment

http://stackoverflow.com/comment/45649272
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28677907
has text: Error: [ng:areq] http://errors.angularjs.org/1.3.13/ng/areq?p0=prCtrl&p1=not%20aNaNunction%2C%20got%20undefined at Error (native) at http://localhost/angular/angular.min.js:6:417 at Sb (http://localhost/angular/angular.min.js:19:510) at tb (http://localhost/angular/angular.min.js:20:78) at http://localhost/angular/angular.min.js:75:331 at A.link (http://localhost/angular/angular.route.js:7:268) at $ (http://localhost/angular/angular.min.js:70:149) maybe is an dist issue?
type: Comment

http://stackoverflow.com/comment/45642587
comment on: http://stackoverflow.com/q/28674361
score: 0
has text: Surely wordpress gives you a cookie if you are logged in. If it does you can simply check if that cookie is present by looking at string: document.cookie - if it is there then don't load the script: http://stackoverflow.com/questions/14521108/dynamically-load-js-inside-js
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28610772
has body: In PHP, use the function json_encode() to encode your objects / arrays to JSON Format. Note that setting the second argument to true will keep associative array indeces. Also, your JavaScript code is not alright. You need to use success: instead of complete:. Then, you can easily convert the string back into an object using JSON.parse(yourJSONString);.
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28610691

http://stackoverflow.com/comment/45558743
type: QuestionComment
score: 0
type: Comment
has text: possible duplicate of [Call php function from javascript](http://stackoverflow.com/questions/7165395/call-php-function-from-javascript)
comment on: http://stackoverflow.com/q/28629019

http://stackoverflow.com/q/28623246
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/45628980
has title: JSON.parse vs custom for loop to deep clone js collection
tagged with: javascript
linked to: http://stackoverflow.com/q/16961898
has comment: http://stackoverflow.com/comment/45548621
score: 0
tagged with: backbone.js
type: UnansweredQuestion
has body: I use backbone js. After lot of reading about deep cloning a js collection (a backbone collection in my case). I'm confused between choosing between two shortlisted options. myBBCollection is the source collection containing 'MyModel' models. Approach 1 (Use :JSON.parse) myTargetColl = JSON.parse(JSON.stringify(myBBCollection)); Approach 2 (Use :forEach loop) myBBCollection.forEach(function(result){ myTargetColl.push(new MyModel(result.toJSON())) }); My question is about efficiency/coding standards. Which approach will be better over another? P.S. I don't want to use .clone() function because it gives shallow copy.
tagged with: backbone.js-collections

http://stackoverflow.com/q/28668896
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28668964
tagged with: ajax
upvote count: 1
has title: Unable to insert image into database with ajax serialize function
favorite count: 0
type: UnansweredQuestion
tagged with: php
has body: Im currently having a trouble to insert an file input (images) into my database, but it return me empty value when I'm trying to insert it into database, other text input are successfully inserted into the database except the image. Here is my Ajax code where i use to do the ajax function: $("#testing").confirm({ confirm: function (el) { $.ajax({ url: 'bannerItem.php', data: el.closest('form').serialize(), type: 'post' }).done(function () { if(!alert('Banner Had Successfully Updated.')){document.getElementById('form').reset();} }).fail(function () { //if the post is failed show an error message if you want alert('Some error occur. Please try again later.'); }).always(function () { //this is executed on success and failure $('#myhiddendiv').hide(); }) } }); Here is the php code: <?php include 'dbConnection.php'; global $dbLink; $target_file = basename($_FILES['uploaded_file']['name']); $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); //Check image file type // Make sure the file was sent without errors if($_FILES['uploaded_file']['error'] == 0) { //Gather all required data $item_id = $dbLink->real_escape_string($_POST['banner_id']); $name = $dbLink->real_escape_string($_POST['bannerName']); $data = $dbLink->real_escape_string(file_get_contents($_FILES['uploaded_file']['tmp_name'])); //Create the SQL query $query = "INSERT INTO banner_item (banner_item_id, banner_name,banner_data,banner_created) VALUES ('{$item_id}','{$name}','{$data}', NOW() )"; //Execute the query $result = $dbLink->query($query); //Check if it was successfull if($result) { echo 'Name : '.$name.' '; echo 'Result : Success! Your file was successfully added!'; } else{ echo 'Result : Error! Failed to insert the file' . " {$dbLink->error} "; } } else { echo'An error accured while thefile was being uploaded. ' . 'Error code: '. intval($_FILES['uploaded_file']['error']); } // Close the mysql connection $dbLink->close(); // Echo a link back to the main page echo ' Click here to go back '; ?> If …
score: 1
has answer: http://stackoverflow.com/a/28669260
tagged with: mysql

http://stackoverflow.com/q/28709809
tagged with: node.js
has answer: http://stackoverflow.com/a/28709861
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28774780
upvote count: 2
has comment: http://stackoverflow.com/comment/45789241
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45708755
has body: I'm working through this tutorial on creating a single-page MEAN stack todo app. I'm on this step, specifically. The tutorial covers modularization of code, and while I was able to separate my backend code (Express, Mongo, etc.) into modules successfully, when I separate my angular.js code, the todo app ceases to function. The specific error which is thrown to the console is "Uncaught Error: [$injector:modulerr]." The specific error is "nomod" (i.e. the module "simpleTodo" is failing to load.) I'd appreciate any help. Code as one file (core.js): var simpleTodo = angular.module('simpleTodo', []); simpleTodo.controller('mainController', ['$scope', '$http', function($scope, $http) { $scope.formData = {}; $http.get('/api/todos') .success(function(data) { $scope.todos = data; }) .error(function(data) { console.log('Error: ' + data); }); $scope.createTodo = function() { $http.post('/api/todos', $scope.formData) .success(function(data) { $scope.formData = {}; $scope.todos = data; }) .error(function(data) { console.log('Error: ' + data); }); }; $scope.deleteTodo = function(id) { $http.delete('/api/todos/' + id) .success(function(data) { $scope.todos = data; }) .error(function(data) { console.log('Error: ' + data); }); }; }]); Code in modules: New core.js: var simpleTodo = angular.module('simpleTodo',['todoController', 'todoService']); Create/Delete Todo Service (todos.js): angular.module('todoService', []) .factory('Todos', ['$http', function($http) { return { get: function() { return $http.get('/api/todos'); }, create: function(todoData) { return $http.post('/api/todos', todoData); }, delete: function(id) { return $http.delete('/api/todos/' + id); } } }]); Controller file (main.js) angular.module('todoController', []) .controller('mainController', ['$scope', '$http', 'Todos', function($scope, $http, Todos) { $scope.formData = {}; Todos.get() .success(function(data) { $scope.todos = data; }); $scope.createTodo = function() { if ($scope.formData !== null) { Todos.create($sco…
has comment: http://stackoverflow.com/comment/45708630
has comment: http://stackoverflow.com/comment/45708700
has comment: http://stackoverflow.com/comment/45790432
type: Question
answer count: 2
tagged with: mean-stack
has comment: http://stackoverflow.com/comment/45748660
has comment: http://stackoverflow.com/comment/45789310
has answer: http://stackoverflow.com/a/28774780
downvote count: 0
has comment: http://stackoverflow.com/comment/45751888
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45753291
has title: Angular App works when all components are in one file, but throws 'nomod' error when components are in separate files
has comment: http://stackoverflow.com/comment/45772543
possible better answer: http://stackoverflow.com/a/28709861

http://stackoverflow.com/a/28728964
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28728852
answers question: http://stackoverflow.com/q/28728852
has body: You missed Lots of thing in your app, few are below. Add ngRoute module inside dependency and angular-route.js file in reference. You route configuration should be inside angular config block and It should use $routeProvider instead of only $route Controller name inside $routeProvider.when should be wrap in single quote ' app.run will contain the $rootScope.$on event And your directive contains extra closing curly brace } App.js 'use strict'; angular.module('myApp.directives', []); angular.module('myApp.filters', []); angular.module('myApp.services', []); angular.module('myApp.widgets', []); var app = angular.module('myApp', ['ngRoute', 'myApp.filters', 'myApp.services', 'myApp.widgets', 'myApp.directives']); app.config(['$routeProvider', '$window', '$rootScope', function($route, $window, $rootScope) { $routeProvider .when('/login', { template: 'partials/login.html', controller: 'loginCtrl' }) .when('/home', { template: 'partials/home.html', controller: 'homeCtrl' }) .otherwise({ redirectTo: '/login' }); }]); app.run(['$window', '$rootScope', function($window, $rootScope) { $rootScope.$on('$afterRouteChange', function() { $window.scrollTo(0, 0); }); }]); Directive.js angular.module('myApp.directives') .directive('hello', function() { return { template: '&lt;div style="position: relative"&gt;&lt;img id="map" src="http://www.lonelyplanet.com/maps/asia/india/map_of_india.jpg" /&gt;&lt;img id="marker" src="http://maps.google.com/mapfiles/ms/micons/blue.png" style="display: none; position: absolute;" /&gt;&lt;/div&gt;' } }); Hope this could help you, Thanks.

http://stackoverflow.com/comment/45631840
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28661274
has text: @Alexander your question is very good and valid (I think so) but because unclear asking it was down-voted.
score: 0

http://stackoverflow.com/comment/52116809
has text: Correct, I used JQuery to retrieve the multiple values.
score: 1
comment on: http://stackoverflow.com/a/32098857
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28657171
has title: Dynamic select option based json data using jquery
has comment: http://stackoverflow.com/comment/45610622
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion
has body: I have testing and searching for my case, but still not work. Any help it so appreciated. I have three select option that implemented php like this : Merk Printer : BROTHER EPSON DOT MATRIK EPSON DESKJET HP DESKJET HP LASERJET HP OFFICEJET KOINICA MINOLTA PANASONIC Tipe Printer : Tipe Toner : To passing data from my database, I am using ajax jquery like this : $(document).ready(function($) { $('#tipePrinter').hide(); $('#tipeToner').hide(); $("#merkPrinter").change(function() { var id = $('#selectError option:selected').val(); // return value if (id == "HPL") { $.ajax({ url: '<?php echo base_url() . 'control_printer/getTypePrinter/' ?>', type: 'POST', data: {id: id }, dataType: 'json', success: function(obj) { $('#tipePrinter').show(); $.each(obj, function(i, val) { var content1 = " " + val.type + " "; var content2 = " " + val.toner + " "; //List all of printer $("#selectPrinter").append(content1); //Dummy, $("#selectToner").append(content2); $('#tipeToner').show(); }); } }); } ; }); }); from this ajax, I got JSON like this : [ { "id_printer": "HPL", "type": "3030, 1020, 3055", "toner": "12A" }, { "id_printer": "HPL", "type": "1200", "toner": "15A" }, { "id_printer": "HPL", "type": "P1106", "toner": "35A" }, { "id_printer": "HPL", "type": "PIXMAX", "toner": "328" }, { "id_printer": "HPL", "type": "1160, 1320", "toner": "49A" }, { "id_printer": "HPL", "type": "2015D", "toner": "53A" }, { "id_printer": "HPL", "type": "P1102, PRO1102W", "toner": "CE285A" } ] Let say, the user choose HP Laserjet, the second select option would be showing type of printer e.g : "P1102, PRO1102W". In third select option just viewing toner based second select option that is "CE285A" . And so on, so on. P.S : third select option is disabled Thanks
has comment: http://stackoverflow.com/comment/45612021
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28659053
type: Question
has comment: http://stackoverflow.com/comment/45611348
linked to: http://stackoverflow.com/q/28716171
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45610759
tagged with: ajax
score: 0

http://stackoverflow.com/a/28685217
has body: The issue appears to be in your jQuery.ajax settings object. You are specifying a dataType of 'json', but your EMAIL.php does not output JSON, it outputs plain text by the look of it. Since jQuery is unable to parse the response as JSON, it will call the error callback, instead of the success callback. To correct this, specify dataType: "text" instead, or remove the property altogether. Example: $.ajax({ type: 'POST', url: 'mailer.php', data: formData, dataType: 'text', success: function(response){ $("#contact").fadeOut('slow').remove(); $('#form-messages').removeClass(); $('#form-messages').empty().addClass('success'); $('#form-messages').html(' Message has been sent succesfully! Thank you '+ $('#f_name').val() +', a response will be returned in less than one business day. '); console.log('success'); console.log(response); }, complete: function(response){ $("#contact").fadeOut('slow').remove(); $('#form-messages').removeClass(); $('#form-messages').empty().addClass('success'); $('#form-messages').html(' Message has been sent succesfully! Thank you '+ $('#f_name').val() +', a response will be returned in less than one business day. '); console.log('complete'); console.log(response); }, error: function(error){ console.log('error'); console.log(error); }, }); Also, to avoid a PHP strict warning, change this line: $email_message .= "Content-Type: text/html; charset=iso-8859-1".$eol; To this: $email_message = "Content-Type: text/html; charset=iso-8859-1".$eol; You never declared this variable before appending, which will cause a strict warning.
has comment: http://stackoverflow.com/comment/45663216
has comment: http://stackoverflow.com/comment/45663267
has comment: http://stackoverflow.com/comment/45663246
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28684957
type: Answer
has comment: http://stackoverflow.com/comment/45663514
score: 2
accepted answer of: http://stackoverflow.com/q/28684957
upvote count: 2

http://stackoverflow.com/comment/45738370
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28725633
type: AnswerComment
has text: My scenario is complicated and by reading your statement "then that's a red flag" I'm wondering if I'm doing this the right way. But I think that's a different question all together. Thank you for the answer, I will try this and if it gets too sloppy/heavy, I will make a manual array to house everything as @Bergi says.

http://stackoverflow.com/comment/45558890
has text: `eventDragStart` ? http://fullcalendar.io/docs/
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28621605
score: 1

http://stackoverflow.com/a/28711026
score: 0
has comment: http://stackoverflow.com/comment/45740395
has comment: http://stackoverflow.com/comment/45742673
has comment: http://stackoverflow.com/comment/45740714
has comment: http://stackoverflow.com/comment/45742043
type: Answer
has comment: http://stackoverflow.com/comment/45743253
answers question: http://stackoverflow.com/q/28707799
has comment: http://stackoverflow.com/comment/45740695
has body: It seems that you get the user's changes in a variable - you called the var e.html. That is not a good variable name, BTW. If you can, change it to something like htmlEdited Question: If you add the command alert(e.html); what do you get? Do you see the HTML after user edits? If yes, then what you need to do is send that variable to a PHP file, which will receive the data and stick it into the database. Code to send the data: javascript/jQuery: alert(e.html); //you should see the user-edited HTML $.ajax({ type: 'post', url: 'another_php_file.php', data: 'userStuff=' + e.html, //var_name = var_contents success: function(d){ window.location.href = ''; //redisplay this page } }); another_php_file.php: &lt;?php $user_edits = $_POST['userStuff']; //note exact same name as data statement above mysql_query("UPDATE `your_table_name` SET `your_col_name` = '$user_edits' ") or die(mysql_error()); echo 'All donarino'; The AJAX javascript code will send the var contents to a PHP file called another_php_file.php. The data is received as $user_edits, and then inserted into your MySQL db Finally, I presume that if you redisplay that page it will once again grab the contents of the #editor div from the database? This is where you haven't provided enough information, and why I wanted to see all your code. ARE you populating that div from the database? If not, then how do you expect the page to be updated after refreshing the page? You would benefit from doing some tutorials at phpacademy.org or a thenewboston.com. Do these two (free) courses and you'll be an expert: https://phpacademy.org/videos/php-and-mysql-with-mysqli https://phpacademy.org/videos/oop-loginregister-system If all you need to do is insert the contents of e.html to replace the #editor div, then try this: $('#editor').html(e.html); HOWEVER, you need an event to trigger that code. Are you able to do this? alert(e.html); If so, then put the first bit of code at that same spot. If not, we need more information about when…
has comment: http://stackoverflow.com/comment/45743474
has comment: http://stackoverflow.com/comment/45744113

http://stackoverflow.com/tag/svg
tags question: http://stackoverflow.com/q/28720553
tags question: http://stackoverflow.com/q/28706784
tags question: http://stackoverflow.com/q/28599451
tags question: http://stackoverflow.com/q/28647607
tags question: http://stackoverflow.com/q/28647623
tags question: http://stackoverflow.com/q/28663562
tags question: http://stackoverflow.com/q/28711536
tags question: http://stackoverflow.com/q/28730114
tags question: http://stackoverflow.com/q/28744547
tags question: http://stackoverflow.com/q/28714419
tags question: http://stackoverflow.com/q/28615768
tags question: http://stackoverflow.com/q/28685286
tags question: http://stackoverflow.com/q/28690643
tags question: http://stackoverflow.com/q/28602839
tags question: http://stackoverflow.com/q/28744768
tags question: http://stackoverflow.com/q/28734628
tags question: http://stackoverflow.com/q/28671388
tags question: http://stackoverflow.com/q/28682214
tags question: http://stackoverflow.com/q/28723447
tags question: http://stackoverflow.com/q/28681481
tags question: http://stackoverflow.com/q/28744030
tag name: svg
tags question: http://stackoverflow.com/q/28728424
tags question: http://stackoverflow.com/q/28679198
tags question: http://stackoverflow.com/q/28649986
tags question: http://stackoverflow.com/q/28653003
tags question: http://stackoverflow.com/q/28641821
tags question: http://stackoverflow.com/q/28649650
tags question: http://stackoverflow.com/q/28600801
tags question: http://stackoverflow.com/q/28676085
tags question: http://stackoverflow.com/q/28676181
tags question: http://stackoverflow.com/q/28714632
tags question: http://stackoverflow.com/q/28643612
tags question: http://stackoverflow.com/q/28604693
tags question: http://stackoverflow.com/q/28605609
tags question: http://stackoverflow.com/q/28599233
tags question: http://stackoverflow.com/q/28715351
tags question: http://stackoverflow.com/q/28632512
tags question: http://stackoverflow.com/q/28734585
tags question: http://stackoverflow.com/q/28619474
tags question: http://stackoverflow.com/q/28731826
tags question: http://stackoverflow.com/q/28694230
tags question: http://stackoverflow.com/q/28674371
tags question: http://stackoverflow.com/q/28685146
tags question: http://stackoverflow.com/q/28644468
tags question: http://stackoverflow.com/q/28717129
tags question: http://stackoverflow.com/q/28710373
tags question: http://stackoverflow.com/q/28742899
tags question: http://stackoverflow.com/q/28731748
tags question: http://stackoverflow.com/q/28744664
tags question: http://stackoverflow.com/q/28705913
tags question: http://stackoverflow.com/q/28634283
tags question: http://stackoverflow.com/q/28722162
tags question: http://stackoverflow.com/q/28689462
tags question: http://stackoverflow.com/q/28702218
type: Tag

http://stackoverflow.com/a/61393861
has body: Inside your &lt;script&gt;, you can create a div element: const div = document.createElement('div'); and give it an innerText value like: div.innerText = `&lt;%= data_from_your_server_response %&gt;` If you console.log(div), the data from your server response will be displayed.
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/28603658
score: 0
type: Answer

http://stackoverflow.com/comment/120286332
type: AnswerComment
type: Comment
score: 2
comment on: http://stackoverflow.com/a/60193465
has text: @nkhil It's my own bad, there is no race condition with the current example. I must have missed the await keyword, which is unexpected. It would be simpler to just return the promise and call `readable.close()` immediately after `reader.close()`. This would avoid bringing the await logic which is quite heavy when transpiled. But this is nitpicking at this point. The main concern remains that if there is no line to read, this will hang forever.

http://stackoverflow.com/q/28696086
has answer: http://stackoverflow.com/a/28699329
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45683635
has body: I have a function in my ReverseService service. I am using this service in my controller. Calling it on ng-click. The problem is, I am calling the same function for two ng-clicks, and hence being applied for both where I want it to be applied for only one (the one that I click). I know why this is happening, but I am not able to come up with a solution. Here is the code. HTML DASHBOARD COMPANY PROFILE SERVICES EMPLOYEES STATISTICS REVIEWS TIPS & ADVICE DEALS MEDIA BOOKING CALENDAR MARKET SPONSOR A DEAL EXTRA SERVICES Angular var myApp = angular.module("myApp", []); myApp.service("ReverseService", function() { // service func goes here -- this.imgSwap = function(images) { if (images.current === images.finalImage) { images.current = images.initialImage; } else if (images.current === images.initialImage) { images.current = images.finalImage; } }; }); myApp.controller("SideCtrl", function($scope, ReverseService) { console.log("thomas"); $scope.myData = {}; $scope.images = { initialImage: "images/prof_arrow1.png", finalImage: "images/prof_arrow.png", current: "images/prof_arrow1.png" }; $scope.swapHere = function() { ReverseService.imgSwap($scope.images); }; $scope.subSec = false; $scope.bookSec = false; }); Here is a Plunker.
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28699329
has comment: http://stackoverflow.com/comment/45682709
tagged with: javascript
has title: Apply single service logic to two similar buttons
has comment: http://stackoverflow.com/comment/45682628
has comment: http://stackoverflow.com/comment/45682832
answer count: 1
downvote count: 0
score: 1
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/q/28608183
has comment: http://stackoverflow.com/comment/45520663
tagged with: javascript
has title: A better way to do this with ReactJS?
score: 0
type: UnansweredQuestion
tagged with: youtube
answer count: 0
has comment: http://stackoverflow.com/comment/45523188
has comment: http://stackoverflow.com/comment/45526741
tagged with: iframe
has body: Well.. I'm new in ReactJS, I'm AngularJS developer. I have a problem... I need click on link and render a with a youtube iframe video. I did, but... Below the code: Title Date and Hours I need that when click on '.-video' shows youtube iframe inside '.video-box'. Will have many '.-video'. I did so: /** * Video */ var VideoBox = React.createClass({ render: function () { return ( ); } }); /** * When click on '-video' */ var videos = document.querySelectorAll('.-video'); for (var i = 0, t = videos.length; i < t; i++) { var video = videos[i]; video.addEventListener('click', function(e) { e.preventDefault(); var videoBox = video.querySelector('.video-box'), id = videoBox.getAttribute('video-id'); React.render( <VideoBox videoId={id} />, videoBox ); videoBox.style.display = 'block'; }); } Yes, it works! There is a better way to do this? Thanks!
has comment: http://stackoverflow.com/comment/45539906
type: Question
has comment: http://stackoverflow.com/comment/45526534
tagged with: reactjs
has comment: http://stackoverflow.com/comment/45523949

http://stackoverflow.com/q/28699255
has comment: http://stackoverflow.com/comment/45688732
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has title: How to dynamically detect browser viewport change in size?
has comment: http://stackoverflow.com/comment/45688730
has comment: http://stackoverflow.com/comment/45688525
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45689011
tagged with: css
has comment: http://stackoverflow.com/comment/45688574
favorite count: 0
has comment: http://stackoverflow.com/comment/45690152
has comment: http://stackoverflow.com/comment/45688608
linked to: http://stackoverflow.com/q/3124974
type: Question
score: 5
has comment: http://stackoverflow.com/comment/45688890
has comment: http://stackoverflow.com/comment/45688754
answer count: 1
has comment: http://stackoverflow.com/comment/45690563
has answer: http://stackoverflow.com/a/28702738
upvote count: 5
has comment: http://stackoverflow.com/comment/45690497
has body: I've been having problems with scaling... automatic... dynamic... adaptive.... etc... I have seen websites where as you make the window smaller eg. grab a corner and make the window smaller, fonts get bigger, things move around... I've got the moving part, I don't know how to dynamically detect the browser viewport... is that a refreshing thing or?... As you can see here, these motion things that I've used only work upon screen refresh, in particular I have a tablet, and if I visit the page in landscape, it doesn't apply; if I rotate it and then refresh, it applies. &lt;script language="JavaScript" type="text/javascript"&gt; var x = screen.width; var y = screen.height; function scale() { var z = x/y; if (z&lt;1) { document.getElementById('header').style.width = "100%"; document.getElementById('menu').style.marginLeft = "0"; document.getElementById('menu').style.width = "20%"; document.getElementById('menu2').style.width = "30%"; document.getElementById('menu3').style.width = "20%"; document.getElementById('menu4').style.width = "20%"; document.getElementById('properties').style.width = "30%"; document.getElementById('properties').style.marginLeft = "35%"; } } scale(); &lt;/script&gt; This is code provided by someone from Stack Overflow regarding font, I imagine it may be similar to the direction I'm going $( window ).resize(function() { $( "#container" ).css("font-size",function() { var value = $( "#container" ).css("width"); console.log(parseInt(value)/24 + "pt"); return parseInt(value)/24 + "pt"; }) ; }); What part is dynamic? This console.log, I haven't used that before Any help would be greatly appreciatedd
tagged with: scaling

http://stackoverflow.com/q/28697203
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45685656
score: 1
has comment: http://stackoverflow.com/comment/45684952
has answer: http://stackoverflow.com/a/28698360
accepted answer: http://stackoverflow.com/a/28698360
upvote count: 1
tagged with: arrays
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: regex
has body: Can any one help me in solving my issue. Array = [ { y: 0.02, label: \\5:37 A\\ }, { y: 0.02, label: \\2:54 A\\ }, { y: 0.02, label: \\1:00 A\\ }, ] Should replace \\ with " expected Array/String should be as [ { y: 0.02, label: "5:37 A" }, { y: 0.02, label: "2:54 A" }, { y: 0.02, label: "1:00 A" }, ] Thanks in Advance
has title: How to replace "\\" with '"' in an array in JavaScript
tagged with: titanium
has comment: http://stackoverflow.com/comment/45686804
type: Question

http://stackoverflow.com/comment/45717495
comment on: http://stackoverflow.com/a/28710414
score: 0
type: AnswerComment
has text: Thanks - this worked. Why didn't the simple setTimeout work? Shouldn't the loop have iterated only after the timeout?
type: Comment

http://stackoverflow.com/a/28739137
upvote count: 2
has comment: http://stackoverflow.com/comment/45765522
downvote count: 0
answers question: http://stackoverflow.com/q/28738511
type: Answer
score: 2
has body: You didn't had the code to close the open div's Also HTML element's id should be unique and a class name should be shared with more than one element. your code seemed to have flipped this concept.I have corrected this in your HTML and CSS code. A correctly coded HTML & CSS would shorten your script and makes your maintenance job so much easier. $(document).ready(function() { $(".btn").click(function() { //hide all the open div's $('.menu').filter(function(e) { return $(this).css("display") == "block"; }).toggle(); //open the correct div now $(this).next('.menu:first').toggle(); }); }); .btn { height: 35px; line-height: 35px; text-align: center; background-color: grey; border-top: 2px solid white; border-bottom: 2px solid white; } .menu { border: 2px solid orange; height: 50px; } .menu { display: none; } Button 1 This is text which belong to button 1. Button 2 This is another text. This appear after you click on button 2. Button 3 Some text under button 3. Button 4 Some text under button 4. New line of last text.

http://stackoverflow.com/q/28654331
type: AnsweredQuestion
type: Question
tagged with: javascript
score: 0
tagged with: google-chrome-extension
has body: In my code, the contextMessage is not showing up I know it works fine with chrome.notifications.create, but if I use that then I can't make it so the notification never disappears without being closed or clicked on function Notify(Title, Body, miniMsg, Url, Icon) { var notification = new Notification(Title, { icon: Icon||"Logo.png", body: Body, contextMessage:miniMsg }); notification.onclick = function () { window.open(Url); } } Thanks!
answer count: 1
has title: Chrome Extension notifications not showing contextMessage?
linked to: http://stackoverflow.com/q/26350747
has answer: http://stackoverflow.com/a/28654804
accepted answer: http://stackoverflow.com/a/28654804

http://stackoverflow.com/comment/45781557
type: Comment
comment on: http://stackoverflow.com/a/28706630
has text: Nothing about this requires augmenting the string prototype.
score: 16
type: AnswerComment

http://stackoverflow.com/comment/112550592
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/33691070
has text: This just gets the name of the view I think.

http://stackoverflow.com/comment/100579999
type: AnswerComment
comment on: http://stackoverflow.com/a/48707175
type: Comment
score: 1
has text: This is a great response when you want to change one element out of many. Thanks!

http://stackoverflow.com/a/60439478
has body: What I have found is that Safari actually pauses all animations as soon as the pagehide event is fired, whenever the browser begins loading a new page. After pagehide, it won't even allow CSS changes such as showing a spinner that was previously hidden. In order to show the spinner before the pagehide event fires, I needed to add listeners for a[href] clicks and ajaxComplete events. My guess is that Safari does this to enhance performamce by focusing all available CPU and GPU power to the rendering of the next page. I think this is a bit extreme, and unfortunate for UX where in many mobile web applications we use spinner animations at page unload to show the user something is happening during the few seconds while a new page is being fetched. I have so far not found a way to preserve motion animation during page unload; at best the spinner appears frozen but still shows up... a possible workaround is to use a static message to indicate it's "Loading..."
answers question: http://stackoverflow.com/q/28749519
downvote count: 0
type: Answer
score: 3
upvote count: 3

http://stackoverflow.com/a/28665188
answers question: http://stackoverflow.com/q/28665160
score: 0
type: Answer
has body: newStr is undefined. Add var newStr = ''; So that you have function translate2(x){ var newStr=''; x = "Hello World"; for(i=0; i&lt;x.length; i++) { newStr+=x.charAt(i); } console.log(newStr); }
upvote count: 1
downvote count: 1

http://stackoverflow.com/q/28717433
tagged with: javascript
tagged with: header
answer count: 0
type: UnansweredQuestion
tagged with: referer
has comment: http://stackoverflow.com/comment/45722221
type: Question
has title: Hide header referer for external javascript
score: 0
has comment: http://stackoverflow.com/comment/45722093
has body: I have a external tracking code on my confirmation page, but the url on my page also has personal information stored. How can I prevent that the header referer get send (my page is not html5). Here an example of the external link >

http://stackoverflow.com/a/28713326
type: Answer
answers question: http://stackoverflow.com/q/28713189
has body: You can do this with angular.element e.g.: angular.element(document.getElementById(id)).clientWidth; angular.element(document.querySelectorAll('.class')[0]).clientWidth; or if you have jQuery loaded angular.element($('#id').width(); angular.element($('.class')[0]).width();
score: 0

http://stackoverflow.com/q/28662795
linked to: http://stackoverflow.com/q/922544
has title: Referencing a JSON key with Javascript variable
upvote count: 0
tagged with: javascript
score: -1
accepted answer: http://stackoverflow.com/a/28662813
duplicate of: http://stackoverflow.com/q/922544
answer count: 1
linked to: http://stackoverflow.com/q/13474040
favorite count: 0
has body: How do I replace the "Argentina" key with a javascript variable string? jQuery(document).ready(function() { $.getJSON('countries.json', function(data) { var output= data.Argentina[0].countryPhone1; alert(output); }); }); Here's what my .json data file looks like: { "Argentina": [{ "countryName":"Argentina", "countryPhone1":"1234" }], "Brazil": [{ "countryName":"Brazil", "countryPhone1":"5678" }] } I tried applying the suggested solutions here, here and here, but I couldn't figure out a way to adapt them to my example.
has answer: http://stackoverflow.com/a/28662813
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
downvote count: 1
linked to: http://stackoverflow.com/q/13833204
type: Question

http://stackoverflow.com/comment/45595637
has text: I meant to make sure the _binding_ is executed, so the script. Not the handler you define inside the script.
comment on: http://stackoverflow.com/q/28648906
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28722441
has answer: http://stackoverflow.com/a/28722485
possible better answer: http://stackoverflow.com/a/28722671
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28722485
tagged with: dom-events
has body: I want to change my HTML page based on some input. So I tried using JavaScript event handlers to achieve this, but they don't seem to work at all. Here's my code: var nam = document.getElementById('FNAME'); nam.onchange=test(); function test(){ alert("test"); } This only works for one time when the page loads. I've included this external JavaScript file in my HTML code just before closing the body tag.
has comment: http://stackoverflow.com/comment/45731707
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28722671
has title: onchange event handler to change the page on input
tagged with: javascript

http://stackoverflow.com/comment/45721659
score: 0
comment on: http://stackoverflow.com/a/28716990
has text: @AmrElGarhy - Exactly.
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28713598
tagged with: angularjs
tagged with: iframe
has comment: http://stackoverflow.com/comment/52288895
possible better answer: http://stackoverflow.com/a/36715253
has answer: http://stackoverflow.com/a/36715253
has answer: http://stackoverflow.com/a/45319675
type: Question
has comment: http://stackoverflow.com/comment/69942455
accepted answer: http://stackoverflow.com/a/28713713
type: AnsweredQuestion
score: 18
upvote count: 18
tagged with: ionic-framework
has comment: http://stackoverflow.com/comment/45715196
downvote count: 0
tagged with: javascript
favorite count: 0
has title: How to get window height in angular js
has answer: http://stackoverflow.com/a/28713713
tagged with: http://stackoverflow.com/tag/html
has body: I 'm using iframe to display the contents using angularjs with ionic framework. Here, I need to give window height as iframe height, so I have used $scope.iframeHeight = window.innerHeight; But, I am getting 1/4th screen only. Here what I tried so far. index.html Am I missing something?
has answer: http://stackoverflow.com/a/28713712
answer count: 4

http://stackoverflow.com/q/28719923
has answer: http://stackoverflow.com/a/28720318
has body: I am trying to understand how I can utilize angular's $q library to display images which are based on a canvas drawing and then converted using .toDataURL(); Basically I want to: Loop over a images ($scope.targetImages) Draw them on a canvas Convert them to images using .toDataURL() and store it in ($scope.outputImages); Display the images using ng-repeat The problem is, that the function .toDataURL() can take some time before executed, thus resulting in a delayed call of step 4, and thus nothing being displayed. I have tried the following, but it still resolves before all the images are converted. As I have it now, when I call drawCanvas() for the second time, then the images are shown. // 1 $scope.targetImages= {} drawCanvas().then(function(data){ console.log("done: " + new Date()) console.log(data) $scope.outputImages = data; $scope.previewMode = false; // switch views, display canvas, remove preview }); function drawCanvas() { var defer = $q.defer(); var targetImages = {} angular.forEach($scope.targetImages , function(imageObj, key) { var canvas = document.getElementById("canvas"); var ctx = canvas.getContext("2d"); var img = new Image(); img.src = imageObj.nativeURL; img.onload = start // 2 function start() { ctx.drawImage(img, 0, 0, img.width, img.height); outputImages[key] = { IID: key, dataURL: canvas.toDataURL() } } // start }); // for loop target images defer.resolve(outputImages); return defer.promise; } // draw canvas And displayed as: &lt;img ng-show="!previewMode" ng-src="" style="width: 100vw; max-width: 600px;"&gt;
tagged with: canvas
answer count: 1
tagged with: javascript
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
has title: Handling Async Calls with Canvas and ForEach
tagged with: asynchronous
accepted answer: http://stackoverflow.com/a/28720318
score: 0
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/45781873
type: QuestionComment
has text: http://jsfiddle.net/dgtqptr7/1/
score: 0
comment on: http://stackoverflow.com/q/28748139
type: Comment

http://stackoverflow.com/a/28687948
accepted answer of: http://stackoverflow.com/q/28684491
answers question: http://stackoverflow.com/q/28684491
upvote count: 5
has body: Not really. Hardware acceleration depends on a lot of factors, none of them under javascript control. Which leaves us the question of how to improve CSS width/margin transition performance, and the answer is usually "replace it with scale", because it can be done cheaply on GPU and because it doesn't trigger reflow. http://www.html5rocks.com/en/tutorials/speed/high-performance-animations/ http://blogs.adobe.com/webplatform/2014/03/18/css-animations-and-transitions-performance/ Improving CSS3 transition performance Jerky CSS transform transition in Chrome It is also known that Chrome does not do as well a job accelerating CSS transitions as Firefox and IE. Why transitions for some CSS properties are slow and none fluent CSS3 transform difference in Firefox and Chrome and IE http://www.binarymoon.co.uk/2014/02/fixing-css-transitions-in-google-chrome/ In fact, given that Google rejected Pointer Event on the ground of speed, which IE solved by GPU acceleration, it can be said that Chrome (and Webkit in general - Safari is even slower) is lagging behind on this front, and the only way to help is contributing code to Chromium / Webkit. I'd rather switch to a quicker transition.
type: Answer
downvote count: 0
score: 5
type: AcceptedAnswer

http://stackoverflow.com/q/28719795
has answer: http://stackoverflow.com/a/62298591
has title: Lodash sort collection based on external array
tagged with: collections
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28719938
has answer: http://stackoverflow.com/a/28726560
has answer: http://stackoverflow.com/a/28719914
tagged with: underscore.js
has comment: http://stackoverflow.com/comment/45726859
type: Question
has answer: http://stackoverflow.com/a/51200641
has body: I have an array with keys like so: ['asdf12','39342aa','12399','129asg',...] and a collection which has these keys in each object like so: [{guid: '39342aa', name: 'John'},{guid: '129asg', name: 'Mary'}, ... ] Is there a fast way to sort the collection based on the order of keys in the first array?
tagged with: arrays
downvote count: 0
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/51200641
score: 48
answer count: 5
has answer: http://stackoverflow.com/a/28719938
has comment: http://stackoverflow.com/comment/45726608
upvote count: 48
tagged with: lodash

http://stackoverflow.com/comment/121147722
type: Comment
score: 1
has text: JavaScript is weird at times :D
comment on: http://stackoverflow.com/a/62310140
type: AnswerComment

http://stackoverflow.com/comment/45555653
type: QuestionComment
type: Comment
score: 1
has text: The 3rd parameter is the starting value. In this case you want to use `1`.
comment on: http://stackoverflow.com/q/28627590

http://stackoverflow.com/comment/45506659
has text: not that what I want, you didn't set events on datepicker, I want to show events (active) on datepicker, but it should display February month, not March !
comment on: http://stackoverflow.com/a/28600415
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/q/28689918
upvote count: 1
has answer: http://stackoverflow.com/a/28689981
accepted answer: http://stackoverflow.com/a/28689981
type: AnsweredQuestion
score: 1
has title: querySelector() attachEvent() not working
has answer: http://stackoverflow.com/a/28689967
type: Question
has comment: http://stackoverflow.com/comment/45671577
answer count: 2
has comment: http://stackoverflow.com/comment/45671658
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28689967
has body: I have a button like bellow &lt;input type="button" value="check" /&gt; And,I try to alert on this button click as follows document.querySelector('input[type="button"]').attachEvent('onclick', function() { alert(1); }); But this is not working,Why?
has comment: http://stackoverflow.com/comment/45671478
has comment: http://stackoverflow.com/comment/45671597

http://stackoverflow.com/a/28601393
type: Answer
answers question: http://stackoverflow.com/q/28601023
score: 0
has body: If you need to see the value as part of debugging the code, you should use console.log(AJAX) to inspect the value. If you really need to display some message to the user, then reconsider showing the json result unformatted/filtered - that said you could iterate through all the objects properties and concenate theese in a string (like @Hiral shows).

http://stackoverflow.com/a/30560495
has body: I know this is a late reply and just ran across this post. Hopefully you have figured this out, I am posting the answer in case others need to use this. In your you need to add the form-inline class as follows. and move this into the the row like this. Also need to remove the and sections so you can get them close together. Here is an Example: @Html.LabelFor(model => model.WorkPhone, htmlAttributes: new { @class = "control-label" }) @Html.EditorFor(model => model.WorkPhone, new { htmlAttributes = new { @class = "form-control", @style = "width:200px" } }) @Html.ValidationMessageFor(model => model.WorkPhone, "", new { @class = "text-danger" }) @Html.LabelFor(model => model.WorkPhoneExt, htmlAttributes: new { @class = "control-label" }) @Html.EditorFor(model => model.WorkPhoneExt, new { htmlAttributes = new { @class = "form-control", @style = "width:75px" } }) I myself like to place the Labels above the boxes as the Text is smaller than the new form-control class and the text box is much bigger than the label text. I do this with the col-md-12 class added to the label class . Here is the code for that. @Html.LabelFor(model => model.WorkPhone, htmlAttributes: new { @class = "control-label col-md-12" }) @Html.EditorFor(model => model.WorkPhone, new { htmlAttributes = new { @class = "form-control", @style = "width:200px" } }) @Html.ValidationMessageFor(model => model.WorkPhone, "", new { @class = "text-danger" }) @Html.LabelFor(model => model.WorkPhoneExt, htmlAttributes: new { @class = "control-label col-md-12" }) @Html.EditorFor(model => model.WorkPhoneExt, new { htmlAttributes = new { @class = "form-control", @style = "width:75px" } }) @Html.ValidationMessageFor(model => model.WorkPhoneExt, "", new { @class = "text-danger" }) Hope this helps someone.
score: 10
accepted answer of: http://stackoverflow.com/q/28665814
type: AcceptedAnswer
upvote count: 10
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/28665814

http://stackoverflow.com/q/28701919
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/45695214
tagged with: multiple-instances
answer count: 1
has title: Combining AJAX requests using $.when and sending the data to a function
has comment: http://stackoverflow.com/comment/45694018
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45694124
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45694267
type: Question
has answer: http://stackoverflow.com/a/28702758
has body: I have functions and AJAX calls that update content in the page that need to be separate, however on page load they need to all load together hence my use of $.when - but my understanding of sending data between functions and using $.when is terrible - I've looked at several solutions to combine AJAX calls and all seem to fail for me. Here's my solution currently: I have 2 functions that run seperate AJAX requests. Then I call these from $.when The data is returned and in correct JSON format (verified on JSONlint) However, when passed back through $.when the data is unset / lost somehow and at this point I dont understand whats happening. I can output the data within the AJAX function, but if I attempt to output from within the $.when function, or within the onload_sendData function, the data always becomes "undefined". I've tried JSON.stringify, and JSON.parse both before passing to a function and after - makes no difference, data always becomes undefined when I try to read it after passing to the next function this way. Perhaps I'm missing something fundamental on how Javascript passes data, hope someone can help. function onload_Categories() { $.ajax({ type: "GET", url: '/index/categories', ContentType : 'application/json', success: function (data1) { return data1; }, error: function (jqXHR, textStatus, errorThrown) { return errortThrown; } }) } function onload_Subscribed() { return $.ajax({ type: "GET", url: '/index/getsubscribed', ContentType : 'application/json', success: function (data2) { return data2; }, error: function (jqXHR, textStatus, errorThrown) { return errortThrown; } }) } function onload_sendData(data1) { alert(data1); // "UNDEFINED" //processCategories(data1); // send data to populate the page categories //processSubscribed(data2); // send data to populate the subscription data } (function($){ $(window).load(function(){ v1 $.when(onload_Categories(),onload_Subscribed()).then(onload_sendData); v2 $.when(onload_Categories(),onload_Subscribed()).the…
tagged with: javascript

http://stackoverflow.com/comment/85205880
score: 0
has text: it's just the name of a callback, am i getting it right?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28656780

http://stackoverflow.com/q/28735543
tagged with: asp.net-mvc
tagged with: javascript
has title: Regular Expression in C# and Javascript
score: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/28735808
has answer: http://stackoverflow.com/a/28735695
possible better answer: http://stackoverflow.com/a/28735559
has body: I want to implement regular express for below condition , can any one help please Numeric 0-9 with special character/ \ @ # $ % ^ &amp; * ! - ~ . _ ( ) &amp; space allowed like : 123abc not allowed like : 123#$%~. are allowed
has answer: http://stackoverflow.com/a/28735808
tagged with: regex
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28735559
type: Question
tagged with: c#

http://stackoverflow.com/q/28639729
tagged with: jquery
has title: jssor slider: how to change slide content dynamicaly
tagged with: slider
has comment: http://stackoverflow.com/comment/45579174
has comment: http://stackoverflow.com/comment/45585694
favorite count: 0
linked to: http://stackoverflow.com/q/23870482
answer count: 0
type: UnansweredQuestion
upvote count: 1
has body: I have an example div with slides: &lt;div u="slides" ...&gt; &lt;div id="slide1"&gt;**original content 1**&lt;/div&gt; &lt;div id="slide2"&gt;&lt;!-- any content of slide2 --&gt;&lt;/div&gt; &lt;/div&gt; I've found one answer here jssor slider: How to reload/refresh the slider to show new images that says: 'You can place any content in each slide and you can remove/insert elements freely at runtime.' So I have tried it, I changed content of one particular slide: $('#slide1')[0].innerHTML = 'new sample content of the slide'; after executing the assignment as above my slide still SHOWS 'original content 1' however when doing alert($('#slide1')[0].innerHTML) I am getting what I want [i.e.: 'new sample content of the slide']. How do I make jssor slider to reflect changes applied to the slide?
tagged with: jssor
has comment: http://stackoverflow.com/comment/45578769
score: 1
type: Question
has comment: http://stackoverflow.com/comment/45580114
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/45600049
comment on: http://stackoverflow.com/a/28650986
has text: You may also be interested in [this](http://stackoverflow.com/questions/24944925/background-image-jumps-when-address-bar-hides-ios-android-mobile-chrome) related question that did have an answer.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28739862
has comment: http://stackoverflow.com/comment/45763421
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28739489
upvote count: 1
has comment: http://stackoverflow.com/comment/45763475
score: 1
has comment: http://stackoverflow.com/comment/45764150
answers question: http://stackoverflow.com/q/28739489
has body: I am not sure but your script would be something like this var backendRes = "{"check":"&lt;table&gt;&lt;tr&gt;&lt;td&gt;ID&lt;\/td&gt;&lt;\/tr&gt; &lt;\/table&gt;"}"; var res = backendRes.check;

http://stackoverflow.com/a/28596681
has body: IE8 doesn't support the trim() method. Try adding this to your helper functions and then run your script. if (!String.prototype.trim) { (function() { var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; String.prototype.trim = function() { return this.replace(rtrim, ''); }; })(); }
answers question: http://stackoverflow.com/q/28596095
has comment: http://stackoverflow.com/comment/45500060
type: Answer
has comment: http://stackoverflow.com/comment/45500025
score: 0

http://stackoverflow.com/q/28683815
type: UnansweredQuestion
score: 1
type: Question
tagged with: automation
has body: I'm trying to automate a lengthy workflow of clicks in an internal application for work. I'm actually a recruiter, and I want to bind a series of browser actions to one key (using ShortKeys Chrome extension). I've worked out everything in JavaScript except one field that I can't seem to change the value of. I don't have access to the source code, but the HTML element is as follows: &lt;input type="text" class="inputtext textInput" name="time_display_time" value="12:54 pm" placeholder="Add a time" autocomplete="off" aria-autocomplete="list" aria-expanded="false" aria-owns="typeahead_list_u_m_2" aria-haspopup="true" role="combobox" spellcheck="false" aria-label="Add a time" id="u_m_3" tabindex="0"&gt; I'm attempting to change the "value" attribute to a specific time, but using element.value = "new_time"; doesn't seem to work. I think the problem is that this particular input dynamically generates a drop down of suggested values based on what the user is typing. Therefore, if I want to change the value of the input, I need to simulate a user typing in "9:30 am", for example, and then hitting the return key. Anyone have any advice?! Thanks in advance!
tagged with: javascript
tagged with: jquery
tagged with: browser
answer count: 2
tagged with: keypress
has comment: http://stackoverflow.com/comment/45660710
upvote count: 1
has answer: http://stackoverflow.com/a/28684523
downvote count: 0
has title: How do I automate key strokes using JavaScript/jQuery
favorite count: 0
has answer: http://stackoverflow.com/a/28704348

http://stackoverflow.com/q/28698445
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28698691
type: Question
has title: Can't initialize plugin (isotope) when using jQuery.getScript
has body: So I've created an app that loads HTML on a clients page and I need to load a few scripts via javascript and act on the HTML. In particular I need to use JS to get the isotope javascript file and then initialize it on the HTML we just created. Also note that I am running jQuery in noConflict mode so the scripts don't cause errors on the clients site. In testing my code works fine if I hardcode the < script > tag in the HTML, but this isn't feasible on the final product. I need to get the external script via JS since it's dynamic. The problem is I get the following error: "Uncaught TypeError: undefined is not a function" Here is a fiddle Any advice appreciated!
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery-isotope

http://stackoverflow.com/comment/45725295
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28717585
has text: Actually i want to execute the command after loading the img (amazon.png), So document ready don´t help me.
type: AnswerComment

http://stackoverflow.com/q/28719612
upvote count: 8
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45726251
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45727902
linked to: http://stackoverflow.com/q/4570333
has answer: http://stackoverflow.com/a/28719740
type: Question
has body: I am writing a custom HTML editor. User can edit an entire HTML content and the changes will be updated in DOM. We have an option to undo all the changes. Logic: Clone an entire container before making change and apply it again. Disadvantages: Storing a huge variable in js memory. And applying the changes again a dom will repaint everything. Is there any way to achieve the same?.
tagged with: dom
has comment: http://stackoverflow.com/comment/45728348
has comment: http://stackoverflow.com/comment/45726117
has answer: http://stackoverflow.com/a/28721241
score: 8
has answer: http://stackoverflow.com/a/28721718
has comment: http://stackoverflow.com/comment/45726409
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Undo dom changes in JS
favorite count: 0

http://stackoverflow.com/q/28691085
has body: I do not get it. I thought that I didi it, and now I cannot do it. Simple html with an iframe. Indide the iframe is another html. I want to change an image from the main iframe when you access the iframe. HTML from the main html: Main html: test.html Change Picture It is supposed to change the picture when you click on the link. But the ALERT is not showing... I've tried different ways and I'm really lost. Is so difficult to achieve this simple change?
linked to: http://stackoverflow.com/q/625936
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/726816
tagged with: iframe
type: Question
accepted answer: http://stackoverflow.com/a/28698123
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28698123
possible better answer: http://stackoverflow.com/a/28691393
has answer: http://stackoverflow.com/a/28691393
has comment: http://stackoverflow.com/comment/45674184
tagged with: javascript
has title: Can't access parent elements from iframe

http://stackoverflow.com/q/28718497
tagged with: jquery
favorite count: 0
has title: How can i filter a select based on a string from an input value?
score: 2
answer count: 0
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45724473
type: Question
has body: I have a problem, I'm trying to filter the options of a select based on the value of an input, however when filtering occurs, the select becomes empty. Another problem, my version of jQuery is 1.4.4... This is my Code: jQuery.fn.filterByText = function(textbox, selectSingleMatch) { return this.each(function() { var select = this; var options = []; $(select).find('option').each(function() { options.push({value: $(this).val(), text: $(this).text()}); }); $(select).data('options', options); $(textbox).bind('change keyup', function() { var options = $(select).empty().scrollTop(0).data('options'); var search = $.trim($(this).val()); var regex = new RegExp(search,'gi'); $.each(options, function(i) { var option = options[i]; if(option.text.match(regex) !== null) { $(select).append( $('&lt;option&gt;').text(option.text).val(option.value) ); } }); if (selectSingleMatch === true &amp;&amp; $(select).children().length === 1) { $(select).children().get(0).selected = true; } }); }); }; $(function() { $('#relProducts').filterByText($('#buscarProdutosSelect'), false); }); Edit A strange thing happened, in fiddle the code works, however when the code is on the aplication it does not work... Here is the Fiddle: http://jsfiddle.net/zyx5ojty/
has comment: http://stackoverflow.com/comment/45724301
has comment: http://stackoverflow.com/comment/45724021
has comment: http://stackoverflow.com/comment/45723954
tagged with: javascript
has comment: http://stackoverflow.com/comment/45724181
has comment: http://stackoverflow.com/comment/45724261
has comment: http://stackoverflow.com/comment/45725006
downvote count: 0

http://stackoverflow.com/q/28696237
has comment: http://stackoverflow.com/comment/45683264
linked to: http://stackoverflow.com/q/6287511
has title: Is the underscore.js IIFE syntax valid?
has body: I just took a look at the underscore.js source code and when i strip the source code down to its bare containing IIFE it looks like this: (function() { }.call(this)); I always used the syntax with outer parantheses (function() {}).call(this); and wondered if this syntax is also valid and common?
accepted answer: http://stackoverflow.com/a/28696306
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/6287511
tagged with: syntax
tagged with: underscore.js
has comment: http://stackoverflow.com/comment/45683069
downvote count: 1
has comment: http://stackoverflow.com/comment/45682836
type: Question
linked to: http://stackoverflow.com/q/5938802
upvote count: 0
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45682798
answer count: 1
linked to: http://stackoverflow.com/q/3384504
favorite count: 0
has answer: http://stackoverflow.com/a/28696306

http://stackoverflow.com/comment/45494773
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28593765
type: AnswerComment
has text: To do that you will have to override the links' click event.. look at [this question](http://stackoverflow.com/questions/824349/modify-the-url-without-reloading-the-page) for changing the url without redirecting the page.

http://stackoverflow.com/q/28742630
accepted answer: http://stackoverflow.com/a/28743138
favorite count: 0
tagged with: angularjs
tagged with: d3.js
has body: I have been using c3.js and cant figure out how to get a JavaScript event for onClick of the Data group labels which is displayed in X Axis. Basically i need event to which I can register a event handler in the below Circled area.
type: AnsweredQuestion
score: 3
downvote count: 0
has title: c3.js how to get a onclick event for DataGroups
type: Question
tagged with: javascript
tagged with: c3
tagged with: jquery
upvote count: 3
answer count: 1
has answer: http://stackoverflow.com/a/28743138

http://stackoverflow.com/a/57298159
upvote count: 6
has body: The following example emulates Android Long press. Put your action after the long press inside the setTimeout: var timer; //Time of the long press const tempo = 1000; //Time 1000ms = 1s const mouseDown = () => { timer = setTimeout(function(){ //Insert your function here alert("Your Function Here!"); }, tempo); }; const mouseUp = () => { clearTimeout(timer); }; Long Touch Me!
score: 6
answers question: http://stackoverflow.com/q/28664703
downvote count: 0
type: Answer

http://stackoverflow.com/comment/45536394
comment on: http://stackoverflow.com/q/28616112
type: Comment
type: QuestionComment
has text: here is the [plunker](http://plnkr.co/edit/wn5KGQ0T8GVf6O1tNR5V?p=preview) @itcouldevenbeaboat
score: 0

http://stackoverflow.com/q/28628620
has answer: http://stackoverflow.com/a/28628649
has answer: http://stackoverflow.com/a/28629310
has body: I am trying to check if the clicked item contains a certain text and if so remove it. All agencies A Z C H $(document).on( 'click touchend', '.filter a', function( event ) { event.preventDefault(); var self = $(this); if(self.html().indexOf("All ")!=-1) self.html(self.html().replace("All ", "")); }); The above code gives me: Uncaught TypeError: undefined is not a function
type: Question
possible better answer: http://stackoverflow.com/a/28628652
has comment: http://stackoverflow.com/comment/45558599
score: 0
accepted answer: http://stackoverflow.com/a/28628649
tagged with: javascript
tagged with: jquery
has title: If el contains this text, remove this string from it?
has answer: http://stackoverflow.com/a/28628832
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28628652

http://stackoverflow.com/a/30324961
type: Answer
answers question: http://stackoverflow.com/q/28690022
score: 0
accepted answer of: http://stackoverflow.com/q/28690022
has body: I found the answer. The share url should be a publicly accessible url. My url was "local.mpr.com" which I had configured using my IIS. So, the question is, can't I test the linkedin api unless I share a url that is available in the public domain.
type: AcceptedAnswer

form-submit
tags question: http://stackoverflow.com/q/28683504
tag name: form-submit
tags question: http://stackoverflow.com/q/28630068
tags question: http://stackoverflow.com/q/28678894
tags question: http://stackoverflow.com/q/28664347
type: Tag
tags question: http://stackoverflow.com/q/28706862

http://stackoverflow.com/comment/45608105
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28655858
score: 5
has text: Use class instead of ID

http://stackoverflow.com/q/28694443
tagged with: php
has title: Undefined index errors from $_POST when accessing through AJAX
has comment: http://stackoverflow.com/comment/45679649
accepted answer: http://stackoverflow.com/a/28694676
answer count: 4
has answer: http://stackoverflow.com/a/28695141
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28694656
has comment: http://stackoverflow.com/comment/45683288
has answer: http://stackoverflow.com/a/28694656
type: Question
has comment: http://stackoverflow.com/comment/45679946
tagged with: javascript
tagged with: jquery
has body: I''m trying to use ajax to show result login from php. But it's not work. It's show error Undefined index like this. Notice: Undefined index: userEmail in C:\xampp\htdocs\controllers\login.controllers.php on line 10 Notice: Undefined index: userPassword in C:\xampp\htdocs\controllers\login.controllers.php on line 10 Login failed Here are my source code: login.views.php Login login.Controller.php <?php include("../models/user.models.php"); include("../models/dataBase.models.php"); $dbc = new dataBase(); $connect = $dbc->connect('localhost','root','','how_database','','hide'); if($_SERVER['REQUEST_METHOD'] == 'POST'){ $user = new user(); if ($user->login($connect,$_POST['userEmail'],$_POST['userPassword']) == true){ echo "Login Successful"; } else { echo "Login failed"; } } $dbc->close($connect); ?> loginAjax.js $("#loginSubmit").click(function(){ if ($("#userEmail").val() == "" || $("userPassword").val() == "") { $("div#msg").html("Please enter your email and password"); } else { $.post( $("#loginForm").attr("action"), $("#loginForm:input").serializeArray(), function(data){ $("div#msg").html(data); } ); } $("#loginForm").submit(function(){ return false; }) }); Update Question: Now i want to add message "Waiting" when after click submit button, hide it when show result messages. What must i do?. Thanks.
tagged with: ajax
score: 0
has answer: http://stackoverflow.com/a/28694676
has comment: http://stackoverflow.com/comment/45680063
has answer: http://stackoverflow.com/a/28694675

http://stackoverflow.com/a/28722012
score: 0
answers question: http://stackoverflow.com/q/28720972
type: Answer
has body: You need to understand that the JavaScript (even if generated dynamically by PHP) is not running the same time that PHP is running. Your workflow will be something like this: PHP script (shop.php) is invoked PHP script generates output, HTML and JS mixed. These are all in server side until the web server sends the output to client (browser) In browser HTML displays and JS runs with starting values that you generated previously by PHP. But in this time, PHP has been finished, not running anymore. PHP variables are not alive anymore. JS interacts with the user in browser, we can say it's running continuously. Triggered by an action (swipe) JS sends an (ajax) request from client side to server side. This request transfers the new value to server side, and invokes another PHP script (do_ajax.php). You do whatever you want with the new value (process it and or store it) in server side. You need to understand that you are in a completely disjunct scope in PHP than in your first PHP script. (distinct in time too) If you want to be sure that, in case of a page reload, the (product ID) value will be the updated value, you need to store it somewhere (user session, key-value store, database, or any persistent) when you get it in server side (so in do_ajax.php) and later load this value in the beginning of your shop.php script ...which will pass it to the JS, and so on. The workflow starts again.

http://stackoverflow.com/a/28603830
has comment: http://stackoverflow.com/comment/45512862
score: 0
has comment: http://stackoverflow.com/comment/45512649
type: Answer
answers question: http://stackoverflow.com/q/28603615
has body: Pulling your code in, I can see that it replaces the current browser URL with the url that you generate (not opening another browser tab or window) - so the browser (chrome in my case) navigates away to the URL that you generate (which is exactly what location.replace is intended to do). Do you mean that you want to load the image into another tag / div / span / image? To load a new div / image (using jquery): $("&lt;div&gt;").appendTo("body").load(newUrl); or $("&lt;img&gt;").attr("src", newUrl).appendTo("body"); or using raw js: var img = document.createElement("img"); img.setAttribute("src", newUrl); (use insertBefore etc to move the element around in the dom) HTH!

http://stackoverflow.com/a/28643622
upvote count: 2
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28642992
type: Answer
has body: Thank you Xyph3r on Opencart forums, your old post re version 1.5 gave me clues to an alternative that works great for Opencart version 2! Link to my clues: http://forum.opencart.com/viewtopic.php?f=20&t=99990 For others, this is what I did, and it can be adapted into a vqmod or ocmod so updates don't overwrite this but here are the basics: Category.tpl: Find the line: <button type="button" onclick="cart.add('<?php echo $product['product_id']; ?>');"> <?php echo $button_cart; ?> Change this to: <input type="text" value="1" size="2" class="item-<?php echo $product['product_id']; ?>" /> <button type="button" value="<?php echo $button_cart; ?>" onclick="addQtyToCart('<?php echo $product['product_id']; ?>');"> <?php echo $button_cart; ?> At the bottom of the file, add the following lines before the echo footer so the end of the file looks like this: <?php echo $footer; ?> Hope this helps others. Note this only puts the quantity field above the existing buttons add to cart, wish list and compare, it won't look pretty so that's all down to you and your style (theme)!

http://stackoverflow.com/comment/45572177
type: Comment
has text: There is no capturing group here.
score: 1
comment on: http://stackoverflow.com/a/28636225
type: AnswerComment

http://stackoverflow.com/q/28598112
has body: Where do i place the common handleError and handleSuccess functions. These are common functions that will be used by every service. where is the best place to put these functions. Should i put theses as global functions and inject them as dependency. (function () { "use strict"; angular.module('myApp.Group') .service('GroupService', function ($http, $q, $location, Environment) { // I transform the error response, unwrapping the application dta from // the API response payload. function handleError(response) { // The API response from the server should be returned in a // nomralized format. However, if the request was not handled by the // server (or what not handles properly - ex. server error), then we // may have to normalize it on our end, as best we can. if (!angular.isObject(response.data) || !response.data.message) { return ($q.reject("An unknown error occurred.")); } // Otherwise, use expected error message. return ($q.reject(response.data.message)); } // I transform the successful response, unwrapping the application data // from the API response payload. function handleSuccess(response) { return (response.data); } this.remove = function (id) { var request = $http({ method: "delete", url: '/group/' + id }); return (request.then(handleSuccess, handleError)); }; }); }());
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
has title: angular function dependency
type: Question
has comment: http://stackoverflow.com/comment/45502541
favorite count: 0
has answer: http://stackoverflow.com/a/28598138
tagged with: angularjs
upvote count: 2
answer count: 1
accepted answer: http://stackoverflow.com/a/28598138
score: 2

http://stackoverflow.com/comment/45514480
type: Comment
type: QuestionComment
has text: Can you also show the output of your `console.log`? I would guess that your JSON is not valid.
score: 0
comment on: http://stackoverflow.com/q/28594788

http://stackoverflow.com/comment/45523833
score: 0
type: Comment
type: QuestionComment
has text: I made alert(PF('errorsPanelWidget')); and I get "Object expected" error :(
comment on: http://stackoverflow.com/q/28609536

http://stackoverflow.com/comment/45737202
has text: They don't just contain postcodes but actual street addresses. The [fiddle](http://jsfiddle.net/45948g02/3/) kinda shows how it works.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28725222
type: AnswerComment

http://stackoverflow.com/q/28723095
has answer: http://stackoverflow.com/a/28723117
type: AnsweredQuestion
score: 0
has title: indexOf("http") matches on http and https
has body: I have the following code, var protocol = jQuery('script[src*="kaltura"]').attr("src"); protocol.toLowerCase().indexOf("http"); The problem is that indexOf is matching on http and https. How can I only get it to match on http?
type: Question
tagged with: indexof
accepted answer: http://stackoverflow.com/a/28723117
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45706369
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28707955
score: 0
has text: Thanks everybody, is working great.

http://stackoverflow.com/comment/45542616
type: AnswerComment
type: Comment
has text: As there is very little information to work with, most certainly the request sent is not matching with the method signature. Most of the time this is the case. Can answer better if OP could shed more light.
comment on: http://stackoverflow.com/a/28619777
score: 0

http://stackoverflow.com/comment/45704506
type: QuestionComment
has text: I mistyped it here, it is only success.
comment on: http://stackoverflow.com/q/28707399
score: 0
type: Comment

http://stackoverflow.com/q/28705615
has body: I have a script that runs to check the amount of times certain options are selected in dropdowns. The page has about a thousand or more dropdowns. When selecting a dropdown, after clicking the option you want, we get about a 5 second freeze before it selects and updates values. when removing the JavaScript it runs instantly and OK. Is there a way to speed up how the JavaScript runs? This is the script below: &lt;script type="text/javascript"&gt; function getSelectedValues(){ var matches1 = $('#group1 select').filter(function(){ return $(this).val() == '1'; }).length; var matches2 = $('#group2 select').filter(function(){ return $(this).val() == '2'; }).length; var matches3 = $('#group3 select').filter(function(){ return $(this).val() == '3'; }).length; var matches4 = $('#group4 select').filter(function(){ return $(this).val() == '4'; }).length; var matches5 = $('#group5 select').filter(function(){ return $(this).val() == '5'; }).length; var matches6 = $('#group6 select').filter(function(){ return $(this).val() == '6'; }).length; var matches7 = $('#group7 select').filter(function(){ return $(this).val() == '7'; }).length; // here's where we just update that new &lt;span&gt; if(matches1 &gt; 1 || matches2 &gt; 1 || matches3 &gt; 1 || matches4 &gt; 1 || matches5 &gt; 1 || matches6 &gt; 1 || matches7 &gt; 1){ $('span#resultgroup1&lt;%=pempidw2%&gt;').css( "color", "red" ); } if(matches1 &lt; 2 &amp;&amp; matches2 &lt; 2 &amp;&amp; matches3 &lt; 2 &amp;&amp; matches4 &lt; 2 &amp;&amp; matches5 &lt; 2 &amp;&amp; matches6 &lt; 2 &amp;&amp; matches7 &lt; 2){ $('span#resultgroup1&lt;%=pempidw2%&gt;').css( "color", "black" ); } } // and here we bind to the change event for the selects // and re-call our above function. $('select').on('change', getSelectedValues); &lt;/script&gt; It is JavaScript to help avoid the user entering the same answer in more than one section. It all works 100% just slow.
has comment: http://stackoverflow.com/comment/45700836
has title: Speeding up JavaScript
has comment: http://stackoverflow.com/comment/45700840
has comment: http://stackoverflow.com/comment/45701239
favorite count: 0
has comment: http://stackoverflow.com/comment/45700755
has comment: http://stackoverflow.com/comment/45700899
has comment: http://stackoverflow.com/comment/45700960
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45701259
score: -3
has comment: http://stackoverflow.com/comment/45701501
has comment: http://stackoverflow.com/comment/45700908
has comment: http://stackoverflow.com/comment/45701330
has answer: http://stackoverflow.com/a/28705794
type: Question
answer count: 1
downvote count: 5
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45701750

http://stackoverflow.com/q/28737859
accepted answer: http://stackoverflow.com/a/28739266
tagged with: angularjs
has title: How to add filepicker to angularjs template
tagged with: filepicker
has answer: http://stackoverflow.com/a/28739266
type: AnsweredQuestion
tagged with: filepicker.io
has body: I have built an app where I need dynamically change templates. &lt;div ng-include="templateUrl"&gt;&lt;/div&gt; I have two templates like addtext.html and addmedia.html. I dynnamically change it using angularjs. But in my addmedia.html template, I have filepicker's pick file widget. &lt;input type="filepicker" data-fp-apikey="..." data-fp-mimetypes="*/*" data-fp-container="modal" onchange="save_url()"&gt; The pick widget does not load in the template. Is there any way to get it to work?
has comment: http://stackoverflow.com/comment/45761325
type: Question
answer count: 1
tagged with: javascript
tagged with: angularjs-ng-include
score: 0
has comment: http://stackoverflow.com/comment/51478213

http://stackoverflow.com/a/32471216
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28652867
answers question: http://stackoverflow.com/q/28652867
has body: I solved this problem by using a custom "insertTpl" for the inserted mentioned names: var at_config = { at: '@', data: mentionablesList, displayTpl: '&lt;li&gt;&lt;span&gt;${name}&lt;/span&gt;&lt;/li&gt;', insertTpl: '&lt;a href="${url}" data-type="mentionable" data-id="${id}" data-name="${name}"&gt;${name}&lt;/a&gt;' }; $(that.document.getBody().$) .atwho('setIframe', that.window.getFrame().$) .atwho(at_config); and then use jQuery to parse the input value and extract all mentioned names: var commentHtml = CKEDITOR.instances['new-comment'].getData(); var comment = $('&lt;div/&gt;').html(commentHtml).contents(); comment.find('a[data-type="Employee"]').each(function(index, element) { // do whatever you need with $(element) object }); Note: I used CKEditor in my case -- a comment box that allows users to mention other users' names while they are writing a comment. Once the comment is posted, all mentioned names will be added to a list of followers of the post that the comment belongs to.
upvote count: 3
type: AcceptedAnswer
type: Answer
score: 3

http://stackoverflow.com/a/28720591
has comment: http://stackoverflow.com/comment/45793205
type: Answer
has comment: http://stackoverflow.com/comment/45728941
downvote count: 0
has comment: http://stackoverflow.com/comment/45729882
score: 5
has body: Maybe it's time to start giving ES6 answers too. In ECMAScript6 you can use expressions as object keys: var array = ['a', 'b', 'c']; var obj = { [array[1]]: 'good' } In fact, this syntax is already supported in Firefox. Currently the only way to use variable is to use bracket notation as described in other answer.
upvote count: 5
answers question: http://stackoverflow.com/q/28720507

http://stackoverflow.com/q/28749656
has comment: http://stackoverflow.com/comment/45781290
tagged with: string
favorite count: 0
has comment: http://stackoverflow.com/comment/45781259
upvote count: 2
linked to: http://stackoverflow.com/q/13027854
has comment: http://stackoverflow.com/comment/45781380
accepted answer: http://stackoverflow.com/a/28749750
has comment: http://stackoverflow.com/comment/45781233
answer count: 1
has comment: http://stackoverflow.com/comment/45781366
has title: Regex for domain verification with Javascript
downvote count: 1
tagged with: javascript
has body: I want to create a regular expression to verify domain names. I've searched a lot on StackOverflow and I found this solution, which ignores the http and folders and checks only for domain. QUOTE var pattern = new RegExp('^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', 'i'); But since I'm not a wizard and I've long ago given up on trying to understand Regex, I placed it on Regex101 which shows me that 'localhost' is not a match. The problem is when I execute the following code (jsFiddle here): var origin = 'localhost'; var pattern = new RegExp('^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', 'i'); console.log(origin, pattern.test(origin)); It returns true (localhost should not be matched). Why? Edit: For some reason, people thought I WANTED localhost to be recognized as a domain. BUT IT'S THE OPPOSITE! If you read the question, you'll see that it's returning true although it should return false.
has answer: http://stackoverflow.com/a/28749750
has comment: http://stackoverflow.com/comment/45781198
has comment: http://stackoverflow.com/comment/45781340
has comment: http://stackoverflow.com/comment/45783126
type: Question
type: AnsweredQuestion
tagged with: regex
has comment: http://stackoverflow.com/comment/45781257
score: 1

http://stackoverflow.com/a/28700522
answers question: http://stackoverflow.com/q/28698193
type: Answer
has comment: http://stackoverflow.com/comment/61959776
score: 0
has body: You can also reuse your material instead of making a new instance all the time: var geometrySphere = new THREE.SphereGeometry( 5, 32, 32 ); var billeMaterial = new THREE.MeshBasicMaterial( {color: 0xffff00} ); var bille = function(x,z){ this.bille = new THREE.Mesh( geometrySphere, billeMaterial ); this.bille.position.x = (x-15.5)*100; this.bille.position.y = 100; this.bille.position.z = (z-15.5)*100; scene.add(this.bille); } Reusing materials has good influence on performance. How do you duplicate your meshes/objects?

http://stackoverflow.com/comment/45595039
score: 0
type: Comment
type: QuestionComment
has text: how can I set values woth ng models on gauge on the load?
comment on: http://stackoverflow.com/q/28647478

http://stackoverflow.com/q/28664899
upvote count: 4
tagged with: reactjs
answer count: 1
downvote count: 0
has body: I'm creating a custom input tag, PhoneInput. It has 3 inputs inside, so I need to parse them, and concat back to string. I want to pass in onChange callback SyntheticEvent, like React does. So I need to create hidden input: &lt;input onChange={this.props.onChange} value={this.state.value}/&gt; But when I change state, event didn't triggers. How to do it right? http://jsbin.com/bahuyuriqa/1 - here is example.
favorite count: 0
has title: How to trigger native event in React?
score: 4
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45625015
has answer: http://stackoverflow.com/a/28682472
has comment: http://stackoverflow.com/comment/45631712
type: Question
tagged with: javascript

http://stackoverflow.com/q/28722640
score: 2
type: AnsweredQuestion
upvote count: 2
tagged with: http://stackoverflow.com/tag/json
has body: So i have JSON object that i am reading through which looks like {data:[Object,Object.....]} Currently i am using the getJSON method to extract that data. Say there are around 1600 sets of Objects in this array. Currently when i load the page it takes a few seconds as it is parsing all those objects. How would i go about with the logic of presenting the first hundred objects and then the next hundred and so on. Without any lags Any feedback would be appreciated $.getJSON('products.json', function (pdata) { for(var i =0; i &lt; pdata.data.length; i++) { getInformation(pdata.data[i]); } function getInformation(obj){ console.log(obj); var $ul = $('&lt;ul&gt;').addClass('view').appendTo('body'); for (var i = 0; i &lt; 4; i++) { var $list = $('&lt;li&gt;').appendTo($ul); var $image = $('&lt;img&gt;').appendTo($list); var $content = $('&lt;div&gt;').appendTo($list); var $productName = $('&lt;div&gt;').appendTo($content); var $price = $('&lt;div&gt;').appendTo($content); $image.attr({src: obj.imageUrl, width: '200px', height: '200px' }); $content.addClass('content'); $productName.addClass('productName'); $price.addClass('price'); $productName.html(obj.fullName); $price.html('Price: '+ obj.price); } }
type: Question
has title: How would i implement an infinite scroll in my DOM
tagged with: javascript
answer count: 2
possible better answer: http://stackoverflow.com/a/28722991
accepted answer: http://stackoverflow.com/a/28723128
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28722991
has answer: http://stackoverflow.com/a/28723128

http://stackoverflow.com/a/28681391
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/28681303
has comment: http://stackoverflow.com/comment/45655600
has comment: http://stackoverflow.com/comment/45656625
has comment: http://stackoverflow.com/comment/45655644
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28681303
has comment: http://stackoverflow.com/comment/45655742
type: Answer
has body: Use brackets notation: var o = new obj(); o.prop1 = "I'm the value"; var s = "prop1"; console.log(o[s]); // "I'm the value" I think this is how this relates to your code: ["prop1","prop2","prop3"].forEach(function(prop) { // **A** $("."+prop).unbind().blur(function(){ var id = $(this).siblings(".objID").html(); if(id &gt;= 0) { objects[id][prop] = $(this).text()); // **B** } }); }); (B) is the place where we actually use the name, but note the (A) change to so that we get a value that won't change. You can't just use // Wrong unless we also change the loop objects[id][itemsIWantToBind[j]] = $(this).text()); because j will be be beyond the end of the array when the event occurs. forEach is an ES5 feature that can readily be shimmed for old browsers. Or you can use jQuery's $.each instead: $.each(["prop1","prop2","prop3"], function(i, prop) { // **A** $("."+prop).unbind().blur(function(){ var id = $(this).siblings(".objID").html(); if(id &gt;= 0) { objects[id][prop] = $(this).text()); // **B** } }); });

http://stackoverflow.com/a/28722820
type: Answer
has comment: http://stackoverflow.com/comment/45743859
has comment: http://stackoverflow.com/comment/45743371
has body: That usage of $.toggle() is deprecated: version deprecated: 1.8, removed: 1.9 I'm guessing you're using version 1.9 or later, so it doesn't exist. $.toggle() is now only used for animation show/hide (can't link because of new user restrictions). Instead of binding alternating click events to the object, it's used to show/hide the selected element. Building on winhowes's answer, you can eliminate the little "hop" by having the details display under the button: http://jsfiddle.net/a6s1t2d4/ I also changed the two function calls ($.parent() and $.find()) to one ($.nextAll(); not just $.next() because the next element is now a &lt;br /&gt;).
has comment: http://stackoverflow.com/comment/45747153
score: 0
answers question: http://stackoverflow.com/q/28720511
has comment: http://stackoverflow.com/comment/45743564
has comment: http://stackoverflow.com/comment/45795351
has comment: http://stackoverflow.com/comment/45742266

http://stackoverflow.com/a/30046523
score: 0
has body: I had no problem to run your code. I had to define the variable new_app. In the message browser I got the channel variable with the value org.mozilla.javascript.NativeArray@186a7a9. If you use native java arrays, you can see the values displayed correctly. Concerning your problem: Check for syntax errors in your code, becasuse your put-statement is correct. You can upgrade to mirth connect 3.2, there is a javascript IDE implemented.
answers question: http://stackoverflow.com/q/28730827
type: Answer

http://stackoverflow.com/a/28741402
answers question: http://stackoverflow.com/q/28741363
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/45766338
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28741363
downvote count: 0
has body: Try this: onsubmit="return validateForm();" instead of onsubmit="validateForm();" DEMO

http://stackoverflow.com/comment/45761275
score: 0
comment on: http://stackoverflow.com/a/28738147
type: AnswerComment
has text: This will generate unique and incremental id as you are doing `$i++` in first `td`, so you will get ids like firstBtn1, firstBtn2, firstBtn3....
type: Comment

http://stackoverflow.com/comment/45565917
score: 0
type: QuestionComment
has text: "For example if you type the ID of a character I am currently highlighting it." Correct me if I'm wrong, but that would require your character to be a global variable, otherwise it will likely get garbage collected when the scope closes. Even if you stop execution inside the scope, highlighting a character would require a `highlight(_id)` function as the language doesn't know what highlighting means natively.
type: Comment
comment on: http://stackoverflow.com/q/28632619

http://stackoverflow.com/comment/45655897
comment on: http://stackoverflow.com/q/28681461
has text: The css is also loaded dinamically
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28703665
answers question: http://stackoverflow.com/q/28703433
upvote count: 2
has body: You probably want checked = inputs[i].value. inputs[i] is the DOM Element, when cast to a string it becomes "[object HTMLInputElement]" (in case of an input element).
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/a/28656511
has body: When you have your code like this if (exp === 0) { letsReturnOne(); } The value returned from letsReturnOne will be returned to solveExponent, but since the value is ignored, solveExponent continue to execute the next statements in it and it would call solveExponent with exp as -1. From then on, the exp will always be negative and it will never be able to reach 0. That is why your recursion never comes to an end. Instead, return the value returned by letsReturnOne() like this if (exp === 0) { return letsReturnOne(); } Since the value returned by letsReturnOne is returned immediately, solveExponent will not execute the rest of the statements in it, when exp is equal to 0. The actual recursive way in which the function evaluates your inputs is like this, solveExponent(3, 3) 3 * solveExponent(3, 2) 3 * (3 * solveExponent(3, 1)) 3 * (3 * (3 * solveExponent(3, 0))) At this point, exp is 0, so we return 1, this is called the base case of your recursion. 3 * (3 * (3 * 1)) 3 * (3 * 3) 3 * 9 27
has comment: http://stackoverflow.com/comment/45621029
score: 5
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28656474
type: Answer
answers question: http://stackoverflow.com/q/28656474
upvote count: 5

http://stackoverflow.com/a/28691692
type: Answer
score: 3
upvote count: 3
has body: It's a convention. Simple as that. In this case square brackets denote optional arguments, meaning only the argument value is really required.
answers question: http://stackoverflow.com/q/28691651
downvote count: 0

http://stackoverflow.com/comment/45669511
score: 0
comment on: http://stackoverflow.com/a/28688594
type: AnswerComment
type: Comment
has text: It is in "app.config". Like below. app.config(['$compileProvider', function ($compileProvider) { // disable debug info $compileProvider.debugInfoEnabled(false); }]);

http://stackoverflow.com/comment/45726034
comment on: http://stackoverflow.com/a/28708825
score: 0
type: Comment
has text: @Asad The second quote says that negative numbers are less than zero. And both `+0` or `- 0` correspond to the math value zero, which is not less than zero. So they can't be negative. Are you saying that implementations can know if a `-0` in memory comes from a literal `-0` or a negative number very close to zero? Wouldn't that additional information need to be stored somewhere, and then require more than 64 bits?
type: AnswerComment

http://stackoverflow.com/a/28640804
has comment: http://stackoverflow.com/comment/138143612
has body: If you enable strict mode, JavaScript will throw an exception if you define an object literal with duplicate keys; "use strict"; try { var obj = {"name":"n","name":"v"}; console.log(obj); } catch (e) { console.log(e); } EDIT: This only works in ECMAScript 5, not ECMAScript 6. According to "Understanding ECMAScript 6." I haven't tried it yet.
type: Answer
score: -2
downvote count: 3
upvote count: 1
answers question: http://stackoverflow.com/q/28640800

http://stackoverflow.com/a/28712760
has comment: http://stackoverflow.com/comment/45715309
has comment: http://stackoverflow.com/comment/45714749
has body: Use this $('.list li').eq('4').after(' My script ads here '); Add url like this $('.list li').eq('4').after(" "); Instead of $('.list li:nth-child(4)').after(' My script ads here ');
type: Answer
has comment: http://stackoverflow.com/comment/45715133
score: 0
answers question: http://stackoverflow.com/q/28712500
accepted answer of: http://stackoverflow.com/q/28712500
has comment: http://stackoverflow.com/comment/45713685
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45714955

http://stackoverflow.com/q/28737792
has answer: http://stackoverflow.com/a/28737978
has comment: http://stackoverflow.com/comment/45759722
type: Question
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/28738390
has comment: http://stackoverflow.com/comment/45759855
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/28737978
possible better answer: http://stackoverflow.com/a/28738390
has title: How do I turn a json array into a js array in AngularJs?
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45759605
has body: I'm starting out in Angular and front end development and can't seem to solve the following. I have reassigned one variable to another: $scope.testarray = $scope.todos; but when using the Angular bindings, only the 'todos' will get displayed. var App = angular.module('App', []); App.controller('TodoCtrl', function($scope, $http) { $http.get('todos.json') .then(function(res){ $scope.todos = res.data; }); $scope.testarray = $scope.todos; }); and html: Todos $http {{todo.text}} - {{todo.done}} this doesn't display: {{testarray}} but this does dislay: {{todos}}
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/45734137
score: 0
has text: Thank you for support. But i have 13 canvas but when i run source code , 4 tag canvas hidden. I want display 13 tag canvas then 2 tag div. Help me!
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28723159

http://stackoverflow.com/q/28624816
favorite count: 0
tagged with: php
upvote count: 4
has body: How do I convert PHP HEREDOC to JavaScript variable. I have PHP variable with some special symbols. php: $text = &lt;&lt;&lt;EOD line 1 line 2 line 3 EOD; to JavaScript: var text = '&lt;?php echo $text ?&gt;';
has answer: http://stackoverflow.com/a/28624873
accepted answer: http://stackoverflow.com/a/28624873
type: AnsweredQuestion
downvote count: 0
tagged with: heredoc
type: Question
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/45550720
has comment: http://stackoverflow.com/comment/45550689
answer count: 1
tagged with: variables
has title: how to convert php heredoc to javascript variable?

http://stackoverflow.com/q/28693968
has comment: http://stackoverflow.com/comment/45684813
type: Question
tagged with: javascript
score: 0
has title: ChartJS 'random' width
has comment: http://stackoverflow.com/comment/45681999
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45692264
answer count: 0
tagged with: chart.js
tagged with: chartnew.js
has body: im using chartJS to display a bunch of measurements. It seems like the Chart itself is only using a fraction of the canvas. I've found out that it depends on how much values I try to display. On different amounts of datapoints it extends in different ways, but more values doesn't mean it is using more space. HTML: &lt;canvas id="myChart" width="1000" height="400"&gt;&lt;/canvas&gt; JS: document.addEventListener("DOMContentLoaded",function(event){ var ctx = document.getElementById("myChart").getContext("2d"); var myLineChart = new Chart(ctx).Line({ labels: ["", "", "", "", "", ""], datasets: [{ data: [5, 8, 6, 1, 2, 9], // Dummy values }] }, { scaleOverride : true, scaleStartValue : 0, scaleSteps : 10, scaleStepWidth : 5, pointDot : false, scaleXGridLinesStep : 9999 }); }); I've tried some fixes from the internet: maintainAspectRatio: false responsive: true doesnt work for me ;( UPDATE: It seems like this error only occurs only when I use ChartNew.js. I've also recreated my problem in a JSFiddle

http://stackoverflow.com/comment/45583279
score: 0
type: Comment
has text: If it worked out you may mark the answer as accepted by clicking on tick mark on top-left of my answer.
comment on: http://stackoverflow.com/a/28610504
type: AnswerComment

http://stackoverflow.com/comment/45528046
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28612188
has text: `swapNode` is a "helpful" IE customisation - it simply doesn't exist in other browsers. [This question](http://stackoverflow.com/questions/2943140/how-to-swap-html-elements-in-javascript) may provide an answer.
score: 2

http://stackoverflow.com/comment/45667264
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28687274
has text: specifying the url dosent work either i put http://axesupermart.com/?page=condition&q= into the url parameter and got the same thing
score: 0

http://stackoverflow.com/a/28658120
has body: Their is a CSS only solution section.left { background: url(https://dl.dropboxusercontent.com/u/72385383/left-col-bg.jpg) no-repeat center center; -webkit-background-size: 100%; -moz-background-size: 100%; -o-background-size: 100%; background-size: 100%; -webkit-transition: all 1s ease-in-out; -moz-transition: all 1s ease-in-out; -o-transition: all 1s ease-in-out; transition: all 1s ease-in-out; } section.left:hover { -webkit-background-size: 120%; -moz-background-size: 120%; -o-background-size: 120%; background-size: 120%;} Working Fiddle EDIT jQuery Solution $(document).ready(function() { $(".col").css({"background-size":"100%"}) $('.col').mouseenter(function(e) { $(this).animate({ "background-size":"120%" }, 3000 ); }).mouseleave(function(e) { $(this).animate({ "background-size":"100%" }, 3000 ); }); }); Working Fiddle
score: 0
has comment: http://stackoverflow.com/comment/45612243
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/78125513
has comment: http://stackoverflow.com/comment/45612221
type: Answer
has comment: http://stackoverflow.com/comment/45612304
has comment: http://stackoverflow.com/comment/45612267
has comment: http://stackoverflow.com/comment/45612268
accepted answer of: http://stackoverflow.com/q/28658057
has comment: http://stackoverflow.com/comment/45612225
answers question: http://stackoverflow.com/q/28658057

http://stackoverflow.com/comment/45774343
has text: Given that you're running .NET and likely loading content in zone other than Internet, it's quite likely older IE is running in earlier compat mode. Also, @zeroflagL is correct, IE9 does not support CORS; however, there are hacks mentioned in the wild. Consider https://samuellam.wordpress.com/2013/08/03/ie-89-cors-support-in-angular-js/ for example, which looks like a useful approach.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28740949

http://stackoverflow.com/comment/45611623
score: 0
type: AnswerComment
has text: I am already using routing for my views, is it possible to use a routing method inside a view?
type: Comment
comment on: http://stackoverflow.com/a/28657873

http://stackoverflow.com/q/28638104
has comment: http://stackoverflow.com/comment/45575879
has comment: http://stackoverflow.com/comment/45576056
type: Question
has comment: http://stackoverflow.com/comment/45575891
has comment: http://stackoverflow.com/comment/45575965
has answer: http://stackoverflow.com/a/28638352
has title: Javascript grab a group of class names and add them as IDs
score: -2
tagged with: javascript
downvote count: 2
has comment: http://stackoverflow.com/comment/45575832
answer count: 1
has body: Is there a way with Javascript to store all the class names inside #links into an array and use a loop to assign each an ID of that class? Below would be before some link some link some link some link after javascript some link some link some link some link
favorite count: 0
has comment: http://stackoverflow.com/comment/45575895
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28638352
upvote count: 0
has comment: http://stackoverflow.com/comment/45575805
has comment: http://stackoverflow.com/comment/45575881

http://stackoverflow.com/comment/45605523
comment on: http://stackoverflow.com/a/28653947
type: AnswerComment
score: 0
type: Comment
has text: Tables are elastic by nature, they will stretch to fit whatever content you place in them. You can provide a set dimensions for the image though.

http://stackoverflow.com/a/28632196
type: Answer
accepted answer of: http://stackoverflow.com/q/28631752
has body: You need to create a new array as a clone of the first, currently it looks like you are saving a reference to it. try this: var clone = myArray.slice(0);
answers question: http://stackoverflow.com/q/28631752
score: 0
type: AcceptedAnswer

http://stackoverflow.com/a/28694837
has comment: http://stackoverflow.com/comment/45722785
has body: I would suggest what dropbox did in their website. (after clicking in "Sign in"). They keep the scrollbar but disabled it. This way, the page won't "jump" while removing the scrollbar and it would look much better. When removing the scrollbar, the centered elements of the site have to recalculate their position and they get moved causing a "flicker" or a "jump" in the website which is far from ideal as you can see in this example in comparison with this other one in which the scroll bar stills visible. If you take a look at their approach you will notice they add a class to the body element for it. You can do it in this way: $('.demo').click(function(){ $('html').addClass('noscroll'); }); And the css for it: html.noscroll{ position: fixed; width: 100%; top:0; left: 0; height: 100%; overflow-y: scroll !important; z-index: 10; } Demo online
has comment: http://stackoverflow.com/comment/45723230
has comment: http://stackoverflow.com/comment/45725107
has comment: http://stackoverflow.com/comment/53987244
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28691592
upvote count: 2
answers question: http://stackoverflow.com/q/28691592
type: Answer
score: 2

http://stackoverflow.com/comment/45593502
type: AnswerComment
has text: exactly. that will make the update only run when the ajax call is made.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28647935

http://stackoverflow.com/a/28731503
has body: You can use minRange instead of max, as this will give the y-axis a small span when all values are 0, but adjust accordingly when larger values appear. For example: yAxis:{ min: 0, minRange: 2 } See this JSFiddle demonstration of how it adapts to updated points with larger values.
downvote count: 0
score: 2
upvote count: 2
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28728518
type: Answer
accepted answer of: http://stackoverflow.com/q/28728518

http://stackoverflow.com/comment/45535113
comment on: http://stackoverflow.com/q/28615525
type: Comment
has text: So, what's stopping you from doing so?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45684450
type: Comment
type: QuestionComment
has text: @ksg91 you are right, I have to pass parameter as an object not an array
comment on: http://stackoverflow.com/q/28695348
score: 0

http://stackoverflow.com/comment/45536587
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28616527
has text: Pretty sure he meant remove it via a "close" action on the div.
score: 0

http://stackoverflow.com/comment/45494522
has text: you can use CSS; dataTables is pretty generous with the classes these days.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28593854

http://stackoverflow.com/comment/45544053
has text: Are you always dealing with polynomials of a similar type?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28620667
score: 0

http://stackoverflow.com/q/28712601
possible better answer: http://stackoverflow.com/a/28712991
has comment: http://stackoverflow.com/comment/45713365
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28712991
has body: I am using partial view to display a view inside another and the partial view has the drodown so how to get the value of that dropdown actually i want to display another dropdown based on the value of the first dropdown here is my code in detail: partial view: @using (Html.BeginForm()) { @Html.ValidationSummary(true) @Html.LabelFor(model => model.CompanyID , new {@class="lbldis"}) @Html.DropDownListFor(Model => Model.CompanyID, new SelectList(ViewBag.CompanyList as System.Collections.IEnumerable, "_CompanyID", "Company"), "- Select -",new { @class = "txtbox",id="ddln" }) @Html.ValidationMessageFor(model => model.CompanyID) @Html.DropDownListFor(Model => Model.ClientID, new SelectList(ViewBag.ClientList as System.Collections.IEnumerable, "_ClientID", "Company"), "- Select -",new { @class = "txtbox" }) @Html.ValidationMessageFor(model => model.ClientID) } and the view where i am calling this partial view:and the name of that view is Index: @Html.Partial("~/Views/PartialViews/_company.cshtml") All the dropdowns are working fine and getting the values and all but only problem is with the javascript. Please help me on where to write the javascript i.e in partial view or in Index where I am calling my partial view and how to to display another dropdown based on the value of the first one. What I have tried so far is below:
upvote count: 0
has comment: http://stackoverflow.com/comment/45713423
has title: How to get selected value of dropdown when using partial view in mvc?
tagged with: javascript
tagged with: jquery
score: -1
tagged with: partial-views
answer count: 2
has comment: http://stackoverflow.com/comment/45714810
favorite count: 0
has comment: http://stackoverflow.com/comment/45713525
tagged with: cascadingdropdown
has answer: http://stackoverflow.com/a/28713223
has comment: http://stackoverflow.com/comment/45713718
accepted answer: http://stackoverflow.com/a/28713223
tagged with: asp.net-mvc-4
type: AnsweredQuestion

http://stackoverflow.com/q/28731423
possible better answer: http://stackoverflow.com/a/28731791
type: Question
has answer: http://stackoverflow.com/a/28731789
accepted answer: http://stackoverflow.com/a/28731789
tagged with: javascript
answer count: 2
tagged with: canvas
upvote count: 1
has body: I have a canvas object from which i want to get the color of a position with canvas.getImageData. When i paint a gradient on it and try to get the color from point (0,0) chrome behaves as expected and returns the color value 255,255,255 whereas IE returns 254,253,253. I have here a plunker which shows what i mean : http://plnkr.co/edit/BWSn2J2N2A6poaH4WR6a?p=preview You can just execute this in IE and in Chrome and you'll see the difference. I use the IE v11 and the Chrome v40. Maybe the error is during my creation of the canvas. var RepaintGradient = function(gradient) { _gradientContext.fillStyle = 'rgb(255,0,0)'; _gradientContext.fillRect(0,0,width,height); var gradientWTT = _gradientContext.createLinearGradient(0, 0, width, 0); gradientWTT.addColorStop(0, "white"); gradientWTT.addColorStop(1, gradient); _gradientContext.fillStyle = gradientWTT; _gradientContext.fillRect(0, 0, width, height); var gradientBTT = _gradientContext.createLinearGradient(0, width, 0, 0); gradientBTT.addColorStop(0, "black"); gradientBTT.addColorStop(1, "transparent"); _gradientContext.fillStyle = gradientBTT; _gradientContext.fillRect(0, 0, width, height); var color = _gradientContext.getImageData(0, 0, 1, 1).data; alert(color[0]+' '+color[1]+' '+color[2]); }; Is this a normal behavior and IE and Chrome have this difference or is it something that i missed during the creation of the canvas ?
has answer: http://stackoverflow.com/a/28731791
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/16835070
type: AnsweredQuestion
has title: Javascript canvas.getImageData IE vs Chrome
downvote count: 0
score: 1

http://stackoverflow.com/comment/45602523
has text: Did you reload the page after opening it?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28652595
score: 0

http://stackoverflow.com/q/28626044
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28626147
type: Question
tagged with: hover
possible better answer: http://stackoverflow.com/a/28626175
has answer: http://stackoverflow.com/a/28626147
has body: The things here are like this (long story but I have a point) I have a menu with buttons that look like this: ******* ***B*** ******* An when you hover it expands ************* ***Button**** ************* Now, when the screen is for mobile, no more hexagons, they stack up like normal buttons, with the complete text showing instead of having to hover to read. my markup is as follows: Servicios Contacto Faq Blog And I'm using jQuery to show and hide the span tags on hover and css to handle the width of the anchor tag. $('a.btn').hover(function() { $(this).children('span').fadeIn(500); $('img').css('opacity', 0.5); }, function() { $(this).children('span').fadeOut(200); $('img').css('opacity', 1); }); so fade in on hover fade out when not hover. BUT I put this javascript on an IF conditional, if the screen resizes to mobile (i'm using 500px and below as mobile) this code shouldn't run, here is the if conditional: $(window).resize(function() { if ($(window).width() < '501') { $('a.btn').hover(function() { $(this).children('span'); $('img').css('opacity', 0.5); }, function() { $(this).children('span'); $('img').css('opacity', 1); }); }; if ($(window).width() > '500') { $('a.btn').hover(function() { console.log($(window).width()); $(this).children('span').fadeIn(500); $('img').css('opacity', 0.5); }, function() { //this part of the code runs even if the window is below 500 $(this).children('span').fadeOut(200); $('img').css('opacity', 1); }); }; }); It's freaking me out that the conditional doesn't met and the code still runs. Tha problem with this is that when the buttons are normal and you hover over them after the resize, the text fades out Other thing: when you load the page and the screen is below 500 it works as it should, no fading out. The problem arises when you resize above 500 and resize back down below 500, then the fadeout happens again.
has answer: http://stackoverflow.com/a/28626175
has comment: http://stackoverflow.com/comment/45552935
has title: jQuery - Code running even when condition isn't met
score: 0
answer count: 3
upvote count: 1
downvote count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28626257
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/45681982
type: Comment
type: QuestionComment
has text: So the problem is that you have `260409600000`, but you want `Date(260409600000)` string?
comment on: http://stackoverflow.com/q/28695693
score: 0

http://stackoverflow.com/a/28605144
score: 1
answers question: http://stackoverflow.com/q/28605044
type: Answer
upvote count: 1
has body: You have to initialize total variable before loop started and you can perform your task. total = 0; $.each(data, function(i, result) { total = total + result.price; }); alert(total); Demo
downvote count: 0

http://stackoverflow.com/comment/134052318
score: 0
type: AnswerComment
has text: After a bit of massage, this even works in QML! (For those of you who know what that is)
comment on: http://stackoverflow.com/a/47105238
type: Comment

http://stackoverflow.com/comment/61241480
comment on: http://stackoverflow.com/q/28718641
score: 0
type: QuestionComment
has text: See also http://stackoverflow.com/q/27612713/1460043
type: Comment

kendo-asp.net-mvc
tags question: http://stackoverflow.com/q/28733244
tag name: kendo-asp.net-mvc
type: Tag

http://stackoverflow.com/a/28648143
accepted answer of: http://stackoverflow.com/q/28647465
type: Answer
has body: The problem of your variable definitions has been already explained. Another problem - When setting click event inside loop, the counter and i variables are overridden each iteration, so that each button will return variable which was set at the end of the loop. F.ex: If the loop is: i=0; i&lt;100; i++ , then at the end of the loop i for each button will be always equal to 100. And counter will be always equal to the last set counter +1, because these variables loses their uniqueness outside the loop. You have to store the i variable somewhere, so that it won't get updated while loop lasts, and is always unique for each button. I'd store the i in a data-id attribute of the button and set click event on class selector, outside for loop. Also, since the data is a simple string, you can use .text() instead of .html(). HTML: &lt;button class="counter" id="i0"&gt;&lt;/button&gt; &lt;button class="counter" id="i1"&gt;&lt;/button&gt; ... Script: // no need for this: //var i = 0; for(/* i is defined here: */ var i=0; i&lt;10; i++){ var c = localStorage.getItem('counter'+ i +'item'); // add data-id to the element: $("#i"+i).text(c == null ? 'Zero' : c).data('id',i); } // listen for click event on 'counter' class: $(document).on("click",".counter", function(){ // parse number from text of the button: var c = $(this).text(parseInt($(this).text())+1 || 1).text(); // grab the id from data-id attribute: localStorage.setItem('counter'+ $(this).data('id') +'item', c); }); DEMO
score: 3
upvote count: 3
downvote count: 0
answers question: http://stackoverflow.com/q/28647465
type: AcceptedAnswer

http://stackoverflow.com/comment/45531915
has text: I am not sure what the big deal with one line is. One line does not mean better. Also there is a better way with one line that does not require not()
type: AnswerComment
score: 1
type: Comment
comment on: http://stackoverflow.com/a/28614077

http://stackoverflow.com/a/28747986
has comment: http://stackoverflow.com/comment/45778313
answers question: http://stackoverflow.com/q/28746979
type: Answer
has body: Easiest workaround that works with any browser - just load it in an iframe instead of a div: OR set src with JS: document.getElementById('loadHere').src = "something.html";
score: 0
has comment: http://stackoverflow.com/comment/45779469

http://stackoverflow.com/a/31506932
has body: This is what worked for me. I disabled the textShadow inside the series series: [ { name:'Serie1', data:[2027.15, 2027.15, 0.0], dataLabels:{ enabled: true, style: {textShadow: 'none' } } ]
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28700678
score: 2
upvote count: 2

http://stackoverflow.com/comment/45709472
has text: Code to add commas is here: http://stackoverflow.com/questions/1068284/format-numbers-in-javascript/7125034#7125034
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28710243
score: 0

http://stackoverflow.com/a/28656592
type: Answer
has comment: http://stackoverflow.com/comment/45609630
answers question: http://stackoverflow.com/q/28656528
has body: what about using the className to hide the element? something like : var cssClasses = "likeButConAct "; if ( likeCount &lt; 1 ) { cssClasses += "hidden"; } ... return &lt;div className=cssClasses&gt;&lt;div ... EDIT var content; var tmpLikeCount; var likeCounterComponent; if(likeCount &gt; 0){ likeCounterComponent = &lt;div className="likeCount"&gt;{likeCount}&lt;/div&gt; } if(like == 1){ cssClasses = "likeButConAct" } else{ cssClasses = "likeButCon"; } return ( &lt;div className=cssClasses&gt; &lt;div className="likeB"&gt;&amp;nbsp;&lt;/div&gt; { likeCounterComponent } &lt;/div&gt;); You can add the likeCounter only if there are likes. If there are likes the likeCounterComponent contains the JSX code to render the likes counter, otherwise is undefined and therefore nothing will be rendered. I haven't tried to run the code, but I guess you got the idea to solve this problem. :D
score: 0
has comment: http://stackoverflow.com/comment/45609867

http://stackoverflow.com/q/28704727
has body: so I'm trying to append image src to a div when you click on it...so far I've written it like this and it doesn't seem to work, no error reports, no idea what's going on. The image is of a class .card (there's 15 of them), and I want to append to the div only if the border is gray, you click once to select the card (changing the border) and then click again to paste the selected card onto the div...the div is called .picks. I just want to display the image src as text on my page. thanks for the help $(".card").click(function() { console.log("click"); if($(this).css('border')==="4px solid gray") { var cardname = $(this).attr('src'); $(".picks").append(cardname); if(pick&lt;15) { pick++; } else { booster++; pick=1; } } else { $(this).css('border', '4px solid gray'); } });
tagged with: javascript
tagged with: jquery
tagged with: image
has comment: http://stackoverflow.com/comment/45699103
has comment: http://stackoverflow.com/comment/45699191
has comment: http://stackoverflow.com/comment/45699416
favorite count: 0
has title: .append image src as text to a div
possible better answer: http://stackoverflow.com/a/28705044
has comment: http://stackoverflow.com/comment/45699427
has answer: http://stackoverflow.com/a/28705031
accepted answer: http://stackoverflow.com/a/28705031
type: AnsweredQuestion
score: 1
upvote count: 1
tagged with: src
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28705044
downvote count: 0

http://stackoverflow.com/q/28672531
tagged with: knockout.js
type: Question
has comment: http://stackoverflow.com/comment/45641097
has body: I am trying to get knockoutjs on my machine but I don't understand why it doesn't work. Any help would be appreciated. What do I do with the knockout-3.3.0.js file that is given on the download? Please take me step by step on how to execute say http://learn.knockoutjs.com/#/?tutorial=collections tutorial on my machine? Thanks
upvote count: 0
tagged with: javascript
has title: How to run knockoutjs locally?
has answer: http://stackoverflow.com/a/28673051
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
score: -3
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28673051
downvote count: 3

http://stackoverflow.com/q/28678468
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45650770
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45650624
has body: I have been trying to modify a code which scrolls the images horizontally. I want to scroll it vertically. I don't know JQuery at all. After trying for hours I couldn't find any way to sort this thing out. Can anyone help me out in this regard. Heres the whole code. $(function() { $(window).load(function() { var $gal = $("#propertyThumbnails"), galW = $gal.outerWidth(true), galSW = $gal[0].scrollWidth, wDiff = (galSW / galW) - 1, // widths difference ratio mPadd = 60, // Mousemove Padding damp = 20, // Mousemove response softness mX = 0, // Real mouse position mX2 = 0, // Modified mouse position posX = 0, mmAA = galW - (mPadd * 2), // The mousemove available area mmAAr = (galW / mmAA); // get available mousemove fidderence ratio $gal.mousemove(function(e) { mX = e.pageX - $(this).parent().offset().left - this.offsetLeft; mX2 = Math.min(Math.max(0, mX - mPadd), mmAA) * mmAAr; }); setInterval(function() { posX += (mX2 - posX) / damp; // zeno's paradox equation "catching delay" $gal.scrollLeft(posX * wDiff); }, 10); }); }); #parent { position: relative; margin: 0 auto; width: 100%; background: #ddd; } #propertyThumbnails { position: relative; overflow: hidden; background: #444; width: 100%; white-space: nowrap; } #propertyThumbnails img { vertical-align: middle; display: inline; margin-left: -4px; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div id="parent"&gt; &lt;div id="propertyThumbnails"&gt; &lt;img src="http://placehold.it/1000x100" /&gt; &lt;/div&gt; &lt;/div&gt; Heres the demo: http://jsbin.com/alokat/1/edit?html,css,js,output I changed the script as $(function(){ $(window).load(function(){ var $gal = $("#propertyThumbnails"), galW = $gal.outerHeight(true), galSW = $gal[0].scrollHeight, wDiff = (galSW/galW)-1, // widths difference ratio mPadd = 60, // Mousemove Padding damp = 20, // Mousemove response softness mX = 0, // Real mouse position mX2 = 0, // Modified mouse position posX = 0, mmAA = galW-(…
has title: Auto Scroll Image vertically using JQuery
has comment: http://stackoverflow.com/comment/45651297
has comment: http://stackoverflow.com/comment/45650932
downvote count: 0
has comment: http://stackoverflow.com/comment/45650882
favorite count: 0
has comment: http://stackoverflow.com/comment/45650534
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45650614
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/45650827

kendo-ui
tags question: http://stackoverflow.com/q/28686509
tags question: http://stackoverflow.com/q/28733244
tags question: http://stackoverflow.com/q/28663517
tags question: http://stackoverflow.com/q/28619526
tags question: http://stackoverflow.com/q/28656875
tags question: http://stackoverflow.com/q/28693367
tags question: http://stackoverflow.com/q/28638565
tags question: http://stackoverflow.com/q/28663225
tags question: http://stackoverflow.com/q/28741960
tags question: http://stackoverflow.com/q/28727678
tags question: http://stackoverflow.com/q/28721422
tags question: http://stackoverflow.com/q/28639649
type: Tag
tags question: http://stackoverflow.com/q/28696540
tags question: http://stackoverflow.com/q/28656503
tags question: http://stackoverflow.com/q/28694817
tags question: http://stackoverflow.com/q/28620946
tag name: kendo-ui
tags question: http://stackoverflow.com/q/28717191
tags question: http://stackoverflow.com/q/28630200
tags question: http://stackoverflow.com/q/28704254
tags question: http://stackoverflow.com/q/28693304
tags question: http://stackoverflow.com/q/28733572
tags question: http://stackoverflow.com/q/28750526
tags question: http://stackoverflow.com/q/28616635
tags question: http://stackoverflow.com/q/28701591
tags question: http://stackoverflow.com/q/28631228
tags question: http://stackoverflow.com/q/28691195
tags question: http://stackoverflow.com/q/28720622
tags question: http://stackoverflow.com/q/28727753

http://stackoverflow.com/a/28683897
has comment: http://stackoverflow.com/comment/45664068
has body: I'm not sure you are using the correct method to get the date from the datepicker. In your checkDate() function instead of this var inputdate = document.getElementById("tukdatum").value; var tukdate = new Date(inputdate); you can use var tukdate = $("#tukdatum").datepicker("getDate"); This is because getDate returns a date object which does not need to be parsed using new Date. Here is a JSBin - Check out the console Documentation here
accepted answer of: http://stackoverflow.com/q/28683666
has comment: http://stackoverflow.com/comment/45662851
answers question: http://stackoverflow.com/q/28683666
type: Answer
has comment: http://stackoverflow.com/comment/45663970
has comment: http://stackoverflow.com/comment/45661628
has comment: http://stackoverflow.com/comment/45661927
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/45662464
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45662321
downvote count: 0
has comment: http://stackoverflow.com/comment/45663301

http://stackoverflow.com/q/28629625
has comment: http://stackoverflow.com/comment/45560686
has comment: http://stackoverflow.com/comment/45560251
answer count: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45560306
has comment: http://stackoverflow.com/comment/45560297
has answer: http://stackoverflow.com/a/28629784
downvote count: 1
has title: object oriented javascript form registeration
type: Question
has comment: http://stackoverflow.com/comment/45560164
has comment: http://stackoverflow.com/comment/45560624
has comment: http://stackoverflow.com/comment/45559700
upvote count: 0
has body: i am new to the object oriented javascript :) i have written this code to validate the first name of a registration form, but it is not working OOForm First Name i don't know what is the problem with the code, but when i enter the firstname with invalid value and then press submit, it do nothing but clearing the text field and the "invalid" span do not appear
tagged with: javascript
score: -1

http://stackoverflow.com/a/28705288
score: 2
has comment: http://stackoverflow.com/comment/45700431
has comment: http://stackoverflow.com/comment/45700133
has comment: http://stackoverflow.com/comment/45700595
answers question: http://stackoverflow.com/q/28705192
accepted answer of: http://stackoverflow.com/q/28705192
type: AcceptedAnswer
has body: You need to put the outside of the script tag, preferably in the , after linking to the JS libraries : title Alabama Wyoming
has comment: http://stackoverflow.com/comment/45703416
downvote count: 0
has comment: http://stackoverflow.com/comment/45703559
has comment: http://stackoverflow.com/comment/45703884
has comment: http://stackoverflow.com/comment/45703705
type: Answer
has comment: http://stackoverflow.com/comment/45700691
has comment: http://stackoverflow.com/comment/45700306
has comment: http://stackoverflow.com/comment/45703610
has comment: http://stackoverflow.com/comment/45700195
upvote count: 2
has comment: http://stackoverflow.com/comment/45706979
has comment: http://stackoverflow.com/comment/45740280
has comment: http://stackoverflow.com/comment/45700750
has comment: http://stackoverflow.com/comment/45703486

http://stackoverflow.com/comment/45725227
comment on: http://stackoverflow.com/q/28719035
has text: You should avoid using functions when evaluating angular attributes such as `ng-show` as it can cause performance problems with large controllers / amount of watchers etc...
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28608824
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28608558
type: Answer
has body: DOM must be ready first to trigger the event: $(document).ready(function () { $('#oflocations').change(function() { $('.searchandfilter').submit(); }); });
score: 1

http://stackoverflow.com/q/28655368
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/38409782
has comment: http://stackoverflow.com/comment/45607331
has comment: http://stackoverflow.com/comment/45607478
has comment: http://stackoverflow.com/comment/45607306
has title: AngularJS TemplateCache
downvote count: 0
score: 1
tagged with: gulp
favorite count: 0
has answer: http://stackoverflow.com/a/28655646
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45607650
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45607543
has comment: http://stackoverflow.com/comment/45607621
upvote count: 1
has body: I am trying to generate templatecache using gulp-angular-templatecache and combine it with Angular script into one JS file. gulp task: gulp.task('generatetemplatecache', function () { return gulp.src(['dev/app/**/*.tpl.html']) .pipe(minifyHTML({quotes: true})) .pipe(templateCache({ module:'templateCache', standalone:true })) .pipe(gulp.dest('public/app')); }); This is basically how output looks like: var app = angular.module("app",['templateCache']); angular.module("templateCache", []).run(["$templateCache", function($templateCache) {$templateCache.put("test.tpl.html"," My Title "); $templateCache.put("layout/popover.tpl.html"," Click {{customer.name}} {{customer.street}} ss "); But the problem is, I found that it does not load from templatecache. Everytime when angular need the template, it still grab the original template html file. If that html file is not available, then it will have trouble displaying it. Why is it doesn't work? Any part I am doing wrong? The url in the template cache is relative to the index.html or to the root of domain?

http://stackoverflow.com/q/28691978
accepted answer: http://stackoverflow.com/a/28692456
score: -2
downvote count: 2
has body: How can we return to default form behavior ? I have a form created with both static HTML and dynamically generated HTML (with javascript using jquery) and I want to do some treatments before sending my form. To do so, I stop the default behavior with e.preventDefault(). But after my treatments, I want to return to default behavior for the form (especially for the required inputs) Any ideas ?
has title: return to default form behavior
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: php
type: AnsweredQuestion
upvote count: 0
type: Question
has answer: http://stackoverflow.com/a/28692456

http://stackoverflow.com/q/28704796
has answer: http://stackoverflow.com/a/28713966
answer count: 2
has body: Im looking for a way to minify my extjs app. The app has already (and will have more) 100+ files like views etc which are loading on the launch and I heard that using a Sencha CMD to minify it would be a good idea, when the app will finally get to production. Unfortunately, Ive ran into some problems while using the Sencha cmd. Here's what I did: downloaded the app to my local installed sencha cmd v5.1.2.52 Now I try to simply do 'sencha app build', like the tutorials say. It throws me an error [ERR] Command must be run from an app or package folder. Already tried doing it in main folder, but also tried in "app" inside it. Always the same error. I probably missed something, because I read about the .sencha folder, it probably should be in my application's folder, but it isnt. Maybe its because of that? I've also seen a solution to do a 'sencha app init' (thought it could generate some init folders like .sencha) but the command doesnt exists (maybe it would work on older sencha cmd?). If someone could be that nice and provide me some steps I should take, or point me the steps I missed, itd be very helpful. I did search for it, most of infos say the 'sencha app build' should work but it didn't, Ive also ran into the 'Sencha SDK' but people says its outdated.
downvote count: 0
favorite count: 0
tagged with: extjs
has answer: http://stackoverflow.com/a/28706409
tagged with: extjs4
has title: Minifying an existing ExtJS app with Sencha CMD
type: AnsweredQuestion
score: 1
tagged with: sencha-cmd
upvote count: 1
accepted answer: http://stackoverflow.com/a/28706409
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28713966

http://stackoverflow.com/comment/45730683
score: 0
type: AnswerComment
type: Comment
has text: @f484126 your fiddle doesn't have multiple classnames or ID's. How would you want it to work with multiples? Please show this in the fiddle.
comment on: http://stackoverflow.com/a/28720931

http://stackoverflow.com/q/28665232
has comment: http://stackoverflow.com/comment/45625474
tagged with: javascript
score: 0
answer count: 2
has body: I want to develop a very simple userscript for a web app, which will mainly insert some elements and CSS. I can't make changes to the source code. The HTML code is kind of messy: It's table-based, most elements don't have IDs, not all of them have useful classes, there are lots of useless elements nested inside other elements, etc. In short, no element is clearly identifiable. The good things are that the layout is always the same, so the structure is predictable, and there will be no changes to the source code for the foreseeable future (probably never). Taking these things into consideration, the only solution I could think of was to identify the elements through their messy context (for example, one element of interest can be identified by $("div table table &gt; tr &gt; td");). If I follow this idea, things will work, but it won't exactly radiate quality. So, is there a better way to achieve this?
possible better answer: http://stackoverflow.com/a/28665417
tagged with: jquery
has answer: http://stackoverflow.com/a/28665417
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28667719
accepted answer: http://stackoverflow.com/a/28667719
type: AnsweredQuestion
has title: Identifying elements in messy (but predictable) HTML code
type: Question

http://stackoverflow.com/a/28596366
has comment: http://stackoverflow.com/comment/45597341
answers question: http://stackoverflow.com/q/28595909
has comment: http://stackoverflow.com/comment/45540876
accepted answer of: http://stackoverflow.com/q/28595909
has comment: http://stackoverflow.com/comment/45597388
score: 0
has body: I think you haven't set up the Google Map there is nothing in your MapAcitivity. Sample code: public class MainActivity extends Activity { private static LatLng goodLatLng = new LatLng(37, -120); private GoogleMap googleMap; private EditText et_address, et_finalAddress; LatLng addressPos, finalAddressPos; Marker addressMarker; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); et_address = (EditText) findViewById(R.id.addressEditText); et_finalAddress = (EditText) findViewById(R.id.finalAddressEditText); // Initial Map try { if (googleMap == null) { googleMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap(); } } catch (Exception e) { e.printStackTrace(); } googleMap.setMapType(GoogleMap.MAP_TYPE_HYBRID); // Put a dot on my current location googleMap.setMyLocationEnabled(true); googleMap.setIndoorEnabled(true); googleMap.setTrafficEnabled(true); // 3D building googleMap.setBuildingsEnabled(true); // Get zoom button googleMap.getUiSettings().setZoomControlsEnabled(true); Marker marker = googleMap.addMarker(new MarkerOptions() .position(goodLatLng) .title("Hello")); } For more details, please refer to my github here. Also, please try to follow this step by step, you will finally get a map on your phone.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45536942
has comment: http://stackoverflow.com/comment/45537974
has comment: http://stackoverflow.com/comment/45540368
type: Answer
has comment: http://stackoverflow.com/comment/45540229
has comment: http://stackoverflow.com/comment/45540270
has comment: http://stackoverflow.com/comment/45949002

http://stackoverflow.com/a/28600936
answers question: http://stackoverflow.com/q/28600564
upvote count: 1
type: Answer
has body: yes you can achieve this by using jqtemplates. fiddle demo var json = { "name": "Google", "type": "Software", "region": "California" }; $( "#jqTemplate" ).tmpl(json).appendTo("#myDiv");
downvote count: 0
score: 1

http://stackoverflow.com/a/28663734
accepted answer of: http://stackoverflow.com/q/28663688
score: 2
has body: Make sure you have added jquery or you have the right script order(first jquery then your scripts). for example: If you forget to include jquery scripts or libraries using jquery will not work
has comment: http://stackoverflow.com/comment/45622444
answers question: http://stackoverflow.com/q/28663688
has comment: http://stackoverflow.com/comment/45622619
has comment: http://stackoverflow.com/comment/45622567
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer

http://stackoverflow.com/q/28748542
accepted answer: http://stackoverflow.com/a/28860812
tagged with: highcharts
tagged with: javascript
has body: When using Highcharts heapmap module, there is an issue with exporting the chart following a colorAxis update. I create a chart using var chart = new Highcharts.Chart({ ... colorAxis: { min: 0, max: 100, minColor: '#FFFFFF', maxColor: Highcharts.getOptions().colors[0] }, ... }) Following an update on the colorAxis, where max is altered, an export of the chart shows the original scale. Is there something I should be doing differently? Example jsfiddle
possible better answer: http://stackoverflow.com/a/28762953
has title: Highcharts Export after updating colorAxis
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45792454
type: Question
has answer: http://stackoverflow.com/a/28762953
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28860812

http://stackoverflow.com/a/28645022
has comment: http://stackoverflow.com/comment/45589480
has comment: http://stackoverflow.com/comment/45588320
has comment: http://stackoverflow.com/comment/45588568
has comment: http://stackoverflow.com/comment/45589148
downvote count: 0
has comment: http://stackoverflow.com/comment/45589585
has comment: http://stackoverflow.com/comment/45589492
has comment: http://stackoverflow.com/comment/45589657
answers question: http://stackoverflow.com/q/28644920
type: AcceptedAnswer
has body: When you run the content script it also runs in the new tab that you opened so it ends up opening an infinite amount of tabs. To limit this, you can put the tabs.create inside of a function that doesn't run immediately on page load.
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45589258
score: 1
accepted answer of: http://stackoverflow.com/q/28644920

http://stackoverflow.com/comment/45652239
comment on: http://stackoverflow.com/q/28678763
type: Comment
type: QuestionComment
has text: @T.J.Crowder Thanks for the snippet. For me it's closer to 800 ms in Firefox. But this should be very system-dependent, right? I have other tabs/streaming video/software running right now. I'm working on a system that needs to scale up quite a bit (not really sure how much), thus my concern about keeping the UI responsive.
score: 0

http://stackoverflow.com/comment/45620051
comment on: http://stackoverflow.com/a/28661507
type: AnswerComment
score: 0
type: Comment
has text: Thanks all for youre's effort to help me. Yes, i asked if it is possible, not to stackoverflow do my job instead of me. Thank again, now i know from where to start.

event-handling
tag name: event-handling
tags question: http://stackoverflow.com/q/28720835
tags question: http://stackoverflow.com/q/28606947
tags question: http://stackoverflow.com/q/28736016
tags question: http://stackoverflow.com/q/28650126
tags question: http://stackoverflow.com/q/28665784
type: Tag

http://stackoverflow.com/q/28703276
upvote count: 1
tagged with: javascript
type: UnansweredQuestion
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
type: Question
has body: I want to add button that let user back 30 seconds during listening songs in mp3 player but the hell I can't do it. I am playing with this for hours, here's what I use http://tympanus.net/codrops/2012/12/04/responsive-touch-friendly-audio-player. What I have got already code for 30 sec back // jump 30 seconds back when we click the button $('.audioplayer-back30s').click(function(){ var audio = $('audio'); var backToSec = audio.currentTime - 30; // make sure that we jump to a valid point in time audio.currentTime = (backToSec >= 0) ? backToSec : 0; }); html You are listening mp3 number 1 <img src="http://i57.tinypic.com/30t6gd2.jpg" <img src="http://i61.tinypic.com/29zv7u8.png" css .audioplayer-back30s { width: 2.5em; /* 40 */ height: 100%; text-align: left; text-indent: -9999px; cursor: pointer; z-index: 2; top: 0; left: 0; } .audioplayer-back30s:hover, .audioplayer-back30s:focus { background-color: #222; } .audioplayer-back30s a { display: block; } Rest of css and js files of this mp3 player are here http://tympanus.net/Development/AudioPlayer/AudioPlayer.zip . Really I don't have any ideas and I really need this feature, most problem is with creating just button. Thanks you guys for any response.
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 1
has comment: http://stackoverflow.com/comment/45697304
has title: How do I add my additional button to this jQuery mp3 player?
has answer: http://stackoverflow.com/a/28703743

http://stackoverflow.com/q/28599327
type: Question
tagged with: .net
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28599355
accepted answer: http://stackoverflow.com/a/28599355
tagged with: desktop
score: 0
has body: I have a desktop application (little service in the system tray) and some web application. In case a user loads the web page I need to be able to find out that both the web page and the desktop application are running on the same computer. On the desktop application I could easily get access to hard disk serial number, ethernet mac address, etc. and identify computer based on this information. But I don't have access to it in JavaScript on the web page. Is there any way to achieve my goal? Update. A little bit more information about why I need that. I'm working on a medical software. The idea is that when a user loads the web page, he can press Import button and make the import from medical device that is attached to his computer (the import itself is done by a tray-application on the user's computer)
type: AnsweredQuestion
has title: Find out if Web page and desktop application are launched on the same computer
has comment: http://stackoverflow.com/comment/45504834

http://stackoverflow.com/comment/45644955
has text: Unfortunately, this is the wrong place for this question. Stackoverflow is about programming issues and debugging code; not library recommendations.
comment on: http://stackoverflow.com/q/28675738
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/comment/45604961
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28653955
type: QuestionComment
has text: You cannot catch errors that occur in an iframe with a different origin. Those errors are occurring in a different context which is not your parent page.

http://stackoverflow.com/comment/45602045
comment on: http://stackoverflow.com/a/28651662
score: 0
type: Comment
has text: by all rights your original code should have been working... can you console.log what you think your require('socket.io') is and console.log what you think the server being passed back is?
type: AnswerComment

http://stackoverflow.com/comment/45600054
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28651307
type: AnswerComment
has text: You can do this with JS as well.. :P

http://stackoverflow.com/comment/51513863
comment on: http://stackoverflow.com/a/28667322
type: Comment
has text: Are you sure that's even possible with an iframe? I feel like that's not allowed either.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28746466
favorite count: 0
has title: Disabling dates in date picker from MySQL
answer count: 0
type: UnansweredQuestion
tagged with: datepicker
upvote count: 1
score: 1
tagged with: mysql
tagged with: date
type: Question
has body: I am fairly new to JavaScript and through few tutorials have been able to put the following code together for the jQuery date picker. However, I need to be able to store disabled dates in a variable which will be the result of a query. I also need to prevent someone from booking through disabled dates, therefore if 3/3/15 is disabled someone can't select from 2/3/15 to 3/3/15. Below is the code which I have in my JS file. Any help would be appreciated. $(document).ready(function() { var bookedDays = ["2015-2-27","2015-2-28","2010-6-14"]; ***Should be results of select from table query. e.g SELECT fromdate, todate from table where id = $_GET['id']*** $('#request').hide(); $('.days').html('Please select a date range of at least the same day. Max booking: 2 Months.'); $( "#from" ).datepicker({ defaultDate: new Date(), changeMonth: true, numberOfMonths: 1, minDate: new Date(), maxDate: "+1M", beforeShowDay: isAvailable, onClose: function( selectedDate ) { var day = $("#from").datepicker('getDate'); day.setDate(day.getDate()+1); $( "#to" ).datepicker( "option", "minDate", day ); } }); $( "#to" ).datepicker({ defaultDate: new Date(), changeMonth: true, numberOfMonths: 1, minDate: ("#to"), maxDate: "+2M", beforeShowDay: isAvailable, onClose: function( selectedDate ) { $( "#from" ).datepicker( "option", "maxDate", selectedDate ); } }); function isAvailable(date){ var dateAsString = date.getFullYear().toString() + "-" + (date.getMonth()+1).toString() + "-" + date.getDate(); var result = $.inArray( dateAsString, bookedDays ) ===-1 ? [true] : [false]; return result; } $('#to').on('change',function(){ var days = (daydiff(parseDate($('#from').val()), parseDate($('#to').val()))); var cogs = $('#cogsday').html(); cogs = cogs.replace(/\D/g,''); var x = days; var y = cogs * x; $('.days').html('You have chosen to borrow this item for '+ days + ' days at a cost of ' + y + ' cogs. '); if(days){ $('#request').show(); } $('#request').click(function() { var cogs = $('#cogsday').html(); co…
downvote count: 0
tagged with: javascript
tagged with: jquery

webbrowser-control
type: Tag
tags question: http://stackoverflow.com/q/28605076
tag name: webbrowser-control

http://stackoverflow.com/q/28641629
tagged with: dom
has answer: http://stackoverflow.com/a/28642327
type: Question
score: 0
has answer: http://stackoverflow.com/a/28641668
has comment: http://stackoverflow.com/comment/45582095
has title: How do I retrieve all elements from a form?
accepted answer: http://stackoverflow.com/a/28641668
has body: I want to get all the elments in a form. I can do that using document.getElementById('form').elements but it returns extra properties (see below) that I don't want. How do I "remove" it? The code: var result = document.getElementById('form').elements; for(var key in result) { console.log(key, ' = ', result[key]); } Here's the ouput: 0 = &lt;input id="A" type="text" name="A" value="a"&gt; 1 = &lt;input id="B" type="text" name="B" value="b"&gt; 2 = &lt;input type="checkbox" name="C"&gt; namedItem = namedItem() item = item() @@iterator = @@iterator() length = 3 I want only the HTML elements, i.e, value of 0, 1, and 2. Like this: 0 = &lt;input id="A" type="text" name="A" value="a"&gt; 1 = &lt;input id="B" type="text" name="B" value="b"&gt; 2 = &lt;input type="checkbox" name="C"&gt; Live example. I know that a simple test like this: if(!isNumber(key)) continue; will do the job fine but I'm looking for a "elegant" solution and will use this test if there are no any.
tagged with: http://stackoverflow.com/tag/html
answer count: 4
has comment: http://stackoverflow.com/comment/45582111
has answer: http://stackoverflow.com/a/28641714
has answer: http://stackoverflow.com/a/28641685
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28641685
tagged with: javascript

http://stackoverflow.com/comment/45521554
has text: So...what's stopping you? How can we help? (Do you have a specific question?)
comment on: http://stackoverflow.com/q/28608224
score: 4
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28653810
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
tagged with: css
favorite count: 0
upvote count: 0
type: AnsweredQuestion
score: -1
accepted answer: http://stackoverflow.com/a/28653947
tagged with: image
type: Question
has title: Image not rendering when appending it with javascript
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28653947
tagged with: jquery
has body: I am attempting to append a element made in JavaScript into a . What happens is the area where the image is meant to be expands slightly, but the image doesn't appear. the console gives me no error and i am truly baffled. Here is ALL of my code (Because i dont know what is causing the problem). I am also using the normalize css file and jquery in a local area. Javascript window.onload = function(){ var turn = 1; document.title = "First Player"; var coolDown = 'False'; var makeScreen = function(){ var height = $(window).height(); var width = $(window).width(); $('#screen').height(height); $('#screen').width(height); var extraSpace = width - height; var halfOfExtraSpace = extraSpace / 2; $('#screen').css("left", halfOfExtraSpace); }; var handleClickOne = function(){ drawImage('one'); }; var handleClickTwo = function(){ drawImage('two'); }; var drawImage = function(section){ if (turn == 1){ if (coolDown == 'False'){ drawCircle(section); turn = 2; document.title = "Second Player"; coolDown = 'True'; }; }; if (turn == 2){ if (coolDown == 'False'){ drawCross(section); turn = 1; document.title = "First Player"; coolDown = 'True'; }; }; coolDown = 'False'; }; var drawCircle = function(section){ alert('circle') var circle = document.createElement("img"); circle.innerHTML = "src='Circle.png'" $("#one").append(circle); }; var drawCross = function(section){ alert('cross') }; makeScreen(); var one = document.getElementById('one'); one.addEventListener('click', handleClickOne); var two = document.getElementById('two'); two.addEventListener('click', handleClickTwo); }; HTML JavaScript Interaction Test. CSS body{ background-color: rgb(50, 50, 50) } td{ width: 0; height: 0; background-color: rgb(200, 200, 200); border-style: solid; border-width: 3px; border-color: black; } #screen{ position: absolute; left:0cm; top:0cm; } Before replying or voting please take in consideration i am still a partial noob to some aspects of JavaScript and please take in consideration that i dont know ev…

http://stackoverflow.com/comment/45616601
comment on: http://stackoverflow.com/a/28660279
score: 0
type: AnswerComment
type: Comment
has text: Technically, it should be `this.element(valueToBeTested)`, not `$(valueToBeTested).valid()`. And your `"valueToBeTested"` name is somewhat misleading, this argument _generically_ represents the particular "element" to be tested, not its value and not the name of any particular field. Please see [plugin source code](http://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.js).

http://stackoverflow.com/comment/45834115
score: 0
has text: You don't have to use PubNub it was more as an inspiration to see how they do it.
type: Comment
comment on: http://stackoverflow.com/a/28736630
type: AnswerComment

http://stackoverflow.com/comment/45763309
type: AnswerComment
has text: @demo yes... so looks like OP had some other problem... but how is this got accepted then?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28739300

http://stackoverflow.com/a/28620115
type: Answer
downvote count: 5
score: 13
accepted answer of: http://stackoverflow.com/q/28620087
answers question: http://stackoverflow.com/q/28620087
has body: Couldn't you just put them in the same call, or use a loop? var one = "1" var two = "2" var three = "3" var combinedString = one + ", " + two + ", " + three console.log(combinedString) // "1, 2, 3" console.log(one + ", " + two + ", " + three) // "1, 2, 3" var array = ["1", "2", "3"]; var string = ""; array.forEach(function(element){ string += element; }); console.log(string); //123
type: AcceptedAnswer
upvote count: 18

twilio
tag name: twilio
tags question: http://stackoverflow.com/q/28654924
type: Tag

http://stackoverflow.com/a/28802892
type: Answer
answers question: http://stackoverflow.com/q/28649986
has body: It seems tag div.class="main" and div.class="column_left" haven't closed.
score: 0

http://stackoverflow.com/q/28733462
accepted answer: http://stackoverflow.com/a/28735230
type: AnsweredQuestion
tagged with: scroll
type: Question
has body: Im using a scroll function this works perfect whenever I use normal text for it, but whenever I use Text Text it wont scroll automaticly because there is a or what to do to make it also scroll for once with other elements. And is there a simple way to use it for all $('#scrollDiv') istead of copy paste it above every line? Example usage: //This scrolls correct $('#scrollDiv').append('Hello world!'); scrollDiv($('.scroll-text:eq(0)')); //This wont work scrolling $('#scrollDiv').append('Hello world!'); scrollDiv($('.scroll-text:eq(0)')); //This also wont work $('#scrollDiv').append('Hello'); scrollDiv($('.scroll-text:eq(0)')); function scrollDiv($div, h){ var scrollHeight = $div[0].scrollHeight; var scrollTop = $div[0].scrollTop; var height = $div[0].clientHeight; var h_invisible = scrollHeight - scrollTop - height; if(h){ if(h>h_invisible){ $div.scrollTop(1e5); } }else{ if(15>h_invisible){ $div.scrollTop(1e5); } } }
tagged with: javascript
has answer: http://stackoverflow.com/a/28735230
score: 0
has title: Scroll function doesnt work after using some elements
answer count: 1

http://stackoverflow.com/comment/45515268
has text: Not quite. If the model is valid, I'd like to display some view connected to that action, but if it's not, I'd like to stay in the current view and display a popup box containing some error message from the model validation.
comment on: http://stackoverflow.com/a/28604725
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28665637
has body: Simple on textbox input event chaeck whether it's empty or not. If it's empty then remove data. $("#textbox").on('input',function() { if(("#textbox").val().length() == 0){ //your code goes here. } });
answers question: http://stackoverflow.com/q/28665494
score: 0
type: Answer

http://stackoverflow.com/comment/45754005
has text: For a better solution, you might want to add what you're doing with some more code.
type: Comment
score: 3
type: QuestionComment
comment on: http://stackoverflow.com/q/28734393

http://stackoverflow.com/q/28640699
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28640827
has body: I have HTML that looks like: &lt;input type="number"&gt; &lt;br&gt; &lt;input type="number"&gt; &lt;br&gt; &lt;input type="number"&gt; &lt;br&gt; &lt;button&gt;+&lt;/button&gt; And my JS $('input').on('click', function () { var input = $(this); $('button').on('click', function () { var newVal = parseInt(input.val()) + 1; input.val(newVal); }); }); Everytime I switch input to edit the value using the plus button, the previously clicked inputs also gets changed. How can I do this properly so that only "this" selected input gets edited? JSFiddle: http://jsfiddle.net/qh8sqd09/
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28640757
has title: Input selector not being reset
tagged with: jquery

http://stackoverflow.com/comment/45662296
comment on: http://stackoverflow.com/q/28684381
type: Comment
type: QuestionComment
score: 0
has text: @Dan is right, simply adding `blob:` in front of an HTTP(S) URL doesn’t make this a blob.

http://stackoverflow.com/a/28696648
has body: First of all, looking at your structure of an object, it looks like structure of your root object is wrong. Root object cannot be an Array of the objects that you intend to have. To take advantage of recursion, you should have structure which is similar on all levels. You function implementation is almost correct. I just hope you are not passing JSON string as the json parameter; if you are, you have to parse it and make a JS object by using JSON.parse(json) Here is updated implementation: var obj = { id: 23, name: 'Test1', children: [{ id: 24, name: 'Test2', children: [] },{ id: 25, name: 'Test2', children: [] }], }; var objToBePushed = { id: 26, name: 'Test3', children: [{ id: 27, name: 'Test4', children: [] }] }; function findNode(nodeId, json, node){ if(node.id == nodeId){ node.children.push(json); } else{ for(var i=0; i&lt;node.children.length; i++){ findNode(nodeId, json, node.children[i]); } } } findNode(24, objToBePushed, obj); console.log(obj); Working JSFiddle: http://jsfiddle.net/ef3ewoag/2/
type: Answer
upvote count: 5
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28695348
score: 5
answers question: http://stackoverflow.com/q/28695348
type: AcceptedAnswer

internet-explorer
tags question: http://stackoverflow.com/q/28683205
tags question: http://stackoverflow.com/q/28721824
tags question: http://stackoverflow.com/q/28599039
tags question: http://stackoverflow.com/q/28611410
tags question: http://stackoverflow.com/q/28704100
tags question: http://stackoverflow.com/q/28628307
tags question: http://stackoverflow.com/q/28613936
tags question: http://stackoverflow.com/q/28642558
tag name: internet-explorer
tags question: http://stackoverflow.com/q/28707807
tags question: http://stackoverflow.com/q/28723225
tags question: http://stackoverflow.com/q/28724417
tags question: http://stackoverflow.com/q/28661449
tags question: http://stackoverflow.com/q/28610143
tags question: http://stackoverflow.com/q/28609996
tags question: http://stackoverflow.com/q/28605964
tags question: http://stackoverflow.com/q/28630695
tags question: http://stackoverflow.com/q/28740949
tags question: http://stackoverflow.com/q/28686843
tags question: http://stackoverflow.com/q/28633231
tags question: http://stackoverflow.com/q/28673735
tags question: http://stackoverflow.com/q/28604693
tags question: http://stackoverflow.com/q/28679667
tags question: http://stackoverflow.com/q/28703947
tags question: http://stackoverflow.com/q/28615801
tags question: http://stackoverflow.com/q/28704520
tags question: http://stackoverflow.com/q/28635110
tags question: http://stackoverflow.com/q/28692367
type: Tag
tags question: http://stackoverflow.com/q/28624941
tags question: http://stackoverflow.com/q/28657586
tags question: http://stackoverflow.com/q/28618296
tags question: http://stackoverflow.com/q/28681395
tags question: http://stackoverflow.com/q/28614935

ember-data
tags question: http://stackoverflow.com/q/28667802
tags question: http://stackoverflow.com/q/28640274
tags question: http://stackoverflow.com/q/28701891
type: Tag
tags question: http://stackoverflow.com/q/28623465
tag name: ember-data
tags question: http://stackoverflow.com/q/28628026

http://stackoverflow.com/comment/45529927
comment on: http://stackoverflow.com/q/28613193
score: 0
type: Comment
has text: @GeorgeStocker I look at [this page](http://dystroy.org/miaou/login) from various devices. Most of them receive the normal version (and it doesn't seem to be related to user-agent or such things you can easily mock).
type: QuestionComment

http://stackoverflow.com/q/28730431
has title: Include jQuery input with form post?
tagged with: ajax
has comment: http://stackoverflow.com/comment/45747151
tagged with: php
has answer: http://stackoverflow.com/a/28730669
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28730756
tagged with: javascript
has body: I have a field within a form for users to enter an address. After they enter the address, it's sent with jQuery.ajax to a remote API to be verified and parsed to individual fields. The result is a jsonp object that I manipulate to extract the fields I need. My goal is to include the address with its multiple parts so that it can be processed along with the rest of the fields in the form. The only way I could come up with so far was to add hidden fields populated with the correct values. This feels sort of clunky though, so I was wondering if there is a better way of going about it. Currently, the user enters the address in a single line, similar to this: &lt;form method="POST" id="myForm"&gt; &lt;input type="text" id ="address&gt; &lt;div class="recipients"&gt;&lt;/div&gt; &lt;input type="submit"&gt; &lt;/form&gt; The ajax is fired when they focusout of the address field, and on the successful return of the jsonp object the necessary fields are extracted, then inserted into the form: success: function(data) { var results = data.results[0]; var address1 = results.Address1; var address2 = results.Address2; var city = results.Locality; var state = results.AdministrativeArea; var zip = results.PostalCode; var addLines = "&lt;input type='hidden' name='address1' value='"+address1+"'&gt;"; addLines += "&lt;input type='hidden' name='address2' value='"+address2+"'&gt;"; addLines += "&lt;input type='hidden' name='state' value='"+state+"'&gt;"; addLines += "&lt;input type='hidden' name='city' value='"+city+"'&gt;"; addLines += "&lt;input type='hidden' name='zip' value='"+zip+"'&gt;"; $(".recipients").append($(addLines)); } Is there a more elegant way of including the returned data into POST? Thanks for the help!
score: 0
answer count: 2
tagged with: jquery
has comment: http://stackoverflow.com/comment/45748395

http://stackoverflow.com/comment/45657754
comment on: http://stackoverflow.com/q/28682375
score: 0
has text: Ah, thanks. I'll read more about closest for some reason since a while I've been thinking it only goes up to 1 parent level.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45730070
has text: How do you receive your start and end dates? `new Date(2005)` will create a date which is `2005` milliseconds past `January 1, 1970`, and I don't think that's your intent above
comment on: http://stackoverflow.com/a/28721151
type: AnswerComment
score: 0
type: Comment

object-literal
tag name: object-literal
tags question: http://stackoverflow.com/q/28734767
type: Tag

http://stackoverflow.com/comment/45611319
score: 0
type: Comment
has text: Your last example looks more complicated. I feel that react is making the markup rendering a bit of a pain. The logic are easy, the problem is how to get the proper markup to the page and with react/JSX it involves extra work to get this going. Just by looking at your last example of LikeCon Im not really sure what it will render, I really have to put my mind to know whats happening here. My example was aiming to be as simple end self explainable as possible. The best would be to pack the HTML in a string and then render it but this is not the ReactJS way. the like is 1/0 to save some space.
comment on: http://stackoverflow.com/a/28656917
type: AnswerComment

http://stackoverflow.com/comment/45735172
comment on: http://stackoverflow.com/q/28723568
score: 0
type: Comment
type: QuestionComment
has text: "draw things outside the canvas' viewport" why draw things when they are out of view? in the example you click and it creates the text, so what would be the use case for having it out of view?

http://stackoverflow.com/a/28645647
answers question: http://stackoverflow.com/q/28645412
score: 0
type: Answer
has body: You can simply use the onload event handler: &lt;body onload="getLocation()"&gt; This will fire as soon as the page is ready. Alternatively, you can use jQuery's .ready()like this: $(document).ready(function(){ getLocation(); });

http://stackoverflow.com/q/28669236
possible better answer: http://stackoverflow.com/a/28669323
type: AnsweredQuestion
has title: JavaScript Definition pause()
has answer: http://stackoverflow.com/a/28669323
score: -4
type: Question
has comment: http://stackoverflow.com/comment/45632808
has body: Does anyone know what the proper definition for the code below. It is inside my function and it is frustrating not knowing the correct name for it... Thank you. pause()
has answer: http://stackoverflow.com/a/28669307
accepted answer: http://stackoverflow.com/a/28669307
answer count: 2
downvote count: 4
has comment: http://stackoverflow.com/comment/45632609
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45632690
favorite count: 0

http://stackoverflow.com/a/28688525
has body: You need to include the data-binding to the &lt;tr&gt; element in your HTML markup. Right now, you have the display div for what is selected, but not the selected value itself. &lt;tbody data-bind="foreach: model.datas"&gt; &lt;tr data-bind="click: $root.selectThing, css: { selected: isSelected} "&gt; Then in your view model, add a function to return the selected thing: Also add an observable for the object itself. function ViewModel() { var self = this; this.datas= ko.observableArray([0]); getdatas(); this.ddlTypes = ko.observableArray([]); getOppType(); self.CurrentDisplayThing = ko.observable(); self.selectThing = function(item){ self.model.CurrentSelected = ko.observable(); } } Finally, in your object representing your config class, add an isSelected variable, which is a knockout function. function oppConfig(ID, Name,TypeID) { this.ID = ko.observable(ID); this.Name = ko.observable(Name); this.selectedTypeId = ko.observable(TypeID); self.isSelected = ko.computed(function(){ return selected() === self; } } Some CSS to display your selection: .selected { background-color: yellow; } thead tr { border:1px solid black; background:lightgray; } tbody tr { border:1px solid black; cursor: pointer; }
answers question: http://stackoverflow.com/q/28688322
score: 0
type: Answer

http://stackoverflow.com/comment/45520161
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28608084
has text: @Blazemonger: Indeed.
type: Comment

http://stackoverflow.com/comment/45754154
has text: I am using advance rest client for sending the request, I have set Content-Type = application/json and I am passing data as {'name':'asdf', 'completed':false, 'note':'asdf'}
comment on: http://stackoverflow.com/q/28734424
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28666690
has comment: http://stackoverflow.com/comment/45628197
has comment: http://stackoverflow.com/comment/45629009
has comment: http://stackoverflow.com/comment/45628997
has body: Well, specifically answering your question, issues about whether it is the correct way or not, when you attach a click handler to anything, when it fires, it receives an Event object, and not rootService. Event has no method exampleFunction and so you get your undefined message. One possible fix for you would be to define the click handler in your template. Click And change your controller. app.controller('MainCtrl', ['$scope', 'rootService', function($scope, rootService) { $scope.callExampleFunction = function(){ rootService.exampleFunction(); }); } ]); Additionally, I wanted to point out for future readers, there is another bug in the question code. var button = document.getElementByTag(button); That statement will not work; document has a getElementsByTagName method, not getElementByTag. getElementsByTagName takes a string argument and returns an array, so the corrected code (to find the first button) would be var button = document.getElementsByTagName("button")[0]; Finally, in Angular, click handlers are easily handled with ng-click. And if you really needed to attach a click handler without using ng-click, you would be better off doing it in a directive, using angular.element. angular.element("button").on("click", function(){...})
score: 2
has comment: http://stackoverflow.com/comment/45628675
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45628882
upvote count: 2
has comment: http://stackoverflow.com/comment/45628925
type: Answer
answers question: http://stackoverflow.com/q/28666627
has comment: http://stackoverflow.com/comment/45628237
accepted answer of: http://stackoverflow.com/q/28666627
has comment: http://stackoverflow.com/comment/45628824

http://stackoverflow.com/a/28645348
has comment: http://stackoverflow.com/comment/45589024
score: 1
accepted answer of: http://stackoverflow.com/q/28644719
has comment: http://stackoverflow.com/comment/45589109
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45588720
has body: I try to reproduce your case in a minimalistic .html : Paris London Berlin So If I've understood correctly, this is the html you get. Next, I rebuilt your js array a bit differently : var compInfoArray = [ { "id" : 5, "cityname" : "Paris", "area" : "FR" }, { "id" : 8, "cityname" : "London", "area" : "UK" }, { "id" : 12, "cityname" : "Berlin", "area" : "GER" } ]; Then I wrote a prototype that will find a value inside any subarray keys : Array.prototype.contains = function (needle) { for (var i in this) { for(var key in this[i]) { if(this[i][key] == needle ) { return i; } } } return false; } Finally your showname() function : function showname() { var id = document.form1.id.value; var index = compInfoArray.contains(id); document.form1.cityname.value = compInfoArray[index]["cityname"]; document.form1.area.value = compInfoArray[index]["area"]; } Working snippet : var compInfoArray = [{ "id": 5, "cityname": "Paris", "area": "FR" }, { "id": 8, "cityname": "London", "area": "UK" }, { "id": 12, "cityname": "Berlin", "area": "GER" }]; function showname() { var id = document.form1.id.value; var index = compInfoArray.contains(id); document.form1.cityname.value = compInfoArray[index]["cityname"]; document.form1.area.value = compInfoArray[index]["area"]; } window.onload = function() { showname(); } Array.prototype.contains = function(needle) { for (var i in this) { for (var key in this[i]) { if (this[i][key] == needle) { return i; } } } return false; } Paris London Berlin EDIT : This is how you probably will have to build your array with your query results : var compInfoArray = [ <?php foreach($result1 as $row1) { echo '{'; echo 'id : ' . $row1['id'] . ','; echo 'cityname : "'.$row1['cityname'].'",'; echo 'area : "'.$row1['area'].'"'; echo '},'; } ?> ];
has comment: http://stackoverflow.com/comment/45589065
has comment: http://stackoverflow.com/comment/45589175
type: Answer
answers question: http://stackoverflow.com/q/28644719
upvote count: 1

http://stackoverflow.com/comment/45653949
has text: Also, please note, `mysql_` functions are **deprecated** as of PHP 5.5. See: http://php.net/manual/en/function.mysql-connect.php
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28679164
type: QuestionComment

http://stackoverflow.com/comment/45699238
comment on: http://stackoverflow.com/a/28698097
has text: Well I think I understand what you're saying. Using this call/prototype scheme, the modules/objects wouldn't repeat the function in the lower classes. But I think the better would try to do this in the Modular Pattern example don't you think ? someone told me here on SO, that this Object.create thing is an "old way" of doing things and the Modular Pattern and the AMD is a better way. So I think the best way would be AMD with call/prototype ? is that it ?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45673041
comment on: http://stackoverflow.com/q/28690708
score: 0
type: Comment
type: QuestionComment
has text: possible duplicate of [How can I merge properties of two JavaScript objects dynamically?](http://stackoverflow.com/questions/171251/how-can-i-merge-properties-of-two-javascript-objects-dynamically)

http://stackoverflow.com/comment/109867796
score: 0
has text: It's due to sync XHR: https://stackoverflow.com/a/62120230/5846045
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28714598

http://stackoverflow.com/comment/45736151
comment on: http://stackoverflow.com/a/28719037
type: Comment
has text: since `$.ajax()` returns a promise, you don't necessarily need to wrap it into `$.when`. `$.ajax().then(function(){})` would be fine enough.
score: 1
type: AnswerComment

http://stackoverflow.com/comment/45548740
type: AnswerComment
comment on: http://stackoverflow.com/a/28623643
type: Comment
has text: I get "Jquery library is loaded"
score: 0

http://stackoverflow.com/comment/45756618
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28734368
has text: And in your network tab?

http://stackoverflow.com/comment/45781758
has text: I should probably say to use the `UInt16Array` to handle unsigned values.
comment on: http://stackoverflow.com/q/28749712
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28656526
tagged with: google-docs
type: Question
has comment: http://stackoverflow.com/comment/45609363
tagged with: javascript
has comment: http://stackoverflow.com/comment/45609582
has comment: http://stackoverflow.com/comment/45609391
has comment: http://stackoverflow.com/comment/45609383
type: UnansweredQuestion
has title: "missing ) after argument list"
has comment: http://stackoverflow.com/comment/45618901
linked to: http://stackoverflow.com/q/3559063
answer count: 0
score: 0
tagged with: java
has body: Can you please help me with the following code? I'm getting the error "missing ) after argument list". if(warning_count) { MailApp.sendEmail("youremail@yourdomain.com ,anotheremail@anotherdomain.com ", "Reminder Spreadsheet Message", msg); }
duplicate of: http://stackoverflow.com/q/3559063

http://stackoverflow.com/comment/45691632
has text: Ah ok, then it should be `$this.replaceWith` instead of `$this.html`
type: AnswerComment
comment on: http://stackoverflow.com/a/28700569
score: 0
type: Comment

icicle-diagram
tag name: icicle-diagram
tags question: http://stackoverflow.com/q/28700591
type: Tag

http://stackoverflow.com/q/28628251
has comment: http://stackoverflow.com/comment/47109183
downvote count: 0
tagged with: jquery
favorite count: 0
has title: HandsOnTable context menu options repeat
has comment: http://stackoverflow.com/comment/45654773
type: UnansweredQuestion
tagged with: handsontable
answer count: 0
tagged with: sapui5
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47106181
has body: I am trying to use HandsOnTable in a web page designed using SAPUI5. I have an issue with the display of Context Menu. The options in the context menu repeat after the last option in the menu. I have included the code below. Please help me resolve the issue. var container = document.getElementById('sheetContainer'); var settingsHOT = { data: data, autoWrapRow: true, colHeaders: true, comments: false, contextMenu: { items: { "copy": {}, "paste": {}, "row_above": {}, "row_below": {}, "remove_row": {}, "undo": {}, "redo": {}, "make_read_only": {}, "alignment": {} } }, contextMenuCopyPaste: { swfPath: "resources/ZeroClipboard.swf" }, columns: [{}, {}, {}, { editor: 'select', selectOptions: ["Yes", "No", "Yes with exemptions"] }, {}, { renderer: 'html' }, {}, {}, {}, {}, {}], colWidths: [120, 100, 200, 150, 250, 250, 100, 250, 250, 250, 125], fixedColumnsLeft: 1, fixedRowsTop: 0, minRows: 1000, minCols: 26, maxRows: 10000, maxCols: 1000, minSpareRows: 5, manualColumnResize: true, manualRowResize: true, manualColumnMove: true, manualRowMove: true, mergeCells: false, persistentState: true, rowHeaders: true, removeRowPlugin: true, startRows: 5, startCols: 5, stretchH: 'none', search: true, wrodWrap: true };
tagged with: javascript

http://stackoverflow.com/comment/45633281
comment on: http://stackoverflow.com/q/28669457
type: QuestionComment
has text: You are not exporting `USERS`
score: 0
type: Comment

http://stackoverflow.com/comment/45505437
comment on: http://stackoverflow.com/q/28598417
has text: saying that, the angles and additions are as they are here, but I did include the missing } :)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45750910
has text: if you want just to check whether string has at least one digit - `/[0-9]+/`
score: 1
comment on: http://stackoverflow.com/q/28732536
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45516300
has text: By partially, do you mean, read a section (say half) of a file, or read a file in chucks rather then in one go? My understanding from the spec (although I might be wrong) is that a file ***is*** read in chunks. Not sure Re: memory. I know the browser storage limit is less then available ram, but thats about my limit
comment on: http://stackoverflow.com/a/28605457
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/q/28749033
type: Question
has comment: http://stackoverflow.com/comment/45783358
tagged with: javascript
tagged with: canvas
answer count: 1
tagged with: button
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/45780841
favorite count: 0
type: UnansweredQuestion
has body: I want to add an image in canvas by using browse button. I tried to do something, I can use browse button but not add an image in canvas.How can I do? Select a file
has answer: http://stackoverflow.com/a/28751480
score: 1
has title: Browse Button with JQuery
upvote count: 1

http://stackoverflow.com/comment/45561205
score: 0
has text: Ok, this clarifies a lot.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28627189

http://stackoverflow.com/a/28748746
downvote count: 0
has comment: http://stackoverflow.com/comment/45779532
type: Answer
has body: You're using the same type of quotes around the string literals in the Javascript attributes as you are around the attributes. So the quote that starts the literal is ending the attribute. You need to use double quotes around the literals to distinguish them. And since double quotes are also surrounding the string literal that you assign to newField, you need to escape them to prevent from ending that string. You need to do this in both onkeyup and onblur. &lt;input type='text' name='proj_no[]' size='8' maxlength='7' value='' class='test' onkeyup='if (this.value.length==3) {this.value=this.value+\"/\"}' onkeypress='if (event.keyCode==45) {return false} else {return true}' onblur='if (this.value.length==6) {this.value=this.value+\"X\"}' placeholder='111-111' /&gt; \ You can avoid much of this complexity if you bind your event handlers using Javascript/jQuery rather than inline attributes. Since these are dynamically-added elements, you can use event delegation as explained in Event binding on dynamically created elements?
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28748608
answers question: http://stackoverflow.com/q/28748608
type: AcceptedAnswer

http://stackoverflow.com/comment/45631177
type: Comment
has text: More or less what I said.. ?
comment on: http://stackoverflow.com/a/28668155
type: AnswerComment
score: 0

http://stackoverflow.com/q/28607657
type: UnansweredQuestion
tagged with: checkbox
score: 1
downvote count: 1
has title: Do we still have to set checkboxes to indeterminate using Javascript?
type: Question
has comment: http://stackoverflow.com/comment/45519377
linked to: http://stackoverflow.com/q/1726096
tagged with: javascript
has body: This question was asked back in 2009 and the most recent answers are from 2011, which suggest that you need to use Javascript to set a checkbox to an indeterminate state. Is this still the case, or is there HTML5 markup now supported by browsers for this scenario? I ask because this has to be a common requirement, and it seems odd to have it only accessible via Javascript.
has comment: http://stackoverflow.com/comment/45519494
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
answer count: 0
upvote count: 2

http://stackoverflow.com/q/28643860
answer count: 2
has comment: http://stackoverflow.com/comment/45585887
tagged with: javascript
tagged with: jquery
has body: So I'm having some issues with my code. I'm trying to remove a link (a) and then after that add a new link (a) with different text. Here's the code HTML: Username: @<a href="<?php echo $username ?>"> <?php echo strtolower($username) ?> Edit Script: $('#edit-username').click(function() { var text = $('.text-info-username').text(); var input = $(' ') $('.text-info-username').text('').append(input); $('#edit-username').remove(); $('Update').appendTo('.controls-username'); $(' ').insertAfter('.controls-username'); });
favorite count: 0
has answer: http://stackoverflow.com/a/28643891
accepted answer: http://stackoverflow.com/a/28643891
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28644149
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45585925
type: Question
type: AnsweredQuestion
has title: Adding to div with jQuery & HTML
possible better answer: http://stackoverflow.com/a/28644149
upvote count: 2

http://stackoverflow.com/comment/45666028
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28686796
has text: jQuery is a Javascript library, yes, its possible but you need to attempt something first and explain what specific problem you have with your code
type: QuestionComment

http://stackoverflow.com/q/28642915
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45588446
tagged with: jqgrid
has title: Export JQGrid data to Excel using javascript
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/28644753
accepted answer: http://stackoverflow.com/a/28644753
answer count: 2
has answer: http://stackoverflow.com/a/28667600
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45585468
favorite count: 0
tagged with: http://stackoverflow.com/tag/csv
has comment: http://stackoverflow.com/comment/45587185
has comment: http://stackoverflow.com/comment/45587719
possible better answer: http://stackoverflow.com/a/28667600
has body: I want to download the grid data in csv format , by looking at the link http://jsfiddle.net/hybrid13i/JXrwM/ and using JSONToCSVConvertor($("#reportGrid").jqGrid("getGridParam", "data"),"Report",true); you can download a csv file but its column name are variable names not label any idea how can i fix this , or there is another solution
has comment: http://stackoverflow.com/comment/45587439

http://stackoverflow.com/a/28615095
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28614670
has body: If you want to get rid of the comments only within the response.box (as I understood), you can use this: $('#content-box').replaceWith(function(){ return response.box.replace(/&lt;!--(.*?)--&gt;/ig, ''); }); The function above will change this: &lt;!-- content box --&gt; &lt;div id="content-box"&gt; yo &lt;/div&gt; &lt;!-- /content box --&gt; into this (single comments): &lt;!-- content box --&gt; &lt;div id="content-box"&gt; text from response.box &lt;/div&gt; &lt;!-- /content box --&gt;

http://stackoverflow.com/q/28700514
tagged with: promise
has answer: http://stackoverflow.com/a/28701230
tagged with: functional-testing
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: leadfoot
type: Question
has body: I am attempting to use the leadfoot module for functional testing with the intern and selenium. For this test, I'm trying to click a button in one place, then check the display property of a element elsewhere on the page. I couldn't find a way to expand the search of the findById call, so I tried using the session property, which seems to work, but results in everything returning a promise. The only way I've found that will make it work is by chaining then functions. What makes the session (and the elements its functions return) different? return this.remote .findById('buttonContainer') .findByClassName('buttonClass') .click() .session .findById('stagePanel') .then(function(element) { element.findByClassName('itemList') .then(function(element) { element.getComputedStyle('display') .then(function (display) { // check display property }); }); }); I'm sure I'm doing many things wrong, so any and all advice is appreciated.
tagged with: intern
tagged with: javascript
has title: Leadfoot session object returns promises
upvote count: 1
answer count: 1
accepted answer: http://stackoverflow.com/a/28701230
favorite count: 0

http://stackoverflow.com/q/28693773
has comment: http://stackoverflow.com/comment/45678454
favorite count: 0
duplicate of: http://stackoverflow.com/q/1007340
has title: Call a Javascript function stored in an object property
upvote count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45678501
accepted answer: http://stackoverflow.com/a/28693823
type: Question
linked to: http://stackoverflow.com/q/1007340
has body: How come the code below doesn't work? var x = {}; x.a = alert; x.a('asdf'); // TypeError: Illegal invocation
tagged with: javascript
has comment: http://stackoverflow.com/comment/45679195
score: 4
has answer: http://stackoverflow.com/a/28693823
downvote count: 0
answer count: 1
linked to: http://stackoverflow.com/q/10743596

http://stackoverflow.com/a/28666810
score: 1
accepted answer of: http://stackoverflow.com/q/28666729
answers question: http://stackoverflow.com/q/28666729
type: AcceptedAnswer
downvote count: 0
has body: Your for loop condition is not correct. Replace it with below. Use j &lt; i + myName.length for(var j = i; j &lt; i+myName.length; j++ ) PS:- There are better way to do this, indexOf().
type: Answer
upvote count: 1

http://stackoverflow.com/comment/45648217
has text: In your code you have to either push the new way of making enemies onto your array OR the old way. At the moment you are doing both (see lines 43-52)
type: Comment
comment on: http://stackoverflow.com/a/28670750
score: 0
type: AnswerComment

http://stackoverflow.com/a/28633352
type: Answer
has comment: http://stackoverflow.com/comment/45567531
downvote count: 1
answers question: http://stackoverflow.com/q/28633187
score: 3
has body: EDIT: You're probably better off looking at @Benjamin Gruenbaum answer, which not only results in better performance, but also provides much more concise code. Promises - yes there is. I like RSVP very much, why? Simply because it's the fastest one. (quick benchmark: jsperf ). Here's quick re-write of your code: var promise = new RSVP.Promise(function(fulfill, reject) { Meteor.call('methodOne', '', function(err, resOne) { if (!err) { return reject(err); } fulfill(resOne); }); }); promise.then(function(resOne) { return new RSVP.Promise(function(fulfill, reject) { Meteor.call('methodTwo', resOne, function(err, resTwo) { if (err) { return reject(err); } fulfill(resTwo); }); }); }).then(function(resTwo) { return new RSVP.Promise(function(fulfill, reject) { Meteor.call('methodTwo', resTwo, function(err, resThree) { if (err) { reject(err); } fulfill(resThree); }); }); }).then(function(resThree) { // resThree is available - continue as you like console.log(resThree); }).catch(function(err) { console.log(err); }); That's the way to prevent "the ever rightward drift" of your code. Promises are cool, use them.
upvote count: 4
has comment: http://stackoverflow.com/comment/45569027
has comment: http://stackoverflow.com/comment/45567725
has comment: http://stackoverflow.com/comment/45567048

http://stackoverflow.com/comment/45720531
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28716429
has text: Thanks buddy its working with this /feed?fields=id,message,from{id,name,picture}
type: AnswerComment

http://stackoverflow.com/comment/45796291
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28757792
has text: What is this class "TextBoxEditable"? Is it your own css?
score: 0

http://stackoverflow.com/a/74985800
score: 0
has body: Answering this as a canonical, an alternative to Puppeteer for scraping dynamic sites which is also well-supported as of 2023 is Playwright. Here's a simple example: const playwright = require("playwright"); // ^1.28.1 let browser; (async () => { browser = await playwright.chromium.launch(); const page = await browser.newPage(); await page.goto("https://example.com"); const text = await page.locator('h1:text("Example")').textContent(); console.log(text); // => Example Domain })() .catch(err => console.error(err)) .finally(() => browser?.close()); Another approach is to try accessing the API directly. The linked tutorial uses some Python, but most of the techniques apply equally to Node. I'll summarize them here. The high-level strategy is to search the network requests for your data to determine if it's being served by an unsecured API endpoint. If so, you can make a traditional HTTP request to download the raw JSON data directly. In other cases, the data is available as a JS object or JSON string in tags served with the static page. An HTML parser like Cheerio can then be used to extract the data, possibly with a bit of regex. Usually, accessing the raw data will be faster, easier and more reliable than browser automation.
type: Answer
answers question: http://stackoverflow.com/q/28739098

http://stackoverflow.com/q/28669233
has answer: http://stackoverflow.com/a/28669278
upvote count: 3
possible better answer: http://stackoverflow.com/a/28669304
tagged with: debugging
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/28669304
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28669278
type: Question
has title: How can I debug variables by console which bind to the controller by controllerAs in AngularJS
answer count: 2
downvote count: 0
has body: Usually when I´m working with Controllers, I bind the data I need to the $scope to access them from the markup. But when I use controllerAs the data should be attached to "this" in the controller. So "this.foo = 'bar'" instead of "$scope.foo = 'bar'" But how can I debug the data then from the browser with the developer console? Normally I have my "AngularJS Batarang" plugin and I can print everything which is part of the current scope but I don´t know how to print the data which are bind to the controller.
favorite count: 0
tagged with: console
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45632917

http://stackoverflow.com/q/28643574
has answer: http://stackoverflow.com/a/28643611
type: Question
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
type: UnansweredQuestion
has title: jQuery / jQuery UI throwing up a console get error
has body: I get the following console get error my page GET http://www.website.com/mypage/none 404 (Not Found) jquery.min.js:3 a.getComputedStyle.Jb jquery.min.js:3 m.extend.css jquery.min.js:3 m.each.m.cssHooks.(anonymous function).set jquery.min.js:3 m.extend.style jquery.min.js:3 (anonymous function) jquery.min.js:4 m.access jquery.min.js:3 m.each.m.each.m.fn.(anonymous function) jquery.min.js:4 (anonymous function) jquery-ui.min.js:146 $.ui jquery-ui.min.js:1 (anonymous function) jquery-ui.min.js:16 Even though I'm using the following to include the javascript. &lt;script src="//code.jquery.com/jquery-1.11.2.min.js"&gt;&lt;/script&gt; &lt;script src="//code.jquery.com/ui/1.11.3/jquery-ui.js"&gt;&lt;/script&gt;
tagged with: web-inspector

http://stackoverflow.com/a/39669451
score: 0
has body: Make sure you restart your rails server after installing the handlebars_assets gem!
answers question: http://stackoverflow.com/q/28744654
type: Answer

http://stackoverflow.com/a/28662663
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28662273
upvote count: 38
answers question: http://stackoverflow.com/q/28662273
type: Answer
has body: The documentation isn't very clear and only shows this by example, but the syntax you have used ('-s, --src') is for boolean values. If you want to take a string you need to say so: '-s, --src &lt;item&gt;'
score: 38
type: AcceptedAnswer

http://stackoverflow.com/q/28691007
tagged with: css
upvote count: 3
has answer: http://stackoverflow.com/a/28694275
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28691394
has body: Normally in fullpage.js we can set single global paddingTop, paddingBottom value via below code: $('#fullpage').fullpage({ paddingTop: '130px', paddingBottom: '50px', }); My question is can we assign multiple paddingTop,paddingBottom values to individual scroll sections TO achieve more flexible layout display? $(document).ready(function() { $('#fullpage').fullpage({ anchors: ['firstPage', 'secondPage'], sectionsColor: ['#4A6FB1', '#939FAA'], scrollOverflow: true, sectionSelector: '.section', slideSelector: '.slide', slidesNavigation: true, slidesNavPosition: 'bottom', verticalCentered: false, resize: false, autoScrolling: true, paddingTop: '130px', paddingBottom: '50px' }); }); .slider-container { width: 50%; } .title-text { font-size: 30px; font-weight: bold; } p { line-height: 3em; } .contentline { border:1px solid white; } #demo { position: absolute; top: 50px; margin: 0; left: 0; right: 0; text-align: center; } padding:130px,bottom:80px layout you may press Arrow Down Key to scroll to the next section line1 line2 line3 line4 line5 line6 line7 line8 line9 line10 line11 line13 line14 line15 line16 line17 line18 line19 line20 line21 line22 line23 line24 line25 line26 line27 line28 line29 line30 slide2 slide3 slide4 Some sections which require different paddingTop and padding bottom values For example this page, if i need paddingTop: 20px; paddingBottom:20px; instead of running global value of 130px 50px; if using css to override padding, the calculated slider height is still wrong.
has answer: http://stackoverflow.com/a/28691394
type: AnsweredQuestion
score: 3
downvote count: 0
tagged with: fullpage.js
accepted answer: http://stackoverflow.com/a/28694275
favorite count: 0
type: Question
has title: How can we make different padding top and bottom values for diff sections in fullPage.js?
answer count: 2
tagged with: http://stackoverflow.com/tag/html

graph-visualization
tags question: http://stackoverflow.com/q/28602012
tag name: graph-visualization
type: Tag

http://stackoverflow.com/q/28723701
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/45734256
type: UnansweredQuestion
has body: We are implementing custom scripting in our application to allow end-users to customize the application business logic using JavaScript. The script code (JavaScript) is entered into the ACE Editor and then saved and retrieved using a standard REST api: function loadScriptFile(scriptID, callback) { $.ajax({ type: "GET", url: "http://api.mycompany.com:1337/api/Reports/" + scriptID, success: function (contents) { callback(contents); } }); } Here's an example of a custom script that an end-user might enter for the Purchase Order application: function appOnLoad () { viewModel.set('description', '&lt;Enter description here&gt;'); } function appBeforeSave() { if (viewModel.get('docTotal') &gt; 500 &amp;&amp; viewModel.get('isMgr') == false) { alert('Only managers can enter POs over $500'); return false; } return true; } function appAfterSave() { return true; } Empty global 'stub' functions are embedded in the application code for appOnLoad(), appBeforeSave() and appAfterSave() at appropriate places. When the app starts the script is retrieved via REST and initialized using $.globalEval() which overrides the stub functions with the functions in the custom script. Question: Assuming we take precautions to restrict the functions that an authorized end-user can execute in the script what additional security measures should we take to protect the app from external malicious actors?
answer count: 0
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45735694
has title: How To Secure User Defined Custom Script (JavaScript)
type: Question
has comment: http://stackoverflow.com/comment/45734432
tagged with: javascript
has comment: http://stackoverflow.com/comment/45734397
tagged with: security
has comment: http://stackoverflow.com/comment/45734277

http://stackoverflow.com/comment/78581876
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28705093
has text: Use $(document).on('.dd a','mousedown', function(event)){ event.preventDefault(); return false;}); to create event on elements that are not created yet.

http://stackoverflow.com/q/28714632
type: Question
tagged with: d3.js
answer count: 2
has answer: http://stackoverflow.com/a/28717173
has comment: http://stackoverflow.com/comment/45725063
linked to: http://stackoverflow.com/q/9400615
has title: In d3.js how to create a dynamic scale value for projection?
upvote count: 1
has body: Am beginner for d3.js. I create a geomap with using d3.js.My map is working fine but i have some problem in scaling. I need to display my map with full screen of the window. So i created with using below code. // Html Part &lt;div id="world-placeholder" style="width:100%;height:auto;"&gt; &lt;/div&gt; // Script part for generating SVG &lt;script&gt; var svg = d3.select('#'+id) .append('svg'); // Set Width &amp; Hight var width = $("svg").parent().width(); var height = width/2; // Set Projection var projection = d3.geo.robinson() //.scale(100) //.scale((width/height)*100) .translate([width/2, height/2]); // Set Path var path = d3.geo.path() .projection(projection); &lt;/script&gt; Basically am trying to plot the map with using current width of the screen by using $("svg").parent().width(); So my question is how to stretch my map with full screen. Result screen Before Scaling (Not used any scaling) Result Screen After Scaling (Used scale(200) for stretching) Scaling Code Part var projection = d3.geo.robinson() .scale(200) .translate([width/2, height/2]); How to Scale dynamically based on window size? or any other way to display a map with full screen for all devices? Please help me to solve. Thanks in advance.
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28719042
downvote count: 0
score: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg

http://stackoverflow.com/q/28658688
score: 0
tagged with: mongodb
tagged with: arrays
has comment: http://stackoverflow.com/comment/45613449
tagged with: mongoose
has comment: http://stackoverflow.com/comment/45613389
linked to: http://stackoverflow.com/q/15921700
has title: How to set index on document in sub-array (MongoDB)
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/45613412
type: Question
tagged with: javascript
has body: I'm attempting to set a unique index on a field within a subarray of a collection in MongoDB. This index will also be set to drop existing dupes. I'm following the MongoDB documentation, but it does not seem to be working (dupes still exist in my db). I believe my issue may be how I'm attempting to access the document within the 'photos' sub-array. Below is my schema and the code I'm trying to use to set the index: { event: String, headline: String, city: String, state: String, date: String, start: String, end: String, dateState: String, radius: String, team_1: String, team_2: String, object_id: String, longitude: String, latitude: String, cover: { img: String, username: String }, photos: [{ img: String, link: String, username: String, profile: String, text: String, longitude: String, latitude: String, created_time: String }] } gameday.events.ensureIndex( {"photos.img": 1}, { unique: true, dropDups: true } )

http://stackoverflow.com/q/28687274
has answer: http://stackoverflow.com/a/28687426
score: 0
has comment: http://stackoverflow.com/comment/45667018
answer count: 1
has comment: http://stackoverflow.com/comment/45667264
has comment: http://stackoverflow.com/comment/45667089
tagged with: javascript
type: UnansweredQuestion
has body: I'm using ajax for some dynamic aspect of my site's detail page, but I have unsual results. It appears when I perform my open call which looks like. RSS-feed will be listed here... My entire website gets duplicated again. The condition page is: <?php $q=$_GET["q"]; //find out which feed was selected if($q=="hardcover") { echo 'hardcover'; }else{ echo'paperback'; } ?>
has title: im using ajax for some dynamic aspect of my detail page of my site but im have very unsual results
tagged with: ajax
has comment: http://stackoverflow.com/comment/45667149
type: Question
tagged with: php
has comment: http://stackoverflow.com/comment/45667310
has comment: http://stackoverflow.com/comment/45667220

http://stackoverflow.com/a/28623917
accepted answer of: http://stackoverflow.com/q/28622878
answers question: http://stackoverflow.com/q/28622878
type: Answer
upvote count: 2
has body: Your problem is, you haven't created an extension. What you have created is an app, as indicated by the "app" key in your manifest. Apps cannot integrate with the browser this way, so you need to make an extension. You need to throw away your code and follow the extension guides to make one: Getting Started and Overview. Specifically, the UI element you're asking about is called a Browser Action.
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45549318

http://stackoverflow.com/a/28604243
answers question: http://stackoverflow.com/q/28604132
has body: data.input[k] is what you want var data = {input: {two: 2, four: 4, three: 3, twelve: 12}}, myArr = []; for(k in data.input) myArr.push(data.input[k]);
score: 0
type: Answer

http://stackoverflow.com/comment/45767262
type: AnswerComment
type: Comment
has text: In the route don´t put the .htlml files. Only the path like this: app.post('/login', sessionController.create); And in controller you render the view. Do You understand the code of my blog?
comment on: http://stackoverflow.com/a/28741451
score: 0

angularjs-directive
tags question: http://stackoverflow.com/q/28601772
tags question: http://stackoverflow.com/q/28686946
tag name: angularjs-directive
tags question: http://stackoverflow.com/q/28630191
tags question: http://stackoverflow.com/q/28728994
tags question: http://stackoverflow.com/q/28734879
tags question: http://stackoverflow.com/q/28658958
tags question: http://stackoverflow.com/q/28660428
tags question: http://stackoverflow.com/q/28682899
tags question: http://stackoverflow.com/q/28604881
tags question: http://stackoverflow.com/q/28603162
tags question: http://stackoverflow.com/q/28629265
tags question: http://stackoverflow.com/q/28653336
tags question: http://stackoverflow.com/q/28620092
tags question: http://stackoverflow.com/q/28734475
tags question: http://stackoverflow.com/q/28644472
tags question: http://stackoverflow.com/q/28735929
tags question: http://stackoverflow.com/q/28730084
tags question: http://stackoverflow.com/q/28599626
tags question: http://stackoverflow.com/q/28620479
tags question: http://stackoverflow.com/q/28656596
tags question: http://stackoverflow.com/q/28730346
tags question: http://stackoverflow.com/q/28614980
tags question: http://stackoverflow.com/q/28608848
tags question: http://stackoverflow.com/q/28721607
tags question: http://stackoverflow.com/q/28716048
tags question: http://stackoverflow.com/q/28600063
tags question: http://stackoverflow.com/q/28731985
tags question: http://stackoverflow.com/q/28723118
tags question: http://stackoverflow.com/q/28717523
tags question: http://stackoverflow.com/q/28732233
tags question: http://stackoverflow.com/q/28617609
tags question: http://stackoverflow.com/q/28622309
tags question: http://stackoverflow.com/q/28717328
tags question: http://stackoverflow.com/q/28749999
tags question: http://stackoverflow.com/q/28641645
tags question: http://stackoverflow.com/q/28622151
tags question: http://stackoverflow.com/q/28724945
type: Tag
tags question: http://stackoverflow.com/q/28732796
tags question: http://stackoverflow.com/q/28677310
tags question: http://stackoverflow.com/q/28737441
tags question: http://stackoverflow.com/q/28709843
tags question: http://stackoverflow.com/q/28611747
tags question: http://stackoverflow.com/q/28663858
tags question: http://stackoverflow.com/q/28704111
tags question: http://stackoverflow.com/q/28632647
tags question: http://stackoverflow.com/q/28749331
tags question: http://stackoverflow.com/q/28625740
tags question: http://stackoverflow.com/q/28745357
tags question: http://stackoverflow.com/q/28649343
tags question: http://stackoverflow.com/q/28621216
tags question: http://stackoverflow.com/q/28728852
tags question: http://stackoverflow.com/q/28627250
tags question: http://stackoverflow.com/q/28716971
tags question: http://stackoverflow.com/q/28629545
tags question: http://stackoverflow.com/q/28671539

http://stackoverflow.com/q/28604863
type: Question
tagged with: responsive-design
has title: Image delay when using Foundation Data-Interchange
tagged with: javascript
tagged with: data-interchange
has body: I'm currently using Foundation data-interchange to handle responsive images. Here the recommended syntax where (default) and (large) are the media queries: &lt;img data-interchange="[/path/to/default.jpg, (default)], [/path/to/bigger-image.jpg, (large)]" alt=""&gt; The problem: There is a little delay between the moment the page dispays and the moment the data-intechange image displays. The delay is quite normal as the image is loaded with JS when Foundation is ready, but it is not visually nice to the see the image suddenly appears after 500ms of showing the alt attribute like if the image was broken. I was thinking about putting an image by default: &lt;img src="a-default-image.jpg" data-interchange="[/path/to/default.jpg, (default)], [/path/to/bigger-image.jpg, (large)]" alt=""&gt; However, if I put the real 'default image' the result is not better (instead of having 'broken image' then 'big image', I have 'small image' then 'big image'). If I put a blank image, the result is kind of ok (no more alt showing), but now, I'm afraid that if the image is indexed by Google, it will be that blank image. I also could hide the image until the replace Foundation event is fired, but I would prefer avoid it unless there is no other solution. So, is there any other simple workaround I could use?
upvote count: 1
tagged with: zurb-foundation
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
answer count: 0
downvote count: 0
score: 1

http://stackoverflow.com/comment/45708589
score: 1
comment on: http://stackoverflow.com/a/28709698
has text: For now remove the ng-mouseover and use the first solution that I wrote to understand what is wrong: in the mouseover callback, log what is in scope.customerInfo
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28597656
upvote count: 1
has body: handleResponse() is a jsonp callback. This is primarily a form of communication in web pages which is a workaround to the browser's same-origin policy. Many services use this form of communication, for e.g. twitter. The pattern here is that you pass something in the url (usually a parameter called callback) which is actually the name of the method on your web page (in this case handleResponse). The service (which has data) will form javascript to the effect that handleResponse will get executed (as a normal js function with arguments). The arguments can be for e.g. some data returned by the service. In the case of twitter this may be timeline feeds; in your case your book search. Essentially you are calling that url in a script tag...and javascript to the following effect is executed: handleResponse(some_data);
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28597529
answers question: http://stackoverflow.com/q/28597529
type: Answer
score: 1

http://stackoverflow.com/a/37146884
has body: i've just been looking at this problem in my application and by setting AutoScroll to true and setting the height of the legend, the scrollbar is visible. Hope this helps
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28626691

http://stackoverflow.com/comment/45616642
comment on: http://stackoverflow.com/q/28659670
has text: it is a good idea but unfortunately, var row = table.row('#row-42'); return an object on which you canot do removeClass()
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/45714515
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28713229
has text: Here's another good resource: http://www.quora.com/Pete-Hunt/Posts/Facebooks-React-vs-AngularJS-A-Closer-Look

http://stackoverflow.com/q/28676558
has body: I am trying to add an async upload to my Drupal 6 custom module. The problem is, though, that when the upload occurs (I have a break point on my php function) no data can be seen in $_POST or $_FILES. All the data for the file gets put into $HTTP_RAW_POST_DATA. I would expect it to be in the $_FILES array. Can anyone tell me what I'm doing wrong. Or at least how to use $HTTP_RAW_POST_DATA to process the file on the backend. Here is my code: On my_module_viewer.views.inc &lt;form id='my_upload_form' enctype='multipart/form-data' method='POST'&gt; &lt;input type='file' name= 'file_upload' id= 'file_upload' multiple&gt; &lt;input type='button' name ='file_upload_button' id ='file_upload_button' value= 'Upload' /&gt; &lt;/form&gt; Java Script: $('#file_upload_button').click(function(){ var files = $( '#file_upload' )[0]; var data = new FormData(); jQuery.each(files.files, function(i, file) { data.append('file-'+i, file); }); var request_timeout = 50000; var url = Drupal.settings.basePath + 'my_module/cases/add_attachment'; $.ajax({ url: url, data:data, cache: false, contentType: false, processData: false, type: 'POST', beforeSend: function(xhr ){ $.blockUI({ message: "Uploading File. Please Wait.", css: { border: 'none', padding: '15px', backgroundColor: '#333', '-webkit-border-radius': '10px', '-moz-border-radius': '10px', opacity: .9, color: '#fff', fontSize: '26px', fontFamily: "'Helvetica Neue', Helvetica" } }); },success: function(data) { $.unblockUI(); }, error: function(XMLHttpRequest, textStatus, errorThrown) { $.unblockUI(); } }); }); As I mentioned, this is being written in Drupal 6. I'm not sure if this is relevant, but here is my menu for that task: Found on my_module.module $items['my_module/cases/add_attachment']= array( 'page callback' =&gt; 'add_attachment', 'access arguments' =&gt; array('add attachment for user'), 'type' =&gt; MENU_CALLBACK, 'access callback' =&gt; true, 'file' =&gt; 'my_module_viewer.views.inc' );
has title: Upload file does not show up in $_POST or $_FILES, only $HTTP_RAW_POST_DATA
has answer: http://stackoverflow.com/a/28747252
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: drupal-6
accepted answer: http://stackoverflow.com/a/28747252
tagged with: drupal
type: AnsweredQuestion
tagged with: php
type: Question

http://stackoverflow.com/comment/45543151
comment on: http://stackoverflow.com/a/28620280
score: 0
type: AnswerComment
has text: i think his best bet is promises instead of those solutions.
type: Comment

http://stackoverflow.com/q/28627351
type: Question
has comment: http://stackoverflow.com/comment/45555227
downvote count: 0
has answer: http://stackoverflow.com/a/28627401
favorite count: 0
has title: Javascript: Best event to use to call function for any change in text area?
has comment: http://stackoverflow.com/comment/45556438
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28627397
tagged with: php
answer count: 4
score: 2
has answer: http://stackoverflow.com/a/28627395
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28627807
has body: I want a function to be called whenever there is any change within my text area, i.e. char typed, removed, cut, pasted etc. Currently I am using: onkeyup || onmousemove = function(); This seems to only be calling onmousemove, what can I use to call my function on ANY change to the textarea. I am creating this JS as a string to add it as a parameter to the creation of a text_area using codeigniteras described here at form_input section e.g: $js= 'onkeyup || onmousemove = "function()"'; echo text_area('name', " ", $js);
tagged with: javascript

chai
tags question: http://stackoverflow.com/q/28606056
tags question: http://stackoverflow.com/q/28731114
tags question: http://stackoverflow.com/q/28705050
tag name: chai
type: Tag
tags question: http://stackoverflow.com/q/28716363
tags question: http://stackoverflow.com/q/28719108
tags question: http://stackoverflow.com/q/28642637

http://stackoverflow.com/comment/45681020
comment on: http://stackoverflow.com/a/28675046
score: 0
type: AnswerComment
type: Comment
has text: Did you check the firebug when you upload the file its request send or not?

http://stackoverflow.com/a/28687424
type: Answer
upvote count: 3
has body: The last approach is much better. You can simply unzip the third party library and paste the folder. You need not manually copy and paste each file to different folders. You can also use front-end package management tool (which I recommend) like bower with the directory structure. You may not need to tweak the third party directory structure into css, js and images.. You can leave whatever it has. If your project is a bit larger, you may consider creating a different directory for each of the apps you have created. This the directory structure which I generally follow: myproject/ myproject/ static/ my_app_1 css/ img/ js/ my_app_2 css/ img/ js/ lib/ bob/ what_ever_directory_str_it_has joe/ css/ img/ js/
accepted answer of: http://stackoverflow.com/q/28686341
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28686341
score: 3

http://stackoverflow.com/comment/45675668
score: 0
comment on: http://stackoverflow.com/q/28691060
type: QuestionComment
type: Comment
has text: For now the file are stored physically and the DBMS is Microsoft SQL Server 2012 but everything has been created in order to be able to switch physical<->blob and to change the DBMS so I would feel guilty using a proprietary trick

http://stackoverflow.com/q/28593718
has comment: http://stackoverflow.com/comment/45534359
has comment: http://stackoverflow.com/comment/46076735
tagged with: node.js
score: 3
has comment: http://stackoverflow.com/comment/45496203
answer count: 0
upvote count: 3
type: Question
tagged with: protractor
downvote count: 0
tagged with: javascript
has title: When starting protractor --elementExplorer, the console gets stuck at "Debugger listening on port 5858"
has comment: http://stackoverflow.com/comment/45533348
has comment: http://stackoverflow.com/comment/59123823
tagged with: angularjs-e2e
has body: I've been picking up Protractor a little recently, and I was looking at Protractor's webpage on debugging: https://github.com/angular/protractor/blob/master/docs/debugging.md The section on testing Protractor interactively seems to indicate that testing interactively is simple as running "Protractor --elementExplorer". However, when doing this, instead of ">" prompt the command line returns the following: Starting debugger agent. Debugger listening on port 5858 I'm never given a prompt after this. I must be missing something? Is there a configuration file somewhere with a flag set incorrectly? Output from protractor --troubleshoot --elementExplorer: DEBUG - Running with --troubleshoot DEBUG - Protractor version: 1.7.0 DEBUG - Your base url for tests is (my test website) DEBUG - Attempting to find the SeleniumServerJar in the default location used by webdriver-manager DEBUG - Attempting to find the chromedriver binary in the default location used by webdriver-manager Starting selenium standalone server... Selenium standalone server started at http://172.23.5.122:51131/wd/hub DEBUG - WebDriver session successfully started with capabilities { caps_: { applicationCacheEnabled: false, rotatable: false, mobileEmulationEnabled: false, chrome: { userDataDir: 'C:\Users\i65414\AppData\Local\Temp\scoped_dir7936_4453' }, takesHeapSnapshot: true, databaseEnabled: false, handlesAlerts: true, version: '40.0.2214.111', platform: 'XP', browserConnectionEnabled: false, nativeEvents: true, acceptSslCerts: true, 'webdriver.remote.sessionid': '2988bde6-201b-45cb-9638-8ca5e84da857', locationContextEnabled: true, webStorageEnabled: true, browserName: 'chrome', takesScreenshot: true, javascriptEnabled: true, cssSelectorsEnabled: true } } Starting debugger agent. Debugger listening on port 5858
has comment: http://stackoverflow.com/comment/45538582
favorite count: 0
has comment: http://stackoverflow.com/comment/45532126
type: UnansweredQuestion

http://stackoverflow.com/comment/45672338
has text: something like this https://datatables.net/forums/discussion/20149/sbuttontext-not-working-when-extending-editor-create . cheers
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28679534

http://stackoverflow.com/comment/45570407
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28634925
type: AnswerComment
has text: I understand this pretty well. However i want it to be page 1 and page 2 has is almost 50/50, and the last 2 is pretty rare.. So could i not * with 100 and do it the same way as i already did? Just with 48 as an example, instead of 0.48 ? @gibberish

http://stackoverflow.com/q/28707161
has answer: http://stackoverflow.com/a/28707271
tagged with: jquery-ui-datepicker
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: datepicker
has body: Given an input, I initialise a datepicker and all is well. Note, however, that the value in the input is outside the allowed date range in the datepicker initialisation. The behaviour is as I expect: date picker will allow the date to be changed to something in the allowed range. Then, I set the option "disabled" on the datepicker and it updates the value in the input (to the maximum value allowed in the datepicker initialisation). Here is an example: http://jsfiddle.net/smrunjgm/4/ Is there a way to prevent option "disabled" from changing the value in the input?
downvote count: 0
type: UnansweredQuestion
type: Question
has title: Disabling the datepicker updates the date in input
tagged with: jquery-ui
score: 1

http://stackoverflow.com/comment/45742501
comment on: http://stackoverflow.com/a/28728081
type: Comment
has text: did u mean with jquery ui ?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45683578
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28696540
has text: can you add your html-markup or set up an example? (e.g jsFiddle)
score: 0

http://stackoverflow.com/q/28662091
has title: Ionic Popover templateURL and angular ng-model doesn't sync
has body: I am using Ionic framework and I have the following code: $scope.loginCountryCode; $scope.loginPhone; //==============================// $ionicBackdrop.retain(); $ionicPopup.show({ title : 'Please Login', subTitle : 'Please enter the following details', templateUrl : 'loginTemplate.html', scope : $scope, buttons : [{ text: 'Send SMS Code', type: 'button-positive', onTap: function(e) { $scope.buttonToSend = e; if(!$scope.sendSMS()) e.preventDefault(); else $scope.userDataForm = true; } }] }); //==============================// $scope.sendSMS = function() { if(!$scope.loginCountryCode || $scope.loginCountryCode ==""){ $scope.loginCountryCodeEmpty = true; return false; } if(!$scope.loginPhone || $scope.loginPhone ==""){ $scope.loginPhoneEmpty = true; return false; } } Country Code Phone Number $scope.loginCountryCode is undefined and also $scope.loginPhone is undefined, even with ng-model="loginCountryCode" and ng-model="loginPhone" The weird thing that if I declare $scope.loginCountryCode = 123; then the ng-model value is 123, but it doesn't recognize changes in the input. Any ideas? thanks :)
has comment: http://stackoverflow.com/comment/45619253
tagged with: ionic-framework
accepted answer: http://stackoverflow.com/a/28664591
answer count: 1
tagged with: angularjs
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28664591
score: 0
has comment: http://stackoverflow.com/comment/45620383
type: Question
tagged with: javascript

http://stackoverflow.com/q/28595505
tagged with: javascript
has comment: http://stackoverflow.com/comment/45499509
type: Question
tagged with: http://stackoverflow.com/tag/html
has title: How to preselect multiple rows on ng-options in a list
tagged with: angularjs
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/30096356
has answer: http://stackoverflow.com/a/28597264
type: UnansweredQuestion
has body: I have an html list: Basically what I am trying to do is to show this box with a list in it and the user can select multiple ones then I save it. The saving and retrieving works. The selectedList gets populated with the items user selected last time while the fullList is the entire list of choices. I want to be able to HIGHLIGHT those rows of selected choices when the data gets loaded as if restoring from the last state. I can't seem to get it to highlight/select... I searched online and haven't found anything that is similar to what I have... some help would be appreciated! Thanks!
has comment: http://stackoverflow.com/comment/45497988

http://stackoverflow.com/comment/45594148
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28648228
has text: @charlietfl Enlighten me.

http://stackoverflow.com/q/28649904
upvote count: 1
has comment: http://stackoverflow.com/comment/45597186
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28650007
downvote count: 1
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/28649940
tagged with: javascript
score: 0
possible better answer: http://stackoverflow.com/a/28650007
has answer: http://stackoverflow.com/a/28649940
has title: Numeric comparison failure in a switch statement
has body: "original post" : This function should compare the value of 'a' with several other values, but always defaults. My test shows that the value of 'a' or 'b' is never changed. Do I have the case a > statement incorrect or elsewhere? Now I understand that I can not use comparison in the case statement: Should I use a bunch of if statements and a while (a &lt;> = 0) to do the multiple checking and decrementing? The snippit below shows 'a' with a particular value. In the full function, actually 'a' gets a value from a random number in another function. It must be checked against 16 possible values and decremented, then rechecked until it finally reaches 0. The comparison values are actually powers of 2 (1 through 16). function solution() { var a = 18000; var b = 0; switch (a) { case a &gt; 30000: a = a - 30000; b = b++; break; case a &gt; 16000: b = b++; a = a - 16000; break; case a &gt; 8000: b = b++; a = a - 8000; break; default: c = "defaulted!, Why?"; break; } window.alert (a + " " + b + " " + c); }
favorite count: 0

http://stackoverflow.com/a/35580556
type: Answer
has body: Looks like adding position: relative to the transformed children elements helped a little, in addition to transform: translateZ(0) to parent element. Still some artefacts in transitions though... Very weird bug !
score: 0
answers question: http://stackoverflow.com/q/28595742

http://stackoverflow.com/a/28713623
accepted answer of: http://stackoverflow.com/q/28713493
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 6
has body: Typescript is create just to ease the javaScript development. Am i right ? Yes, Typescript offers several syntactical features that are either (1) not present in JavaScript, or (2) part of a future JavaScript proposal and not supported by most browsers. CoffeeScript exists for a similar reason, except that its syntax is quite different from JavaScript and it does not attempt to be a superset of JavaScript. or it has something more to offer ? What else would you have in mind? can in use in html pages ? is it compatible with all the modern browsers ? It is possible to compile and run TypeScript within a web page, though the browser will not do this for you automatically. typescript-compile provides the ability to do this, but there are big performance drawbacks to doing so. Typically, one would compile TypeScript into JavaScript ahead of time and include the compiled JavaScript in a page. You can set up a build process to do this, and ASP.NET projects have built-in functionality to do Typescript -> JavaScript compilation without any manual steps.
has comment: http://stackoverflow.com/comment/45720347
has comment: http://stackoverflow.com/comment/45721852
score: 6
answers question: http://stackoverflow.com/q/28713493

http://stackoverflow.com/q/28732666
has title: Having trouble with ion-nav-bar and ion-tabs with Divs with 100% height
has body: just started using ionic so I guess it's a kinda newbee question here but I have not been able to do the following: - div h:100% w:100% - div 30% 100% - image 100% 100% - div 5% w:100% - button 100% 100% - div 65% w:100% - image 50% 50% - image 50% 50% - image 50% 50% - image 50% 50% I need something like this (The images must maintain aspect ratio inside the div): And this is my app: This is my code: ion-view view-title=""> Button </ion-view> The problem I see is that the on-nav-bar and ion-tabs is part of the 100% of my main container (in this case ion-pane), Images range below the header. Perhaps the only solution can be done using html-css-javascript because I have not found a way using tools from ionic-framework. Any ideas?
score: 0
answer count: 1
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28747764
tagged with: ionic-framework
type: Question
tagged with: javascript

http://stackoverflow.com/q/28711100
score: 6
tagged with: express
has comment: http://stackoverflow.com/comment/45711076
downvote count: 0
has title: res.redirect('url') error cross domain
has body: i'm making cross domain request (client-side &amp; server-side). in server.js i have added this code and cross domain req are working fine function setAcceptsHeader(req, res, next) { 'use strict'; res.setHeader('Access-Control-Allow-Origin', '*'); next();enter code here } app.options('*', function (req, res) { 'use strict'; res.header('Access-Control-Allow-Origin', '*'); res.header('Access-Control-Allow-Credentials', true); res.header('Access-Control-Allow-Methods', 'POST, GET, PUT, DELETE, OPTIONS'); res.header('Access-Control-Allow-Headers', 'Content-Type'); res.status(200).end(); }); Problem is when i added req.redirect() in server.js, im getting error XMLHttpRequest cannot load http://localhost:1214/#/about. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. app.get('/users/:email',setAcceptsHeader, function (req, res) { User.findOne({email:req.params.email}, function (err, post) { if(!post){ res.json({error:'item not found'}); } else{ res.redirect('http://localhost:1214/#/about');//not working for me } }); I know at client side i can use window.location to route but i want this to be implemented at server side. help!!
favorite count: 0
linked to: http://stackoverflow.com/q/18539403
type: Question
upvote count: 6
tagged with: node.js
has comment: http://stackoverflow.com/comment/45753336
has comment: http://stackoverflow.com/comment/45711343
has comment: http://stackoverflow.com/comment/45717855
answer count: 0
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/comment/45580077
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28640410
score: 0
has text: I am looking for a new point of view, ex: the user have the option to right click the link and open in new tab. But he wont do it, users are lazy, and many dont know this option. How can i make the user open the link in new tab without botherng it too much.. i dont want to lose the vizitor?

http://stackoverflow.com/q/28637581
score: 1
tagged with: angularjs-ng-repeat
favorite count: 0
tagged with: angularjs
has body: I try to use key value from ng-repeat as enlargement of another scope.arrayResult, so in result i would have arrayResult.q1/q2/q3 etc... Question: {{x}} {{ arrayResult.[key][0].value }} People Voted: {{ arrayResult. [key][0].label }} When i Use key value in angular brackets it works {{key}} How should look proper expression in which i use key value from ng-repeat which in effect would give me this: arrayResult.q1[0].value ? q1 should be result of using [key] value from ng-repeat
type: AnsweredQuestion
has title: Use key value from ng-repeat to extend scope expression
upvote count: 2
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28637618
tagged with: javascript
tagged with: angularjs-scope
accepted answer: http://stackoverflow.com/a/28637618
answer count: 1

http://stackoverflow.com/q/28708975
tagged with: ecmascript-next
linked to: http://stackoverflow.com/q/33369389
accepted answer: http://stackoverflow.com/a/28709165
downvote count: 0
tagged with: javascript
favorite count: 0
score: 57
has answer: http://stackoverflow.com/a/34118352
upvote count: 57
has answer: http://stackoverflow.com/a/34156376
has answer: http://stackoverflow.com/a/33381647
tagged with: babeljs
answer count: 5
has answer: http://stackoverflow.com/a/28709165
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/32299217
has body: There is a proposal for introducing C# style async-await. I know Babel.js transpiles ES6 to ES5, but is there any way to make it transpile async-await to ES5?
has answer: http://stackoverflow.com/a/32299217
tagged with: async-await
has title: Transpile Async Await proposal with Babel.js?
type: Question

http://stackoverflow.com/a/28707539
has comment: http://stackoverflow.com/comment/45704499
type: Answer
upvote count: 2
has body: From a quick look it looks like you missed some quotes in your option tag's "value" attribute. Try this: $("#afterId").append(" "+files[i].name+" ");
downvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28707423

http://stackoverflow.com/comment/70310065
type: Comment
comment on: http://stackoverflow.com/a/33714913
score: 0
type: AnswerComment
has text: @andrew genius, thanks! I would have never figured that out.

http://stackoverflow.com/q/28706989
has title: How do I check if a mouse click is inside a rotated text on the HTML5 Canvas in JavaScript?
answer count: 2
tagged with: canvas
tagged with: html5-canvas
accepted answer: http://stackoverflow.com/a/28707824
has answer: http://stackoverflow.com/a/56205468
has answer: http://stackoverflow.com/a/28707824
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45703615
possible better answer: http://stackoverflow.com/a/56205468
has body: I have drawn a text on the canvas in coordinates X, Y and saved them. I have a simple method that checks if a mouse click has happened inside the text boundaries. The problem is when I rotate the text 45 Degree I cannot check whether a mouse click has happened within the rotated text or not. In short, how can I check whether a mouse click is inside a rotated text or shape?
tagged with: javascript
linked to: http://stackoverflow.com/q/622140
score: 0

http://stackoverflow.com/comment/45679849
score: 0
type: QuestionComment
type: Comment
has text: _"Now i need to get the year as 2013 and 2012"_ This is an entirely meaningless and vacuous statement. What year? What does it mean to get a year "as" some other years? Why those years? You need to tell us precisely what it is that you are trying to accomplish. Not this vague, ambiguous, wiffle-waffle. Perhaps list inputs and desired outputs? Then show your implementation and explain how it's not doing what you wanted.
comment on: http://stackoverflow.com/q/28692762

http://stackoverflow.com/a/31726736
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/83786141
has comment: http://stackoverflow.com/comment/83797205
upvote count: 3
type: Answer
has comment: http://stackoverflow.com/comment/83797307
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28635199
answers question: http://stackoverflow.com/q/28635199
score: 3
has body: For anyone else wondering how to get high-res print-worthy content from html: PhantomJS and wkhtmltopdf / wkhtmltoimage are great alternatives that handle these things better.

http://stackoverflow.com/comment/45563911
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28622426
has text: Know how I could make the numbers at the bottom left of my page show the values of the current page or "section" in the top box and the max pages or "sections" in the bottomw box? haha

typeahead
type: Tag
tag name: typeahead
tags question: http://stackoverflow.com/q/28693141

http://stackoverflow.com/comment/45644020
type: AnswerComment
has text: @beije, no i load images not dinamically
type: Comment
comment on: http://stackoverflow.com/a/28675242
score: 0

http://stackoverflow.com/q/28711896
linked to: http://stackoverflow.com/q/15722096
has title: Simulate keypress event in Javascript or Jquery
upvote count: 3
type: UnansweredQuestion
type: Question
score: 3
tagged with: keypress
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I want to simulate keypresses in Javascript. There are no listener for those key presses. For example: The function will trigger key '32' (spacebar) and this should result in scrolling of page like pressing normal spacebar. I tried keypress trigger from Simulating a Keypress Event from Javascript Console but it didn't worked. Edit Key presses are not limited to spacebar only. It can be combined keys like alt+Ctrl+D and the browser should respond to them like keypresses from physical keyboard.
has answer: http://stackoverflow.com/a/28712116
has answer: http://stackoverflow.com/a/28712228

http://stackoverflow.com/a/28727343
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28726449
accepted answer of: http://stackoverflow.com/q/28726449
has body: You could simply use native HTML button element instead of input type="button": Add tag Add another tag JSfiddle
type: AcceptedAnswer

http://stackoverflow.com/comment/45574502
has text: This seems to be on the right track. If I force the image height it does render correctly, but since the images are different heights I'm temporarily having to run a jquery function that sets the height of each img tag to the height of the image. After this I can initiate masonry and it seems to work better.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28631843
score: 0

http://stackoverflow.com/a/28698070
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28696708
accepted answer of: http://stackoverflow.com/q/28696708
has comment: http://stackoverflow.com/comment/45686519
downvote count: 0
type: AcceptedAnswer
has body: Use the following algorithms to select your elements. CSS element[attribute(^|*|$|~)='attribute value'] Xpath //element[(@attribute|contains|starts-with|ends-with(@attribute, 'value'))='value' The xpath is a little bit uglier, and definitely not correct, but the CSS algorithm is correct. When you want to match on ANY property, including href like you want to, use this algorithm. Ask yourself these questions: what is the element I am selecting? what is the attribute I am selecting? is the attribute unique? In your case, the answer to #1 is an &lt;a&gt;. Answer to number #2 is href. Answer #3, is probably not because there could be more href's like this. whereas ID's, are usually unique. (it is called an identifier after all). what you can do is look at the parent and use it's ID. In CSS: span#idSpanActionLinks &gt; a will work just fine. (*# is just a css shortcut for id see here) In Xpath: //span[@id='idSpaceActionLinks']/a EDIT After your comment, since you are wanting to match href, here you go: CSS a[href*='OnEventQueue'] Xpath //a[contains(@href, 'OnEventQueue')] Both will work. Note that both of these statements mean, in English: find me an &lt;a&gt; element, whose attribute href contains the value OnEventQueue
type: Answer

http://stackoverflow.com/comment/45691418
has text: Using your solution the icon changes but the button stays a button. I would like the button to disappear.
type: Comment
comment on: http://stackoverflow.com/a/28700569
score: 0
type: AnswerComment

http://stackoverflow.com/a/28719801
accepted answer of: http://stackoverflow.com/q/28711947
answers question: http://stackoverflow.com/q/28711947
score: 0
has body: As mentioned in a comment, using a that = this will solve your problem. Eg. this.deleteOneTask = function () { var that = this; this.categoryAll.click(); //go to 'All' category browser.driver.actions().mouseMove(this.viewArea).perform().then(function () { //hover and delete single task that.deleteButton.click(); }); That's the best solution I've seen but I'd be happy to see a better one too.
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/28697837
tagged with: xpath
type: AnsweredQuestion
upvote count: 0
has title: Using xpath on javascript console
type: Question
score: -2
has comment: http://stackoverflow.com/comment/45686035
tagged with: javascript
downvote count: 2
has answer: http://stackoverflow.com/a/28697934
accepted answer: http://stackoverflow.com/a/28697934
answer count: 1
tagged with: console
favorite count: 0
has body: Hi I want to get someid's content by using xpath. my xpath: //*[someid"]/div[1]/div/div[1] code that doesn't even run: alert($x(//*[someid"]/div[1]/div/div[1])); error I get: Uncaught SyntaxError: Unexpected token }

http://stackoverflow.com/q/28697240
has title: JavaScript Img pauses during prompt dialog?
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
upvote count: 1
tagged with: css
has answer: http://stackoverflow.com/a/28697426
type: AnsweredQuestion
has body: I have my project almost complete. There will be a codepen link with the project for debugging at the end of the post. What's Supposed to Happen? The img holds the id property of dragon, as well as the src to force-load as the default image. It starts off with this img being (forced) pre-loaded when it's loaded. It should stay like that, then once the decision1() function is called, it should change it to this img. Once the dragonBattle() function is called, it should change the img to this gif. If the player attacks (or calls the hitDragon() function), it should play this animation once, then revert back to the dragon.gif image. Once the fight is over (or the function ends), it will revert back to the default image. KEEP IN MIND that all of these functions/events are called by the users input via the prompt(&quot;&quot;) function. The whole time, there will be a prompt() dialog box open, which triggers the events. What Really Happens? Everything explained in the What's Supposed to Happen? actually happens, but not what I am expecting/needing. Yes, it does happen in the background, but it seems that the animated gifs are not animated during the prompt(). Yes, it changes the img to the animation, but it's not animated, it's just paused really. Once you exit the prompt() box however, it starts (or really resumes) the animation playback. What's the problem? The problem is the img doesn't play gif animations while the prompt dialog box is open. What's the question? How can I have a gif (img) play/loop its animation while a prompt dialog box is open? Things to Note I have done this before, and it did work; the animation did play while the dialog box was open and the img was changed successfully. However, it seems that I have lost that code due to overwritten progress on code debugging. I only tested this on Chrome, and I am not sure if it's a Chrome thing or something in my code. I am very organized as you can tell. Code NOTE: I cannot include a codeSnippet because of th…
linked to: http://stackoverflow.com/q/2101359
score: 1
type: Question
downvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/28697426
tagged with: javascript

http://stackoverflow.com/comment/45747121
type: Comment
type: QuestionComment
has text: Nope ran it and I mixed up the odds and evens, needs to be vice versa.
score: 0
comment on: http://stackoverflow.com/q/28730389

http://stackoverflow.com/comment/45656479
has text: You're not wrong, that was definitely causing an issue. But unfortunately it didn't solve my issue. I've created a fiddle to demonstrate my issue: http://jsfiddle.net/tn5yb32t/
type: Comment
comment on: http://stackoverflow.com/a/28681404
type: AnswerComment
score: 0

http://stackoverflow.com/a/28608605
type: Answer
score: 0
has body: It seems like youre calling (alerting) the this object. You need to use the title attribute like this: DEMO FIDDLE
answers question: http://stackoverflow.com/q/28607423

datetimepicker
type: Tag
tag name: datetimepicker
tags question: http://stackoverflow.com/q/28625938

http://stackoverflow.com/q/28686843
upvote count: 2
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I have a simple javascript application that lets the user generate some XML and then save it as a file. However I can't get the saving to work in IE. Currently I am using the data-uri method as exemplified in this jsfiddle. But this does not work in IE because it does not support data-uri for application/xml. What would be another method or workaround (client-only) to let the user easily save an xml string (or dom node) as a file?
favorite count: 0
tagged with: http://stackoverflow.com/tag/xml
tagged with: data-uri
accepted answer: http://stackoverflow.com/a/28736406
has title: Download or display XML file in Internet Explorer
type: AnsweredQuestion
score: 2
tagged with: internet-explorer
downvote count: 0
has answer: http://stackoverflow.com/a/28736406
type: Question

http://stackoverflow.com/comment/45676807
type: Comment
comment on: http://stackoverflow.com/a/28691121
type: AnswerComment
score: 0
has text: I can rewrite my algorithm without underscore, and it changes nothing. I also tested both algorithms for 100K of items: ~2500 msec to ~115 msec, sorry.

http://stackoverflow.com/comment/45755614
type: QuestionComment
comment on: http://stackoverflow.com/q/28735388
has text: which language are you using?
score: 0
type: Comment

http://stackoverflow.com/comment/45585477
score: 0
has text: OK, so the question is about intellisense... That's what you should have precised in your question (and tag)
type: Comment
comment on: http://stackoverflow.com/q/28643618
type: QuestionComment

http://stackoverflow.com/comment/45543137
type: AnswerComment
type: Comment
has text: I would highly recommend using the approach as it's inline with standards where as these css properties are not. Here's your button using the approach: [Demo2](http://jsfiddle.net/ghx80Lgs/47/)
comment on: http://stackoverflow.com/a/28618663
score: 0

http://stackoverflow.com/comment/45732007
score: 0
comment on: http://stackoverflow.com/q/28653806
type: Comment
has text: What do you mean by "over scrolling"? Do you want to stop sliding when reaching the end? Or you do want infinite scroll?
type: QuestionComment

http://stackoverflow.com/a/28606107
answers question: http://stackoverflow.com/q/28606058
type: Answer
has comment: http://stackoverflow.com/comment/45516529
has comment: http://stackoverflow.com/comment/45516483
downvote count: 1
score: -1
has comment: http://stackoverflow.com/comment/45585038
has body: Yes, there is innerWidth and innerHeight. So something like var obj = document.getElementById('idhere'); var width = obj.innerWidth...
upvote count: 0

http://stackoverflow.com/a/53633518
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28630499
type: Answer
score: 1
has body: Please try this code and do not forget to download page-flip.mp3 file.You need to put the play sound code inside turning function &lt;audio id="audio" src="page-flip.mp3"&gt;&lt;/audio&gt; $('.flipbook').turn({ width:1000, height:680, elevation: 50, gradients: true, autoCenter: false, when: { turning: function(e, page, view) { var audio = document.getElementById("audio"); audio.play(); } } });

http://stackoverflow.com/a/28623113
answers question: http://stackoverflow.com/q/28622701
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: I would recommend to use String.Format for such long strings. Also be consistent with your usage of " and '. I always prefer using " for HTML attributes and ' for javascript strings. This is how it would look like with a String.Format: innerHtml.Append( String.Format( @" ${3} " , dt.Rows[i]["sku"].ToString() , link , dt.Rows[i]["Image"].ToString().Trim() , dt.Rows[i]["price"].ToString() ) ); I'd say this is much more readable and quote errors won't happen to often. In HTML it will look like:

http://stackoverflow.com/comment/45831097
type: AnswerComment
has text: I see you still have the older isotope CSS active. That may be an issue plus you seem to be adding some CSS3 animations?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28709490

http://stackoverflow.com/comment/45672325
has text: Nice. I am gonna do like this.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28690092
type: Comment

http://stackoverflow.com/comment/45523966
comment on: http://stackoverflow.com/a/28596512
score: 0
type: Comment
has text: Yeah, dude I've at this point I've answered your original question, but you didn't answer mine about your URL. Which is entirely a separate issue. I pasted in a working JS bin example.
type: AnswerComment

http://stackoverflow.com/comment/45573616
comment on: http://stackoverflow.com/q/28636187
score: 0
has text: I believe it should be `window.location.href` or am I missing something?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45638389
comment on: http://stackoverflow.com/q/28650417
score: 0
has text: i called this code when i click on the button from bootstrap-modal. there is no invalid ajax-request, but when a field is invalid and i click agein on the save-button from the modal (now that field is valid), the "onsubmit" event was called as often as a field was invalid.
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28622670
type: Answer
answers question: http://stackoverflow.com/q/28622553
has comment: http://stackoverflow.com/comment/45547953
score: 0
has body: you can try this like in css code=you can put this #prof { display:none; } in jquery code you can set like this $('#prof').css('background-image','url("images/select2.png")'); $('#prof').fadeIn("slow"); hopefully this may help
has comment: http://stackoverflow.com/comment/45552378

http://stackoverflow.com/a/28728832
type: AcceptedAnswer
has body: This has nothing to do with the async delay. Your kontaktdata array is local to the anonymous function you pass to setTimeout, so it simply doesn't exist in the context the template is evaluated in. Your data has to either be defined on the data model itself or in the global context. The other problem is that the data structure itself has to exist - either a kendo.data.DataSource or an array, and you need to update it with new data if you want an existing view to be aware of that new data. If you simply replace it, the edit template has no way of picking that up immediately (if you open a new edit dialog, it will also work, of course). So if you do this, for example, it will work: var kontaktdata = []; setTimeout(function(){ kontaktdata.push.apply(kontaktdata, [ { text: "Demo B Client", value: 1 }, { text: "Martin", value: 2 }, { text: "Herbert", value: 3 }]); }, 4000);
type: Answer
has comment: http://stackoverflow.com/comment/45760415
accepted answer of: http://stackoverflow.com/q/28720622
score: 0
answers question: http://stackoverflow.com/q/28720622

http://stackoverflow.com/comment/45602567
score: 0
has text: once you start chaining methods there is no built in way to do this. What would your use case be? You can compile a selector by following `parents()` back up the tree
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28652546

http://stackoverflow.com/comment/45772826
type: QuestionComment
has text: I'm on it. Thank you !
comment on: http://stackoverflow.com/q/28744275
score: 0
type: Comment

http://stackoverflow.com/a/28734643
type: Answer
has body: try this Name Salary Extension Start Date Start Date(American) Bloggs, Fred $12000.00 1353 18/08/2003 08/18/2003 Shakespeare, Hamnet $9000 9005 01/01/2002 01/01/2002 Mbogo, Arnold $32010.12 2755 09/08/1998 08/09/1998 Fitz, Marvin $3300 5554 22/05/1995 05/22/1995 Turvey, Kevin $191200.00 2342 02/05/1979 05/02/1979 Shakespeare, Bill $122000.00 3211 12/11/1961 11/12/1961 TOTAL $369510
score: 1
answers question: http://stackoverflow.com/q/28734543
upvote count: 2
downvote count: 1

http://stackoverflow.com/q/28648014
tagged with: arrays
downvote count: 0
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/28648383
favorite count: 0
upvote count: 1
possible better answer: http://stackoverflow.com/a/28648311
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28648311
score: 1
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/28648383
has title: Why can't I console log/stringify a whole array on Javascript?
type: Question
has body: so I am struggling trying to access a -somewhat- complex Array on Javascript. On a simple way, I have an array like so: globalForm['prop1'] = anotherArray[]; globalForm['prop2'] = yetAnotherArray[]; If I try to: console.log(globalForm); //-or- JSON.stringify(globalForm) I get an empty Array [] or an empty JSON object. But if I do this: console.log(globalForm['prop1']); //-or- JSON.stringify(globalForm['prop1']) I actually get its contents. Am I doing something wrong/stupid at trying to log or stringify the whole array? What I am trying to achieve is to create a complex JSON object from that array. This is my actual code: For prop1: var completedWeights = []; globalForm['CompletedFormPhoto'] = images; var radio_groups = {} $(".weightRadio:radio").each(function(){ radio_groups[this.name] = true; }); for(group in radio_groups){ thisGroup = $(".weightRadio:radio[name="+group+"]:checked"); if_checked = !!thisGroup.length; completedWeights.push({'IdWeight':thisGroup.attr('name'), 'Value':thisGroup.val()}); } globalForm['CompletedFormWeight'] = completedWeights; For prop2 (this actually executes before generating prop1): var fileInput = document.getElementById('fileInput'); var fileDisplayArea = document.getElementById('fileDisplayArea'); fileInput.addEventListener('change', function(e) { var idImg = Date.now(); var currentImageObj =[]; var file = fileInput.files[0]; var imageType = /image.*/; var addedImage = document.createElement('div'); addedImage.className = 'addedImage'; if (file.type.match(imageType)) { var reader = new FileReader(); reader.onload = function(e) { var img = new Image(); img.src = reader.result; img.id = idImg; addedImage.appendChild(img); var ind = img.src.indexOf(',/9j/') + 5; currentImageObj["Photo"] = img.src.substr(ind); images[idImg] = currentImageObj; } reader.readAsDataURL(file); console.log(images); } else { addedImage.innerHTML = "File not supported!"; } addComment = document.createElement('a'); addComment.className = "btn btn-default btn-bl…

http://stackoverflow.com/q/28648052
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28648201
tagged with: gridpanel
has body: I'm looking for a way to add a grid panel to my viewport, I tried to use the add() function but this didn't work for me. Ext.application({ name : 'MyApp', launch : function() { Ext.create('Ext.container.Viewport', { layout: 'border', items: [{ region: 'north', html: ' Page Title ', border: false, margin: '0 0 5 0' }, { region: 'west', title: 'Navigation', width: 250, collapsible: false, items : { // I want to add it just there xtype : 'gridPanel' } }, { region: 'south', title: 'South Panel', collapsible: true, html: 'test test', split: true, height: 100, minHeight: 100 }, { region: 'east', title: 'East Panel', collapsible: true, split: true, width: 150 }, { region: 'center', xtype: 'tabpanel', activeTab: 0, items: { title: 'test Tab', html: '' } }] }); } }); thx in advance,
tagged with: viewport
has title: Ext JS 5 - add grid panel to viewport
answer count: 1
has comment: http://stackoverflow.com/comment/45593824
tagged with: javascript
tagged with: extjs
score: 0
accepted answer: http://stackoverflow.com/a/28648201
type: Question

http://stackoverflow.com/comment/45625893
comment on: http://stackoverflow.com/a/28665133
type: Comment
has text: "pass in a template to use instead of hardcoding the template in the directive." Could you show an example of this? Thanks.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28722869
linked to: http://stackoverflow.com/q/3972872
upvote count: 21
type: AnsweredQuestion
has title: Does Python support object literal property value shorthand, a la ECMAScript 6?
has answer: http://stackoverflow.com/a/28723046
score: 21
accepted answer: http://stackoverflow.com/a/28723100
has comment: http://stackoverflow.com/comment/45732442
possible better answer: http://stackoverflow.com/a/28723046
type: Question
tagged with: ecmascript-6
has answer: http://stackoverflow.com/a/30727127
downvote count: 0
tagged with: javascript
has body: In ECMAScript 6, I can do something like this ... var id = 1; var name = 'John Doe'; var email = 'email@example.com'; var record = { id, name, email }; ... as a shorthand for this: var id = 1; var name = 'John Doe'; var email = 'email@example.com'; var record = { 'id': id, 'name': name, 'email': email }; Is there any similar feature in Python?
favorite count: 0
has comment: http://stackoverflow.com/comment/45732440
has answer: http://stackoverflow.com/a/71799595
tagged with: python
tagged with: dictionary
has answer: http://stackoverflow.com/a/28723100
answer count: 4

http://stackoverflow.com/comment/45674939
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28691790
has text: Have you added the mousewheel library?
score: 0

http://stackoverflow.com/comment/45655007
comment on: http://stackoverflow.com/a/28677315
score: 0
type: AnswerComment
type: Comment
has text: That's true. I'm still learning jQuery. Thanks for the update!

http://stackoverflow.com/q/28594676
has title: 500 error when trying to upload from Meteor using slingshot package
has comment: http://stackoverflow.com/comment/45532394
has comment: http://stackoverflow.com/comment/45500936
answer count: 0
type: UnansweredQuestion
has body: I am using the following Meteor Package https://atmospherejs.com/edgee/slingshot I have a javascript file in the server side that looks like this Slingshot.GoogleCloud.directiveDefault.GoogleSecretKey = Assets.getText('google-cloud-service-key.pem'); Slingshot.createDirective("myFileUploads", Slingshot.GoogleCloud, { bucket: "enwave", GoogleAccessId: "randomID", authorize: function () { //Deny uploads if user is not logged in. if (!this.userId) { var message = "Please login before posting files"; throw new Meteor.Error("Login Required", message); } return true; }, key: function (file) { //Store file into a directory by the user's username. var user = Meteor.users.findOne(this.userId); return user.username + "/" + file.name; } }); I have this on my client side 'change #fileUpload':function(event, template){ //evt.preventDefault(); var file = event.currentTarget.files[0]; console.log(file); var uploader = new Slingshot.Upload("myFileUploads"); uploader.send(document.getElementById('fileUpload').files[0], function (error, downloadUrl) { Meteor.users.update(Meteor.userId(), {$push: {"profile.files": downloadUrl} }); }); } I have this in my lib folder Slingshot.fileRestrictions("myFileUploads", { allowedFileTypes: ["image/png", "image/jpeg", "image/gif"], maxSize: 10 * 1024 * 1024 // 10 MB (use null for unlimited) }); and in /private folder I have a google-cloud-service-key.pem file that I converted after downloading from google cloud. I get this error when choosing a image in the file upload input POST https://enwave.storage.googleapis.com/ 500 (OK) debug.js:41 update failed: Access denied I must be doing something wrong, google says a 500 error in google cloud is a internal server error, but I must be doing something wrong, I highly doubt it is on googles end. I am also testing off of localhost if that might be it. Thanks in Advance for any help. After log the error in the console, this is what I get https://i.sstatic.net/pffI4.png This is the XML Response &lt;?xml ver…
tagged with: google-cloud-storage
type: Question
has comment: http://stackoverflow.com/comment/45499259
tagged with: javascript
tagged with: meteor-slingshot
has comment: http://stackoverflow.com/comment/45499487
score: 0
has comment: http://stackoverflow.com/comment/45518517
tagged with: meteor

http://stackoverflow.com/a/28640695
type: AcceptedAnswer
has body: Just use css .grid-item{ width: 100px; height: 100px; background: red; transition: all 300ms ease } .grid-item:hover{ width: 200px; height: 200px; } But if you really want to use jquery use try this $(".grid-item").hover( function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")}) .grid-item{ width: 100px; height: 100px; background: red; transition: all 300ms ease } .grid-item.hover{ width: 200px; height: 200px; } here is the same example with animate(your code is just working fine!) but using animate is bad since it will be buggy if you try to hover fast and back several times so use css please. $('.grid-item').hover(function(){ $(this).animate({ "width" : "200px", "height": "200px" }, "fast"); }, function(){ $(this).animate({ "width" : "100px", "height": "100px" }, "fast"); }); .grid-item{ width: 100px; height: 100px; background: red }
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45580483
accepted answer of: http://stackoverflow.com/q/28640661
upvote count: 2
answers question: http://stackoverflow.com/q/28640661

http://stackoverflow.com/q/28628594
score: 0
has answer: http://stackoverflow.com/a/28628628
accepted answer: http://stackoverflow.com/a/28628628
type: Question
has body: I need to extract: d101461b-a280-431c-b2bf-a3b200c6e575 from the below string https://training.shop4support.com/Resources/FileStorage/Products\\d101461b-a280-431c-b2bf-a3b200c6e575/St Stephen\u0027s Neighbourhood I've tried: var formattedGuid = guid.match('\\(.*)/').pop(); But because of the special characters such as '/' I'm getting an unexpected token error.
type: AnsweredQuestion
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Reg ex to get a substring within a string with special characters

http://stackoverflow.com/a/28685970
score: 0
has comment: http://stackoverflow.com/comment/45666368
has comment: http://stackoverflow.com/comment/45664529
has body: Neither row in {{#each row}} in the "cardsRow" template, nor {{text}} in the "cards" template, refer the way that you hope they do. You need to define row and text as template helpers for each of these templates. In a template helper, this refers to the data object associated with the template. In your case, when you iterate through #each cards in "container", this is passed into the "cardsRow" template as one of the chunks defined in your cards helper function. The helpers below should illustrate this, and are sufficient for your example. Template.cardsRow.helpers({ row: function() { console.log(this); // a chunk of cards return this; } }); Template.card.helpers({ text: function() { console.log(this); // a number in a chunk return this; } });
type: Answer
answers question: http://stackoverflow.com/q/28684704

http://stackoverflow.com/q/28678764
tagged with: javascript
has answer: http://stackoverflow.com/a/28680282
score: 0
answer count: 1
has body: This is the first time I've tried connection pooling. I designed a Node.js database connection module to create a single connection, which is referenced in a pooling function to be used later when passed to various modules. /* Database Connection */ //REQUIRE CUSTOM MODULES var mysql = require('mysql'); //DEFINE HELPER FUNCTIONS function createPool() { var pool = mysql.createPool({ dateStrings : true, host : '****', user : '****', password : '****', database : '****' }); return pool; } function queryFunc(connection, query, callback) { connection.query(query, function(err, rows) { if (err) { throw err; } else { connection.release(); callback(rows); } }); } //CREATE POOL var pool = createPool(); //DEFINE MODULE EXPORTS var connection = {}; connection.connect = function(query, callback) { if ( typeof query !== 'undefined') { debug.log('Performing Query: ' + query); //get connection via pool var connection = pool.getConnection(function(err, connection) { debug.log("New connection pool pulled"); if (err) { throw err; } else { //otherwise run all queries var qComplete = 0; queryFunc(connection, query, callback); } }); } else { debug.log('Oops! Tried to perform an empty query...'); } }; module.exports.connection = connection; Usage: var connection = require('connection.js').connection; connection.connect(...); And it tries to run the query (I know because I had to fix bad queries that it complained about) but gives me the error: TypeError: Object # has no method 'release' Did I build this pooling module wrong? If so, how can this be done correctly?
accepted answer: http://stackoverflow.com/a/28680282
tagged with: node.js
type: AnsweredQuestion
tagged with: mysql
type: Question
has title: Why does trying to release this Node-MySQL pool cause an error?

http://stackoverflow.com/q/28636498
has title: Rails selectize Gem installation
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28638102
has body: Trying to add selectize Source: http://brianreavis.github.io/selectize.js/ Gem source: https://github.com/manuelvanrijn/selectize-rails Added to Gemfile: gem "selectize-rails" Added application.js //= require selectize Added to application.css *= require selectize *= require selectize.default My form: &lt;%= f.select :user, User.not_god.map{|u| [u.to_s, u.id]}, { id: 'user-select' } %&gt; My JS: $('#user-select').selectize({ &lt;-- Uncaught TypeError: undefined is not a function create: true, sortField: 'text' }); This is giving me Uncaught TypeError: undefined is not a function Did anyone encounter this with selectize? Thanks a lot!
score: 0
tagged with: selectize.js
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/28638102
type: AnsweredQuestion

http://stackoverflow.com/a/28654960
has comment: http://stackoverflow.com/comment/45622665
score: 0
has comment: http://stackoverflow.com/comment/45622781
type: Answer
has comment: http://stackoverflow.com/comment/45622449
answers question: http://stackoverflow.com/q/28654645
has comment: http://stackoverflow.com/comment/45622951
has body: HTML Test Train Information from Indian Railways API Your train name is: Please enter train number: example.php <?php if(isset($_REQUEST['train'])){ $url = 'http://api.erail.in/route/?key=3d970b43-550b-4568-9227-492697f47093&trainno=' . $_REQUEST['train']; $data = file_get_contents($url); header('Content-Type: application/json'); echo $data; } else { echo json_encode(array("error" => "no data")); }

http://stackoverflow.com/comment/45593373
comment on: http://stackoverflow.com/a/28647719
type: AnswerComment
score: 0
has text: I have edited my answer. This is the complete syntax that is working for me (Twitter typeahead v0.10.5)
type: Comment

http://stackoverflow.com/a/28653960
type: Answer
has comment: http://stackoverflow.com/comment/45604918
has comment: http://stackoverflow.com/comment/45604940
accepted answer of: http://stackoverflow.com/q/28653939
has body: JavaScript foreach ( for(x in y) ) iterates over keys or indexes, not values so for(var sr in USERS) { console.log(sr + " IS " + USERS[sr].hasOwnProperty("username")); }
answers question: http://stackoverflow.com/q/28653939
type: AcceptedAnswer
score: 0

http://stackoverflow.com/comment/45754192
type: QuestionComment
has text: can you stringify the data before you post it?
comment on: http://stackoverflow.com/q/28734424
score: 0
type: Comment

http://stackoverflow.com/comment/46495356
comment on: http://stackoverflow.com/a/29104122
type: AnswerComment
type: Comment
score: 0
has text: Yeah, weird that the downvote went to both of us who did not get the answer marked as accepted. Something to research.

http://stackoverflow.com/q/28677145
has comment: http://stackoverflow.com/comment/45647533
has body: I got an issue while sorting arrays in webkit browsers. In firefox the sorting works very well but in chrome or safari it sorts only my last if() statement. For example in this code it sorts only this block: (The if conditions are tested and working) if(printCategory == printCategoryTour) { function compare (a, b) { return b.tour_naechtigungen - a.tour_naechtigungen }; chartDataRegions.sort(compare); pushValues(); } on this function: function chartDataSortArray() { arraySorted = []; if(printCategory == printCategoryBev) { function compare (a, b) { return b.bev - a.bev; }; chartDataRegions.sort(compare); pushValues(); } if(printCategory == printCategoryWirt) { function compare (a, b) { return b.wirt_unt_anzahl - a.wirt_unt_anzahl }; chartDataRegions.sort(compare); pushValues(); } if(printCategory == printCategoryMob) { function compare (a, b) { return b.mob_einpendler - a.mob_einpendler }; chartDataRegions.sort(compare); pushValues(); } if(printCategory == printCategoryTour) { function compare (a, b) { return b.tour_naechtigungen - a.tour_naechtigungen }; chartDataRegions.sort(compare); pushValues(); } function pushValues() { for(i = 0; i&lt;chartDataRegions.length; i++) { arraySorted.push(chartDataRegions[i]) } } Hmm i tried it now 2 hours but i dont get it to work ! Does anybody find the issue ?
answer count: 1
accepted answer: http://stackoverflow.com/a/28679226
favorite count: 0
has title: Issue to sort array in webkit browsers
has comment: http://stackoverflow.com/comment/45647908
type: AnsweredQuestion
score: 0
upvote count: 1
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/45647403
downvote count: 1
has comment: http://stackoverflow.com/comment/45647580
type: Question
has answer: http://stackoverflow.com/a/28679226
tagged with: firefox
tagged with: arrays
tagged with: javascript
tagged with: sorting

http://stackoverflow.com/comment/45740228
score: 0
type: Comment
type: QuestionComment
has text: Thanks for the replies. I see that it isn't possible in just html and javascript. I'm not using PHP but Webspeed (Progress OpenEdge), but it works the same way. At my serversite I have a database where the session are stored in and when the user log-outs, I set the session in the database not valid. But when the user presses the back-button in the browser, the page isn't actualy loaded but just displayed. I see that you mention cookies. So when the user logs out I could set a cookie. But how can I check that cookie when the user presses the back-button ? How can I capture that event ?
comment on: http://stackoverflow.com/q/28725622

http://stackoverflow.com/comment/45648306
comment on: http://stackoverflow.com/q/28677577
score: 0
type: Comment
type: QuestionComment
has text: The code block is to cryptic for me, where's the whole onchange function?

http://stackoverflow.com/comment/45596445
has text: Very strange man. Kind of baffled myself. I would have to sit down and hash it out. Would also need to see all the code involved
comment on: http://stackoverflow.com/a/28640308
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/119264680
type: AnswerComment
comment on: http://stackoverflow.com/a/28610447
score: 0
type: Comment
has text: This is a deprecated solution. See https://stackoverflow.com/a/46291530/2826713

http://stackoverflow.com/comment/45654409
has text: The primary use is for layout. If someone resizes an outer div, I want all the child divs to know that they have more or less room.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28680809
score: 0

http://stackoverflow.com/comment/45720980
has text: It seems that you changed some things like the IP, maybe there lies the problem. Is your file UTF-8 encoded?
comment on: http://stackoverflow.com/q/28716371
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/28700219
downvote count: 0
score: 6
answers question: http://stackoverflow.com/q/28700113
upvote count: 6
has body: At this part: var myArray = arraySize; do { parseInt(prompt("Please enter a number").value); } while (myArray &lt;= arraySize); you set myArray to arraySize, then you run then loop while myArray (which has been set to arraySize) is lower or equal to arraySize, and obviously, it will always be equal.
type: Answer

http://stackoverflow.com/q/28652950
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28653568
accepted answer: http://stackoverflow.com/a/28653568
has body: I'm intending to write a module that can be instantiated with default configuration and then overridden with custom configuration when initialized. The configuration object has nested objects, so I need to traverse over these nested objects if they are included in the custom configuration. I am attempting to do so by calling customize recursively. This works for the first nested object but the traversal ends after that object. Why is this and what can I do to fully traverse an object containing nested objects? function Config(options) { function customize(conf) { if (conf &amp;&amp; conf.constructor === Object) { for (var prop in conf) { if(conf[prop].constructor === Object) { return customize.call(this[prop], conf[prop]); } else { if (this.hasOwnProperty(prop)){ this[prop] = conf[prop]; } } } } else { console.error('The first argument must be an object.'); return; } } //Default config values this.foo = 'default'; this.bar = { foo: 'default' }; this.baz = { foo: 'default' }; //Overide default config with custom config if (options &amp;&amp; options.constructor === Object) { customize.call(this, options); } } function TestModule(){ this.init = function(options){ this.config = (options &amp;&amp; options.constructor === Object) ? new Config(options) : new Config(); return this; }; } console.log( new TestModule().init({ foo: 'custom', bar: {foo: 'custom'}, baz: {foo: 'custom'} }).config ); //RESULT // { // foo: 'custom', // bar: {foo: 'custom'}, // baz: {foo: 'default'} // }
has title: Recursion not fully traversing object with nested objects
type: AnsweredQuestion
tagged with: recursion
tagged with: tree-traversal
type: Question
score: 0

http://stackoverflow.com/a/28619927
downvote count: 1
upvote count: 33
answers question: http://stackoverflow.com/q/28619550
score: 32
type: Answer
has body: [EDIT] One should not use the FileReader API to load an user selected File into its page. Instead one should prefer the URL.createObjectURL(File) method. This will return a blobURI, only accessible from user session, which, in case of user File, is just a direct pointer to the original file, thus taking almost nothing in memory. input.onchange = function(e){ var sound = document.getElementById('sound'); sound.src = URL.createObjectURL(this.files[0]); // not really needed in this exact case, but since it is really important in other cases, // don't forget to revoke the blobURI when you don't need it sound.onend = function(e) { URL.revokeObjectURL(this.src); } } [Previous answer] You can't access the full url of a local file with input type="file". However you can read the file thanks to the file API input.onchange = function(){ var sound = document.getElementById('sound'); var reader = new FileReader(); reader.onload = function(e) { sound.src = this.result; sound.controls = true; sound.play(); }; reader.readAsDataURL(this.files[0]); }

http://stackoverflow.com/comment/45580790
comment on: http://stackoverflow.com/q/28640743
score: 0
has text: @bobdye and can that be done with a javascript function? Basically what it's sounding like is it will be easier for me just to change it manually each time I update it
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45602715
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28652196
type: Comment
has text: @RobG - so are you recommending that you program with `with` and therefore don't use `strict` mode? And, do you think the advantages of strict mode are a controversial opinion?

http://stackoverflow.com/comment/45613696
has text: @www139 could you demonstrate what you mean please? cheers
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28658621
score: 0

http://stackoverflow.com/comment/45759811
type: AnswerComment
has text: I tried your code in IE11 and Google chrome 40 and all return values are false
type: Comment
comment on: http://stackoverflow.com/a/28737794
score: 0

http://stackoverflow.com/a/28761395
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28740636
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45841496
has comment: http://stackoverflow.com/comment/45814741
has comment: http://stackoverflow.com/comment/45838999
has body: I'm not sure I correctly understood your question, but based on: In the parent page I include the javascript for the editor: My answer is - you have to include ckeditor.js in the same document in which you use it.
has comment: http://stackoverflow.com/comment/45826958
has comment: http://stackoverflow.com/comment/45840736
answers question: http://stackoverflow.com/q/28740636

google-maps-markers
tags question: http://stackoverflow.com/q/28627831
tag name: google-maps-markers
tags question: http://stackoverflow.com/q/28653570
tags question: http://stackoverflow.com/q/28687094
type: Tag
tags question: http://stackoverflow.com/q/28634184

http://stackoverflow.com/q/28659148
has body: In a Direct method called from a javascript into a cshtml page I have the following last line of code : Response.BinaryWrite(arrayret); Response.End(); return this.Direct(); The method export a gridview in excel. After the method is finished the control pass to the view and I have the error "Error executing child request for handler 'Ext.Net.SelfRenderingPage' after response.end". The context is the same I have exposed in my past post. n my cshtml file i have the following code in script section : var exportExcel = function() { App.PNLCenter.body.mask('Export'); Ext.net.DirectMethod.request({ url: "ExportExcel", cleanRequest: true, isUpload: true, params: { data: App.gridAllBdg.getRowsValues() } }); App.PNLCenter.body.unmask(); }; in the page code i have a button deslared as shown below : Html.X().Button() Text("Esporta") ID("Esporta") .Handler("exportExcel()") .Icon(Icon.PageExcel) .Disabled(false) .StandOut(false) and in the controller I have the direct method declared as shown below : public ActionResult ExportExcel(string data) { //Actions Response.Close(); return this.Direct(); } Wneh the direct method pass the control to the main page I got the error in the line of the cshtml layout invoking the ResourceManager: @Html.X().ResourceManager().StateProvider(StateProvider.Cookie).FormID("idmv") that says Error executing child request for handler 'Ext.Net.SelfRenderingPage' The problem seems related to the Respose.End() that is necessary to close the stream od the exported excel file.
tagged with: controller
score: 0
has comment: http://stackoverflow.com/comment/45638703
type: UnansweredQuestion
tagged with: view
answer count: 0
has comment: http://stackoverflow.com/comment/45651825
has title: Error executing child request for handler 'Ext.Net.SelfRenderingPage' after response.end
has comment: http://stackoverflow.com/comment/45646917
type: Question
tagged with: c#
tagged with: javascript
tagged with: ext.net

http://stackoverflow.com/comment/45633916
score: 0
comment on: http://stackoverflow.com/a/28667322
has text: You'll have to check with your hosting. But if you can add the header of the response, you're good to go. Mozilla's developer network has great info on this with examples: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#The_HTTP_request_headers
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45615052
type: AnswerComment
score: 0
type: Comment
has text: I just edited the comment, what I meant is that if I overwrote `submit` then calling it wouldn't trigger submit listeners
comment on: http://stackoverflow.com/a/28659659

http://stackoverflow.com/q/28609921
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
answer count: 2
has comment: http://stackoverflow.com/comment/45525737
has comment: http://stackoverflow.com/comment/45526134
upvote count: 0
has body: I have a table with 3 column id, B_title, B_category like this I want dynamically load Json data (for B_category column but without returning the duplicated value) into a ListView using PDO. display for each row in listview his counter of duplicated values example Fiction counter=3 Humour counter=3 Business counter=2 I want result of JSON array looks like this : {"books":[{"B_category":"Fiction","counter":"3"},{"B_category":"Humour","counter":"3"},{"B_category":"Business","counter":"2"}]}
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45526188
tagged with: android
tagged with: php
has comment: http://stackoverflow.com/comment/45525957
downvote count: 2
has answer: http://stackoverflow.com/a/28610355
type: Question
has title: I need help in PDO and JSON
has answer: http://stackoverflow.com/a/28683829
score: -2

http://stackoverflow.com/q/28629432
type: Question
has comment: http://stackoverflow.com/comment/45559623
has comment: http://stackoverflow.com/comment/45559657
has comment: http://stackoverflow.com/comment/45559285
accepted answer: http://stackoverflow.com/a/28629714
score: 0
has body: I have the following snippet in my directive template '&lt;li ng-repeat="f in foos"&gt;' + '&lt;input type="radio" ng-change="foo(f.key)" ng-model="selectedFoo" name="foos" id="{{f.key}}" value="{{f.key}}"&gt;{{f.value}}&lt;/input&gt;' + '&lt;/li&gt;' + In my link method I have scope.foos = [ { key: 'a', value: 'A', checked: true, symbol: 'a' }, { key: 'b', value: 'B', symbol: 'b' }, { key: 'c', value: 'C', symbol: 'c' } ]; scope.selectedFoo = "a"; I have method foo that does this scope.foo = function(selectedValue) { scope.selectedMatchType = selectedValue; }; There are two problems that I am facing Even though I have set ng-model to selectedFoo, the first element in the dropdown is not set by default when the radio buttons get rendered. The method foo is only called once for each element in the list. So, for example if I click on A, foo is called, if I then click on B, foo is called, if I click on A again foo is not called, but if I then click on C, foo is calle. What is wrong here?
has comment: http://stackoverflow.com/comment/45559197
answer count: 1
has title: AngularJs: Radio Button Not Selected By Default
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28629714
tagged with: javascript
tagged with: angularjs

http://stackoverflow.com/comment/45724111
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28717059
has text: @George Nemes. It is a contrived example. All I want to do is learn how to declare a class within another class in typescript. The duplicate link has helped though and seems to work
score: 0

http://stackoverflow.com/comment/118163359
has text: OMG!, In my case the `modal-open` class is on the `html` tag :(. So, my code `$('html').removeClass('modal-open');`
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28907348

http://stackoverflow.com/q/28724169
has body: I'm using Bluebird promises and trying to get below function with Promisify working: var jwt = require('jsonwebtoken'); function _test_encode() { var cert = fs.readFileSync('public.pub'); return jwt.verify(token, cert, function(err, decoded) { console.log(decoded); }); } I tried below: var jwt = require('jsonwebtoken'); var Promise = require('bluebird'); var jwtVerifyAsync = Promise.promisify(jwt.verify); function _test_encode() { var cert = fs.readFileSync('public.pub'); // get public key return jwtVerifyAsync(token, cert).then(function(decoded) { console.log(decoded); }); } But I'm getting: Possibly unhandled TypeError: Object #&lt;Object&gt; has no method 'decode' Is there something I'm missing here that I need to get it working? I just want to get _test_encode function to return result of the promise and use it in my other functions. Verify function is below: module.exports.verify = function(jwtString, secretOrPublicKey, options, callback) { if ((typeof options === 'function') &amp;&amp; !callback) { callback = options; options = {}; } if (!options) options = {}; var done; if (callback) { done = function() { var args = Array.prototype.slice.call(arguments, 0); return process.nextTick(function() { callback.apply(null, args); }); }; } else { done = function(err, data) { if (err) throw err; return data; }; } if (!jwtString){ return done(new JsonWebTokenError('jwt must be provided')); } var parts = jwtString.split('.'); if (parts.length !== 3){ return done(new JsonWebTokenError('jwt malformed')); } if (parts[2].trim() === '' &amp;&amp; secretOrPublicKey){ return done(new JsonWebTokenError('jwt signature is required')); } var valid; try { valid = jws.verify(jwtString, secretOrPublicKey); } catch (e) { return done(e); } if (!valid) return done(new JsonWebTokenError('invalid signature')); var payload; try { payload = this.decode(jwtString); } catch(err) { return done(err); } if (typeof payload.exp !== 'undefined') { if (typeof payload.exp !== 'number') { return done(ne…
has answer: http://stackoverflow.com/a/28724520
has comment: http://stackoverflow.com/comment/45735355
accepted answer: http://stackoverflow.com/a/28724520
answer count: 3
linked to: http://stackoverflow.com/q/22419382
favorite count: 0
has comment: http://stackoverflow.com/comment/45735781
tagged with: promise
upvote count: 5
tagged with: node.js
type: AnsweredQuestion
has title: How to turn callback function with Promise
tagged with: bluebird
downvote count: 0
possible better answer: http://stackoverflow.com/a/41666882
has answer: http://stackoverflow.com/a/41666882
type: Question
has comment: http://stackoverflow.com/comment/45735279
has answer: http://stackoverflow.com/a/67969889
score: 5
tagged with: javascript

http://stackoverflow.com/comment/45608241
type: AnswerComment
type: Comment
has text: Their was a typo mistake, Corrected now, Please check the updated code.
score: 0
comment on: http://stackoverflow.com/a/28655802

http://stackoverflow.com/comment/45549534
score: 0
has text: file name is constants.js sorry for the typo in the question, yes I only added /, as when I moved the view to folder it showed error that import folder does not exist, adding / seemed to fix that. But I think the variables in the file still cant be accessed. Is there anything more I have to do?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28623809

http://stackoverflow.com/a/28683961
has body: When I needed something like that, I've used getJSON(), which is a shorthand to what you want. You can use it like that: $.getJSON('file.json', function(data) { // Do something with your data }); But, first of all, check your JSON. The JSON you shared is invalid, because it has a comma that shouldn't be there. I always use validators like JSONLint to be sure about that. Hope it helps!
downvote count: 0
score: 1
type: AcceptedAnswer
upvote count: 1
answers question: http://stackoverflow.com/q/28683615
type: Answer
accepted answer of: http://stackoverflow.com/q/28683615

http://stackoverflow.com/a/28674756
has comment: http://stackoverflow.com/comment/45643103
type: Answer
upvote count: 1
has body: The target-URL would be: https://www.google.com/maps/dir//{encodedAddress} Note the 2 slashes after dir, when you use 1 slash the address would be used as start-address. The address must be encoded (e.g. via encodeURIComponent) Sample-button(uses his textContent as address): Berlin
answers question: http://stackoverflow.com/q/28674279
score: 1
has comment: http://stackoverflow.com/comment/45643350
has comment: http://stackoverflow.com/comment/73939898
downvote count: 0

http://stackoverflow.com/comment/45506958
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28600564
has text: @karaokyo Handlebars !! yes something like this i am looking for . !

http://stackoverflow.com/q/28602489
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/49888759
favorite count: 0
has comment: http://stackoverflow.com/comment/93539991
tagged with: http://stackoverflow.com/tag/html
has body: I have used bootstrap for a layout in my application. The whole page is divided in 2X2 div, I want to freeze the top row and 1st column. How can i do so? Below is the diagram to depict my requirement.
tagged with: css
has title: freezing first row and column in bootstrap
tagged with: twitter-bootstrap
upvote count: 3
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28603129
linked to: http://stackoverflow.com/q/45071085
type: Question
score: 3
has answer: http://stackoverflow.com/a/28602994
answer count: 3

http://stackoverflow.com/a/28636185
answers question: http://stackoverflow.com/q/28635350
score: 0
type: Answer
has body: Not sure if I am interpreting the question correctly but maybe you can just use something like TinyURL API? http://www.tiny-url.info/open_api.html (Example from website) $lurl = $_POST['long_url']; $curl = curl_init(); $post_data = array('format' =&gt; 'json', 'apikey' =&gt; 'YOUR_API_KEY', 'provider' =&gt; 'PROVIDER_STRING', 'url' =&gt; $lurl ); $api_url = 'http://tiny-url.info/api/v1/create'; curl_setopt($curl, CURLOPT_URL, $api_url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data); $result = curl_exec($curl); curl_close($curl); echo $result; Another way is to just programmatically have a redirect link? That would differ based on what backend you use but could look something like the following: For the route xxxx/&lt;account/digitalgood_id&gt;/&lt;date&gt;: if date is older than a week: say it is expired otherwise: redirect to page/&lt;account/digitalgood_id&gt; which accesses to the S3 info

http://stackoverflow.com/comment/45744487
has text: You are right. Any idea on how to rewrite the call to `kue.Job.get` in order to get the answer in the scope of the `find` callback?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28729046
score: 0

http://stackoverflow.com/a/28629380
answers question: http://stackoverflow.com/q/28629265
score: 1
upvote count: 1
type: Answer
has body: You won't be able to submit form data without a page refresh, unless you submit the data asynchronously via XHR. It sounds like you are submitting synchronously via HTTP POST or GET at /home, which would result in a page refresh. You will need to write some Angular code to take the values from the form controls and submit it via XHR POST or GET. It's two quite different approaches so may be difficult to write something reusable. Essentially one is a plain old HTML methodology whereas the other requires a a bit more sophistication and some Javascript.
downvote count: 0

http://stackoverflow.com/a/28651926
has comment: http://stackoverflow.com/comment/45601306
has comment: http://stackoverflow.com/comment/45601254
type: Answer
has comment: http://stackoverflow.com/comment/45601342
has comment: http://stackoverflow.com/comment/45601189
answers question: http://stackoverflow.com/q/28651892
has comment: http://stackoverflow.com/comment/45601259
score: 0
has body: Is this what you're looking for? http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes This shows the mapping of keyboard characters to the KeyCode value.

http://stackoverflow.com/q/28630514
tagged with: ajax
has title: Prevent previously requests on click
accepted answer: http://stackoverflow.com/a/28630887
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28630887
type: Question
has body: I have list of tables, &lt;table id="&lt;%#DataBinder.Eval(Container.DataItem, "Certificate")%&gt;" class="tbl_evenSearchResultRow" onmouseover="this.className='ResultGridRowSeleted'" onmouseout="this.className='tbl_evenSearchResultRow'" onclick="return SynopsisWindowOpen(this)"&gt; onclick of each i use next function: function SynopsisWindowOpen(obj) { var title = $(obj).find("strong[name='title']").html(); var isParentools = 0; if (window.location.href.indexOf('recent_releases.aspx') &gt; -1) isParentools = 1; var url = "/ratings/Synopsis.aspx?logoonly=1&amp;Certificate=" + obj.id + "&amp;Title=" + encodeURIComponent(title) + "&amp;parentools=" + isParentools; $("#ratingModal").on("show.bs.modal", function (e) { $.ajax({ url: url, cache: false, dataType: "html", success: function (data) { $("#ratingModal").find(".modal-body").html(data); } }); }); $("#ratingModal").on("hide.bs.modal", function (e) { $(this).find(".modal-body").html(''); }); $("#ratingModal").modal('show'); return false; } By url i render body of modal : i get certificate from request.query and according to it render body LoadSynopsisContent(Request.QueryString["Certificate"], Request.QueryString["parentools"]); Problem : when i click at first - everything seems to be good, on second click in modal body firstly rendered body of first click and then of second click. And so on. I don't know where is problem. Firstly i use jquery load function, but then i change to simple ajax call with disabled caching.
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: asp.net

http://stackoverflow.com/q/28659717
has comment: http://stackoverflow.com/comment/45615139
score: 0
has title: Regex anything(including new lines) up to certain sequence - multiple substrings JS
type: Question
has body: The File I am trying to process looks like this: ... ... 15 Apr 2014 22:05 - id: content 15 Apr 2014 22:09 - id: content 15 Apr 2014 22:09 - id: content with new line 16 Apr 2014 06:56 - id: content with new line with new line 16 Apr 2014 06:57 - id: content 16 Apr 2014 06:58 - id: content ... ... the regex I have come up with is this: \d{1,}[ ][A-Z][a-z]{2}[ ](?:\d{4}[ ]\d{2}[:]\d{2}|\d{2}[:]\d{2}).* which results in: This is almost right i just need to include newline characters, but if i include this [\s\S]* instead of .* only one match is returned. What i would like to extract is a set of substrings where each string starts at the data sequence and ends at the next date sequence like so: ... ... 15 Apr 2014 22:05 - id: content //substring 1 15 Apr 2014 22:09 - id: content //substring 2 15 Apr 2014 22:09 - id: content //substring 3 with new line //substring 3 16 Apr 2014 06:56 - id: content //substring 4 with new line //substring 4 with new line //substring 4 16 Apr 2014 06:57 - id: content //substring 5 16 Apr 2014 06:58 - id: content //substring 6 ... ... Any help to what im missing?
has answer: http://stackoverflow.com/a/28659889
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45615049
possible better answer: http://stackoverflow.com/a/28659767
accepted answer: http://stackoverflow.com/a/28659889
has answer: http://stackoverflow.com/a/28659767
linked to: http://stackoverflow.com/q/1979884
tagged with: regex
type: AnsweredQuestion

http://stackoverflow.com/comment/45501474
has text: Nothing. Running your code on this page and seeing the error in the console. Safari on a Mac. Here's a link to my live site: http://pa-nature.supermarchepa.com/delivery-zone.html
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28595710
type: Comment

http://stackoverflow.com/q/28645660
has body: I've multiple sprite in my view, i want to make an animation to that sprite using Ext.fx.Animator to My Header component, but I get stuck how to do that. This's my Sprite component: var sprite = Ext.create('Ext.draw.Component', { items: [{ type: "text", text: "Bla... Bla... Bla...", fill: "white", font: "18px monospace" }] }); This is my Header : Ext.define('APP.view.Header', { extend: 'Ext.Component', xtype: 'appHeader', dock: 'top', baseCls: 'app-header', initComponent: function() { Ext.applyIf(this, { html: 'I want to place my sprite in here' }); this.callParent(arguments); } }); My problem is : Can I use Ext.fx.Animator to control Opacity my sprite ? How to ? How to make my sprite walking left to right and the other way ? How to do that ? May be somebody know about that ? I've search this over on google but no luck finding a way to do that.
tagged with: javascript
has comment: http://stackoverflow.com/comment/45597160
type: UnansweredQuestion
tagged with: animation
tagged with: extjs-mvc
tagged with: css
tagged with: extjs4.2
answer count: 0
score: 0
has title: ExtJS 4 : How to animate a sprite component using Ext.fx.Animator?
has comment: http://stackoverflow.com/comment/45611938
type: Question

http://stackoverflow.com/q/28657264
has body: page1 page2 I tried following javascript but only works when div content is less than defined height
has comment: http://stackoverflow.com/comment/45610699
has comment: http://stackoverflow.com/comment/45610983
tagged with: css
tagged with: twitter-bootstrap-3
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28658232
has answer: http://stackoverflow.com/a/28668503
type: Question
has title: responsive design with windows height 100% and push sibling divs when parent divs content is greater than defined height
answer count: 2
has comment: http://stackoverflow.com/comment/45611115
has comment: http://stackoverflow.com/comment/45611483
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45535043
type: AnswerComment
has text: I took your advice about using the console and found some of the issues I was overlooking in my code but it isn't grabbing the correct choice from the radio buttons (just taking the last one) and I'm still unable to get the values entered into the text fields. It generates the URL but rather than putting it into the empty address field like I expected it is clearing everything but the title from the page and place the URL under the title.
type: Comment
comment on: http://stackoverflow.com/a/28613437
score: 0

http://stackoverflow.com/comment/45524232
has text: can you give me the correct code with updated one. As I am confused here what to use and what to not
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28610212

http://stackoverflow.com/comment/45518030
has text: Hmmm... I am missing some code to see what have you done already and where you got stuck...
comment on: http://stackoverflow.com/q/28606985
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28707405
has body: Page1.php (I have the same function button for alots but diferent ID) when they its load from page with ajax dont works Page2.php Only work at first time but when push reload the script (alert) dont work again, i can see the page its loaded fine but script no.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28707471
has answer: http://stackoverflow.com/a/28707467
type: Question
accepted answer: http://stackoverflow.com/a/28707471
has title: jquery dont work when button its calling from ajax
possible better answer: http://stackoverflow.com/a/28707467
tagged with: javascript
linked to: http://stackoverflow.com/q/12824549
score: 0
answer count: 2
linked to: http://stackoverflow.com/q/203198
tagged with: jquery
duplicate of: http://stackoverflow.com/q/203198
tagged with: ajax
tagged with: php

http://stackoverflow.com/comment/45611294
comment on: http://stackoverflow.com/q/28657586
type: Comment
type: QuestionComment
has text: That would kind of depend on the code you haven't shown, no?
score: 1

http://stackoverflow.com/q/28678307
favorite count: 0
tagged with: ajax
tagged with: symfony
tagged with: php
linked to: http://stackoverflow.com/q/28611087
tagged with: fosuserbundle
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45650645
has title: FOSUserBundle AJAX Login with Symfony2 (routing)
score: 4
upvote count: 4
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28947727
tagged with: javascript
has comment: http://stackoverflow.com/comment/45650938
has body: I'm trying to make the AJAX authentication work with FOSUserBundle. I have created an Handler directory with a AuthenticationHandler class : &lt;?php namespace BirdOffice\UserBundle\Handler; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\Routing\RouterInterface; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Security\Core\SecurityContextInterface; use Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface; use Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface; class AuthenticationHandler implements AuthenticationSuccessHandlerInterface, AuthenticationFailureHandlerInterface { private $router; private $session; /** * Constructor * * @param RouterInterface $router * @param Session $session */ public function __construct( RouterInterface $router, Session $session ) { $this-&gt;router = $router; $this-&gt;session = $session; } /** * onAuthenticationSuccess * * @param Request $request * @param TokenInterface $token * @return Response */ public function onAuthenticationSuccess( Request $request, TokenInterface $token ) { // if AJAX login if ( $request-&gt;isXmlHttpRequest() ) { $array = array( 'success' =&gt; true ); // data to return via JSON $response = new Response( json_encode( $array ) ); $response-&gt;headers-&gt;set( 'Content-Type', 'application/json' ); return $response; // if form login } else { if ( $this-&gt;session-&gt;get('_security.main.target_path' ) ) { $url = $this-&gt;session-&gt;get( '_security.main.target_path' ); } else { $url = $this-&gt;router-&gt;generate( 'home_page' ); } // end if return new RedirectResponse( $url ); } } /** * onAuthenticationFailure * * @param Request $request * @param Authe…

http://stackoverflow.com/comment/45577187
type: Comment
has text: This! the `instanceof Attr` was exactly what I was looking for. I've tried `typeof x` to see if I get a different type to exclude the ones I'm not looking for but it returned `string` for all.
score: 0
comment on: http://stackoverflow.com/a/28638488
type: AnswerComment

http://stackoverflow.com/a/28687951
upvote count: 3
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28687912
has body: Syntax error is because the object key cannot be directly evaluated in that notation. You'd have to do something like this: obj2 = {}; obj2[obj1.a] = 'c'; obj2[obj1.a]; For more information: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects What is going on at a deeper level is the { } syntax is using an object initializer to construct the object. The property name of the syntax requires a name, a number, or a string literal. Evaluation of another object does not meet this requirement.
score: 3
accepted answer of: http://stackoverflow.com/q/28687912

http://stackoverflow.com/q/28646571
has comment: http://stackoverflow.com/comment/45594833
has comment: http://stackoverflow.com/comment/45611693
tagged with: javascript
has body: It's a huge title, but it tells about everything, but let me clarify. I have generator that produces a HTMLstring for an input field (range, checkbox, ...). This massive string then gets placed in the HTML via $templateCache.put('dynamicSettings, htmlString) Example of a possible string: var htmlString = "&lt;input type='range' min='0' max='10' value='5' ng-model='sliderBrightness' ng-change='settingsInputChanged(sliderBrightness, 'sliderBrightness')'&gt;"; When I hardcode this string in my HTML file, it works perfectly. The settingsInputChanged() function gets called and 2 parameters are passed, the value and the unique name. The function then saves the value in the localStorage with the keyvalue (2nd parameter). But when adding the string dynamically, I get this massive error of which I presume has something to do with the fact that I'm passing a String in the ng-change. rror: [$parse:syntax] Syntax Error: Token 'undefined' not a primary expression at column null of the expression [settingsInputChanged(sliderBrightness,] starting at [settingsInputChanged(sliderBrightness,]. Or maybe it can't handle that I have 2 '-pairs nested. Can I change my string to not use those '-pairs to pass my string to the function in the ng-change?
upvote count: 1
downvote count: 0
tagged with: string
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has title: Pass value and unique identifier to function with ng-change with dynamic content
tagged with: dynamic
answer count: 0
score: 1
type: Question

http://stackoverflow.com/a/28713784
answers question: http://stackoverflow.com/q/28712817
has body: ngBindHtml don't compile your HTML. So, all angular directives from your dynamic HTML(ng-if, ng-src, ng-click, etc..) will not work. To really compile your html you can use $compile service like that: $compile(html)($scope) But it's not a true way for angular. If you want to modify DOM structure - you need to use directives. In your case you can include that html to template itself instead of add it dynamically: &lt;div ng-show="showYourHtml"&gt; &lt;img ng-src="logo.png" ng-click="main.cancelFileUpload(chat,msg_id)"/&gt; &lt;/div&gt; And your controler: ... if(conditions){ $scope.showYourHtml = true; } ...
score: 0
type: Answer

http://stackoverflow.com/q/28647113
type: AnsweredQuestion
score: 2
has title: Cross-browser JS Filesystem API
has answer: http://stackoverflow.com/a/35853794
type: Question
has comment: http://stackoverflow.com/comment/45591962
tagged with: mobile
tagged with: javascript
has comment: http://stackoverflow.com/comment/45591884
has body: I'm aware of the JS Filesystem API for reading/writing files in the Chrome sandbox. But I cannot find a W3C standard that does the same, is there a cross-browser way to read/write files on major browsers? Thanks
has comment: http://stackoverflow.com/comment/45591933
accepted answer: http://stackoverflow.com/a/35853794
answer count: 1
downvote count: 0
tagged with: cross-browser
tagged with: html5-filesystem
favorite count: 0
has comment: http://stackoverflow.com/comment/45592001
upvote count: 2

tree
tags question: http://stackoverflow.com/q/28615822
tags question: http://stackoverflow.com/q/28599195
type: Tag
tags question: http://stackoverflow.com/q/28670614
tags question: http://stackoverflow.com/q/28717674
tags question: http://stackoverflow.com/q/28695348
tag name: tree
tags question: http://stackoverflow.com/q/28678092

http://stackoverflow.com/comment/45742673
type: AnswerComment
score: 0
type: Comment
has text: I think you are saying that you need the users' changes to be persistent, so that next time the page is refreshed the div still contains the modified contents, right? You have two choices: (1) store the data in a database (MySQL?) and with each page view/refresh, load the data from the DB and write into that div, or (2) save the data for that div into a file on the server and do as in (1). Please do yourself an enormous favor and do the tutorials at PHPAcademy -- if you had done them last night, you would know how to do this now. Best wishes for your project.
comment on: http://stackoverflow.com/a/28711026

http://stackoverflow.com/comment/45742545
type: AnswerComment
type: Comment
has text: @AndrewTristan, it is pretty trivial to create one of your own
comment on: http://stackoverflow.com/a/28728081
score: 1

http://stackoverflow.com/comment/45771345
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28744156
type: AnswerComment
has text: didn't work, I managed to remove with fadeOut by $("#tblGraphPattern tr").fadeOut(300, function(){ $("#tblGraphPattern tr").remove(); }); but with your code the newRow is not visible at all

http://stackoverflow.com/q/28734543
tagged with: javascript
has body: I have this source code: Name Salary Extension Start Date Start Date(American) Bloggs, Fred $12000.00 1353 18/08/2003 08/18/2003 Shakespeare, Hamnet $9000 9005 01/01/2002 01/01/2002 Mbogo, Arnold $32010.12 2755 09/08/1998 08/09/1998 Fitz, Marvin $3300 5554 22/05/1995 05/22/1995 Turvey, Kevin $191200.00 2342 02/05/1979 05/02/1979 Shakespeare, Bill $122000.00 3211 12/11/1961 11/12/1961 TOTAL $369510 I works fine on PC by sorting the table, But when I upload this HTML file to my host, the sort table doesn't work. Could the host be disabling Javascript for me? I using GoogleDrive to host. I have tried Dropbox, but it doesn't work either. Example table: https://2cdf7d8230e2b51a89d897a354b906bcb02dfca8.googledrive.com/host/0B_WPAWweGO9mfnpGM1FNR0pLZ1VEQlJHQzNJMGRrd3hwaW9WTjg0aE91MG1uZkhCQzJWRzQ/heroes-data.html
answer count: 3
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
downvote count: 2
has answer: http://stackoverflow.com/a/28734615
has answer: http://stackoverflow.com/a/28734643
possible better answer: http://stackoverflow.com/a/28734579
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28734579
type: Question
has title: Why I can't use javascript any hosting (Except PC)
accepted answer: http://stackoverflow.com/a/28734615
upvote count: 0
score: -2

http://stackoverflow.com/comment/45684545
type: Comment
type: QuestionComment
has text: Validate where. Client?, Server? In JAVA?, in PHP?
comment on: http://stackoverflow.com/q/28697082
score: 0

http://stackoverflow.com/q/28692345
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I had a simple to-do list app that worked fine, recently I overhauled the app using Bootstrap, before I wasnt using any css framework. Now the jQuery is not working properly... Why is this? Here is the relevent HTML: Add Item This is my Javascript code: $(function() { // configuration // button var add = $('#add'); // list container var listContainer = $('#list'); // click event for button add.on('click', function() { // value of input inputValue = $('#input').val(); // add new list item listContainer.prepend(' ' + inputValue + ' '); // clear value input $('#input').val(''); }); });
type: AnsweredQuestion
has title: Adding list item using jQuery and Bootstrap
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/45676426
has answer: http://stackoverflow.com/a/28692547
accepted answer: http://stackoverflow.com/a/28692547
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45676560
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/45675947

http://stackoverflow.com/q/28594965
has comment: http://stackoverflow.com/comment/45496791
answer count: 1
tagged with: jquery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28595526
tagged with: bootstrap-datetimepicker
has comment: http://stackoverflow.com/comment/127657158
has body: Using Javascript, how can I attach an event listener for when the datetime has been changed in the Bootstrap DatetimePicker (Homepage) However the above function isn't getting fired when I change the date either by using keyboard or the mouse (point and click). The HTML Looks like this: Date If someone would advise the correct way to do this, I would be most appreciative.
type: Question
has title: Attach Event to Bootstrap DatetimePicker
tagged with: javascript
has comment: http://stackoverflow.com/comment/45497633
score: 0
tagged with: jquery-events

http://stackoverflow.com/a/28749225
score: 1
has body: The top margin for prev and next (standard prev/next buttons?) is causing that problem because it affects the "next" status of the slider items. #main-slider .prev, #main-slider .next { position: absolute; top: 50%; background-color: #c52d2f; color: #fff; display: inline-block; /* margin-top: -25px; */ height: 40px; line-height: 40px; width: 40px; line-height: 40px; text-align: center; border-radius: 4px; z-index: 5; }
upvote count: 1
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/28748684
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28748684

http://stackoverflow.com/comment/45670332
type: Comment
type: QuestionComment
score: 1
has text: As far as the refreshing of page is concerned, the socket will disconnect. But there is a property named reconnection you can set on client while connecting to your server. var socket = io('yourhost:port', {reconnection: true}); This will not enforce a new connection.
comment on: http://stackoverflow.com/q/28663886

http://stackoverflow.com/comment/45519308
type: Comment
has text: http://stackoverflow.com/questions/28607669/how-to-save-the-content-of-each-column-of-a-row-in-a-jqueyr-array
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28603625

http://stackoverflow.com/a/28693182
answers question: http://stackoverflow.com/q/28693082
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45677538
has body: It is not setInnerHtml, textarea has a value attribute. Not really logical but well... mad you a fiddle: document.getElementById("bla").value = "test"; Initial Value
upvote count: 1
type: Answer

http://stackoverflow.com/comment/45574918
score: 0
type: AnswerComment
has text: It would seem that only indicates whether or not a range of text is selected, vs there just being a caret on the page somewhere. A. this doesn't help me get any information about a particular input field, and B. it doesn't help me figure out if the caret is in a field.
type: Comment
comment on: http://stackoverflow.com/a/28625830

http://stackoverflow.com/a/28713506
downvote count: 0
answers question: http://stackoverflow.com/q/28712378
type: Answer
score: 4
upvote count: 4
has body: you can add a span tag next to the image and have that positioned over the image. Also, have the html code (&amp;#10004;) for tick mark within the span. I have written a small modification of your function. JSFiddle Sample code: http://jsfiddle.net/hz8q9z17/3/ var ImageSelector = function() { var imgs = null; var selImg = null; return { addImages: function(container) { imgs = container.getElementsByTagName("img"); for (var i = 0, len = imgs.length; i &lt; len; i++) { var img = imgs[i]; img.className = "normal"; img.nextSibling.className = "normal"; img.onclick = function() { if (selImg) { selImg.className = "normal"; selImg.nextSibling.className = "normal"; } this.className = "highlighted"; this.nextSibling.className = "highlighted"; selImg = this; }; } } }; }(); var div = document.getElementById("textbox"); ImageSelector.addImages(div); .highlighted { border:2px solid #b404ae; background-image: url(image/tick.png); } #textbox span { bottom: 4px; color: #0f0; left: -15px; position: relative; display:none; border:none; } #textbox span.highlighted { display:inline; } &lt;div id="textbox"&gt; &lt;img src="http://www.flags.net/images/smallflags/CHIN0001.GIF" /&gt;&lt;span class="tickmark"&gt;&amp;#10004;&lt;/span&gt;&lt;br /&gt; &lt;img src="http://www.flags.net/images/smallflags/UNST0001.GIF" /&gt;&lt;span class="tickmark"&gt;&amp;#10004;&lt;/span&gt;&lt;br /&gt; &lt;img src="http://www.flags.net/images/smallflags/INDA0001.GIF" /&gt;&lt;span class="tickmark"&gt;&amp;#10004;&lt;/span&gt;&lt;br /&gt; &lt;img src="http://www.flags.net/images/smallflags/UNKG0001.GIF" /&gt;&lt;span class="tickmark"&gt;&amp;#10004;&lt;/span&gt;&lt;br /&gt; &lt;/div&gt; Hope this helps.

http://stackoverflow.com/comment/45553350
type: QuestionComment
has text: http://www.w3schools.com/js/
type: Comment
comment on: http://stackoverflow.com/q/28626093
score: 0

http://stackoverflow.com/comment/45578189
type: Comment
type: QuestionComment
has text: If I add else if ((playerMove - computerMove + 3) % 3 == 1){ var winner = "player" console.log("you won") } nothing gets printed on the screen!
score: 0
comment on: http://stackoverflow.com/q/28639314

http://stackoverflow.com/comment/45712488
score: 0
has text: You can just subtract container's `top` value from container1's `top` value (you'll get 80): http://jsfiddle.net/kwnk8qup/2/
comment on: http://stackoverflow.com/q/28712148
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45581127
comment on: http://stackoverflow.com/q/28635716
type: Comment
type: QuestionComment
has text: And again, calling `this.a()` from `obj.b()` would work just fine (it's just Javascript, nothing Ember specific) as long as you initialise the object correctly *and* you call that initial `otherMethod()` as a method on that object, but you're not showing the code doing that.
score: 1

ajax
tags question: http://stackoverflow.com/q/28624701
tags question: http://stackoverflow.com/q/28632321
tags question: http://stackoverflow.com/q/28749800
tags question: http://stackoverflow.com/q/28638491
tags question: http://stackoverflow.com/q/28634916
tags question: http://stackoverflow.com/q/28599128
tags question: http://stackoverflow.com/q/28691144
tags question: http://stackoverflow.com/q/28641645
tags question: http://stackoverflow.com/q/28681473
tags question: http://stackoverflow.com/q/28725445
tags question: http://stackoverflow.com/q/28620519
tags question: http://stackoverflow.com/q/28646418
tags question: http://stackoverflow.com/q/28601376
tags question: http://stackoverflow.com/q/28697815
tags question: http://stackoverflow.com/q/28676489
tags question: http://stackoverflow.com/q/28727248
tags question: http://stackoverflow.com/q/28630992
tags question: http://stackoverflow.com/q/28632637
tags question: http://stackoverflow.com/q/28718621
tags question: http://stackoverflow.com/q/28694621
tags question: http://stackoverflow.com/q/28614899
tags question: http://stackoverflow.com/q/28600318
tags question: http://stackoverflow.com/q/28705093
tags question: http://stackoverflow.com/q/28606219
tags question: http://stackoverflow.com/q/28651445
tags question: http://stackoverflow.com/q/28611063
tags question: http://stackoverflow.com/q/28604610
tags question: http://stackoverflow.com/q/28659515
tags question: http://stackoverflow.com/q/28659102
tags question: http://stackoverflow.com/q/28631520
tags question: http://stackoverflow.com/q/28609997
tags question: http://stackoverflow.com/q/28749859
tags question: http://stackoverflow.com/q/28687274
tags question: http://stackoverflow.com/q/28711448
tags question: http://stackoverflow.com/q/28696408
tags question: http://stackoverflow.com/q/28632997
tags question: http://stackoverflow.com/q/28598765
tags question: http://stackoverflow.com/q/28707405
tags question: http://stackoverflow.com/q/28620701
tags question: http://stackoverflow.com/q/28739962
tags question: http://stackoverflow.com/q/28622052
tags question: http://stackoverflow.com/q/28718114
tags question: http://stackoverflow.com/q/28616702
tags question: http://stackoverflow.com/q/28700292
tags question: http://stackoverflow.com/q/28671611
tags question: http://stackoverflow.com/q/28627522
tags question: http://stackoverflow.com/q/28637946
tags question: http://stackoverflow.com/q/28660103
tags question: http://stackoverflow.com/q/28634502
tags question: http://stackoverflow.com/q/28595910
tags question: http://stackoverflow.com/q/28611241
type: Tag
tags question: http://stackoverflow.com/q/28628177
tags question: http://stackoverflow.com/q/28633814
tags question: http://stackoverflow.com/q/28695727
tags question: http://stackoverflow.com/q/28672178
tags question: http://stackoverflow.com/q/28636220
tags question: http://stackoverflow.com/q/28604176
tags question: http://stackoverflow.com/q/28728436
tags question: http://stackoverflow.com/q/28636588
tags question: http://stackoverflow.com/q/28594631
tags question: http://stackoverflow.com/q/28649377
tags question: http://stackoverflow.com/q/28737861
tags question: http://stackoverflow.com/q/28618820
tags question: http://stackoverflow.com/q/28705634
tags question: http://stackoverflow.com/q/28605234
tags question: http://stackoverflow.com/q/28717151
tags question: http://stackoverflow.com/q/28721551
tags question: http://stackoverflow.com/q/28747744
tags question: http://stackoverflow.com/q/28712161
tags question: http://stackoverflow.com/q/28616585
tags question: http://stackoverflow.com/q/28605021
tags question: http://stackoverflow.com/q/28642457
tags question: http://stackoverflow.com/q/28643983
tags question: http://stackoverflow.com/q/28695533
tags question: http://stackoverflow.com/q/28739845
tags question: http://stackoverflow.com/q/28646946
tags question: http://stackoverflow.com/q/28646667
tags question: http://stackoverflow.com/q/28746581
tags question: http://stackoverflow.com/q/28667385

http://stackoverflow.com/q/28683818
downvote count: 0
has title: Pixel tracking code not working when redirecting to PDF
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/pdf
type: AnsweredQuestion
tagged with: tracking
accepted answer: http://stackoverflow.com/a/28684828
tagged with: pixel
upvote count: 1
type: Question
has body: I'm working on firing tracking pixel code when a form is submitted and redirects the user to a PDF document. Right now I'm not seeing my conversion metrics go up and when I land on the PDF file I getting some form of an error in Safari, the network tracking shows red by not error code. Here i my current code: jQuery.noConflict(); (function( $ ) { $('form').on('submit', function($) { try{ __pixel({"name": "tracker"}); } catch (err) {} }); })(jQuery); Ps. I've slightly adjusted the tracking code variable names for privacy. My assumption is that the pixel isn't firing completely before the user gets redirected to the PDF. If so, how should I go about doing that? Any help would be appreciated. Not sure if it's my approach or not.
has answer: http://stackoverflow.com/a/28684828
answer count: 1

http://stackoverflow.com/a/28748983
upvote count: 1
has comment: http://stackoverflow.com/comment/45780160
score: 1
answers question: http://stackoverflow.com/q/28748866
downvote count: 0
has comment: http://stackoverflow.com/comment/45780675
type: Answer
has body: Your question will probably get downvoted because it's so vague, as you mentioned, but I'll try and help out... Use ui-router (from the Angular UI team) instead of angular's ngRoute. You can then programmatically load in the left side view based on whatever state you want. So you'll have something like the below in your .config... .state('home', { url: '/', views: { '': { templateUrl: 'app/home.html', controller: 'homeController' }, 'nav@home': { templateUrl: 'app/nav.html', controller: 'navController' }, 'footer@home': { templateUrl: 'app/footer.html' }, 'rightContent@home': { templateUrl: 'app/default.html' }, 'leftContent@home': { templateUrl: 'app/menu.html' } } }) .state('home.leftSideOne', { url: 'leftSideOne', views: { 'content@home.leftSideOne': { templateUrl: 'app/leftSideOne.html', controller: 'leftSideOneController' } } }) .state('home.leftSideTwo', { url: 'leftSideTwo', views: { 'content@home.leftSideTwo': { templateUrl: 'app/leftSideTwo.html', controller: 'leftSideTwoController' } } }) Then your html could have &lt;div ui-view="nav@home"&gt;&lt;/div&gt; &lt;div ui-view="content@{{$state.current.name}}" class="content-div"&gt;&lt;/div&gt; &lt;div ui-view="footer@home" class="footer-bar"&gt;&lt;/div&gt; And in your controller... var leftLeftSide = function () { $state.go('home.leftSideTwo'); // or whatever state you should be moving to }

http://stackoverflow.com/a/28725253
answers question: http://stackoverflow.com/q/28725112
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28725112
type: Answer
upvote count: 6
downvote count: 0
has body: What makes you think that it overwrites the property? var foo = { get bar() { console.log('the getter is still here'); return this._bar; }, set bar(value) { this._bar = value; } } foo.bar = function() { console.log('xxx'); }; When running foo.bar() the output is: the getter is still here xxx
score: 6

gmail
type: Tag
tags question: http://stackoverflow.com/q/28635974
tags question: http://stackoverflow.com/q/28666641
tag name: gmail

http://stackoverflow.com/comment/45759722
score: 1
type: QuestionComment
has text: problem independent of angularjs, this is a reference issue, ```$scope.todos = res.data; ``` todos will refer to new data, but testarray still refers to old todos object
comment on: http://stackoverflow.com/q/28737792
type: Comment

http://stackoverflow.com/comment/45744207
type: QuestionComment
score: 0
has text: You can just, after the submit, remove all the permissions from that user in the DB and then add the permissions that were submitted.
comment on: http://stackoverflow.com/q/28728865
type: Comment

http://stackoverflow.com/comment/45778258
type: AnswerComment
score: 0
has text: I meant to update its functionality recently, I'll see if I can provide some docs.
type: Comment
comment on: http://stackoverflow.com/a/28735413

http://stackoverflow.com/q/28741109
tagged with: quirks-mode
tagged with: iframe
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/28741902
tagged with: internet-explorer-11
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
score: 1
favorite count: 0
type: Question
has body: Problem - We are trying to migrate our application to use IE Edge mode (we are using IE 11 browser). Our application consists of a top level page and a child iframe to load third party applications (which may load from a domain which is different from parent page domain). As part of migration, parent level page now loads in Edge mode (using IE=Edge value for X-UA-Compatible meta tag) Question - Can i be absolutely sure that iframe page will always render in Edge mode as well (irrespective of its malformed content or the use of X-UA-Compatible meta tag with a different content value)? Is there any official msdn document confirming the same? Note: I checked this msdn link, but it mainly explains IE9 behavior, and it also talks about the case where an iframe cannot have document mode higher than that of parent page. Based on my understanding, the accepted answer to this question seems to indicate that iframe will also render in Edge mode, but i am not entirely sure. Any help is appreciated! Thank you.
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/26206688
has title: IE 11 document mode for iframe page when parent page is running in edge mode

http://stackoverflow.com/comment/45803418
type: Comment
type: QuestionComment
has text: Got it to work after changing dataType: "text"
score: 0
comment on: http://stackoverflow.com/q/28747744

http://stackoverflow.com/comment/45588518
type: Comment
comment on: http://stackoverflow.com/q/28605721
type: QuestionComment
has text: @Anthony Again, that is not the problem. Adding `this.hue = 5` in `ready` function does not make the example work, nor does it change the already default value of `hue` since it is already `5`.
score: 0

http://stackoverflow.com/a/28748953
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28748706
has comment: http://stackoverflow.com/comment/46094068
score: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28748706
has body: How can I accomplish this using Javascript? You need a function that listens for mouse movements and reports its position. It then compares the cursor position to the positional bounds of the menu. If its within your thresholds you would then reposition/rotate the menu relative to the cursor's approach vector.

http://stackoverflow.com/a/52444486
answers question: http://stackoverflow.com/q/28606650
type: Answer
has body: Make sure the phantomjs process isn't already running ps -ef | grep phantom
score: 0

http://stackoverflow.com/q/28653359
tagged with: javascript
score: 0
has title: bxslider: half my images are not showing
answer count: 1
accepted answer: http://stackoverflow.com/a/28653491
type: AnsweredQuestion
tagged with: bxslider
type: Question
has answer: http://stackoverflow.com/a/28653491
has body: I would love some assistance. I am a complete newbie when it comes to javascript. I am working on my first project as a uni assignment. I have successfully implemented the pagepiling plug in, and the bxslider is working well except for two problems. My main problem is that I have 10 images and only five of them are showing. If I reorder the images in the html it is always the last five that don't work. I think this means it's a problem with the javascript but I can't see where. The second problem occurs on the portrait oriented photos. I have set a slideWidth: 600 which works great on landscape but leaves a white space to the right on portrait. http://www.helencrolls.com

http://stackoverflow.com/a/28684770
answers question: http://stackoverflow.com/q/28684605
score: 0
has body: 1) Simply create a HTML form with method POST and action the page itself. When sending the data using the button PHP can analyse the POST request and do whatever you want. 2) You probably mean Web 2.0 . Websites like Facebook use JavaScript to make asyncronous Ajax calls to their backend and then replace the information on the screen with the new ones without the need to reload the page.
type: Answer

http://stackoverflow.com/comment/45741903
score: 0
type: AnswerComment
has text: yes, you need then to remove it only once opacty is down to 0 or set it in absolute position to remove it from the flow of doc :) . My comment was actually an hint / extra info to explain your choice
type: Comment
comment on: http://stackoverflow.com/a/28727450

http://stackoverflow.com/a/28727923
answers question: http://stackoverflow.com/q/28727794
score: 0
type: Answer
has body: You can just keep iterating nextElementSibling until you find a table element: // `img` is a reference to the image element var table = img; while( (table = table.nextElementSibling) &amp;&amp; table.tagName.toLowerCase() != 'table' ); // Use `table` here. It will be `null` if no table is found

http://stackoverflow.com/q/28612737
tagged with: performance
possible better answer: http://stackoverflow.com/a/28612805
has comment: http://stackoverflow.com/comment/45529474
tagged with: javascript
has answer: http://stackoverflow.com/a/28612856
tagged with: optimization
favorite count: 0
has body: I have the following code: function() { if (foo &amp;&amp; foo.bar !== baz) { //needed because foo can be undefined, so foo.bar always returns value function1() return; } if (foo) { function2() } else { function1() } } I was wondering, what would be the best way to optimize these if statements, from code structure point of view. Thanks for all the answers!
has comment: http://stackoverflow.com/comment/45529126
has answer: http://stackoverflow.com/a/28612850
accepted answer: http://stackoverflow.com/a/28612856
answer count: 4
has comment: http://stackoverflow.com/comment/45529089
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45529234
has title: JavaScript if statement optimization
upvote count: 2
score: 1
has answer: http://stackoverflow.com/a/28612805
has comment: http://stackoverflow.com/comment/45529176
has comment: http://stackoverflow.com/comment/45529140
downvote count: 1
has answer: http://stackoverflow.com/a/28612857
has comment: http://stackoverflow.com/comment/45529232
type: Question

http://stackoverflow.com/a/28704629
type: AcceptedAnswer
type: Answer
upvote count: 4
has body: What you can do is to use ngChange handler to loop through all roles changing some property like checked bound to ngModel directive: $scope.checkAllRoles = function(user) { user.roles.forEach(function(role) { role.checked = user.allChecked; }); }; Where HTML is this: {{ user.name }} CHECK ALL {{ role.name }} Demo: http://plnkr.co/edit/a3I4DKyz6DRUKTIt50Xj?p=preview
downvote count: 0
answers question: http://stackoverflow.com/q/28704276
accepted answer of: http://stackoverflow.com/q/28704276
score: 4

http://stackoverflow.com/comment/45717982
type: AnswerComment
comment on: http://stackoverflow.com/a/28714985
type: Comment
has text: It creates on object that contains one property named `optionsChosen` with the value of `values`. Your code tried to create an object without specifying a property name, which makes no sense, and it is curios why Firefox would _not_ report an error on this.
score: 0

http://stackoverflow.com/q/28732641
has body: I am trying to populate knockoutjs viewmodel with some initial values from the server, I am using ASP.Net MVC so the way I am doing it is passing a mvc viewmodel to the view: public ActionResult Edit(int cvId) { CV cv = repository.FindCV(cvId); //auto mapper mapping Mapper.CreateMap&lt;CV, MyCVViewModel&gt;(); Mapper.CreateMap&lt;Company, MyCompanyViewModel&gt;(); Mapper.CreateMap&lt;Education, MyEducationViewModel&gt;(); Mapper.CreateMap&lt;Reference, MyReferenceViewModel&gt;(); var model = Mapper.Map&lt;CV, MyCVViewModel&gt;(cv); return View(model); } Inside the view I convert the viewmodel into json string and bind it to knockoutjs viewmodel, so it gets populated with data: //mvc viewmodel @model Taw.WebUI.Models.MyCVViewModel //convert @{ var json = @Html.Raw(Model.ToJson()); } //lastly bind &lt;script type="text/javascript"&gt; // Activate knockout binding var viewModel = new CVViewModel(@json); ko.applyBindings(viewModel); &lt;/script&gt; and inside my knockout javascript, i populate knockout viewmodel with the data: var CVViewModel = function (data) { var self = this; //list view model self.title = ko.observable(data.title); self.statement = ko.observable(data.statement); self.reference = ko.observable(data.reference); self.companies = ko.observableArray(data.companies); self.educations = ko.observableArray(data.educations); self.references = ko.observableArray(data.references); } Everything gets populated at this stage: and the resulting json string is: Questions: 1. The problem is that some values don't bind when I change them, only title and statement changes: Resulting json, as you can see, only title and statement changes, and values inside company don't change 2. When saving this data again, how can I let server side know what has been edited and what has been deleted, how to keep track of them using MVC and entity framework, and change database accordingly Update My knockout javascript, I already have these observables defined, how do define them in th…
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28733077
accepted answer: http://stackoverflow.com/a/28733077
possible better answer: http://stackoverflow.com/a/28732715
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has title: Knockoutjs populating data from server with MVC
tagged with: knockout.js
type: Question
tagged with: c#
has answer: http://stackoverflow.com/a/28732715
tagged with: asp.net-mvc

http://stackoverflow.com/a/28675306
score: 0
has comment: http://stackoverflow.com/comment/45643790
type: Answer
answers question: http://stackoverflow.com/q/28675176
has comment: http://stackoverflow.com/comment/45644205
has body: You can't, you can only return the text you want to be displayed, for example: $(function() { $(window).bind('beforeunload',function(){ return "Are you sure?"; });

http://stackoverflow.com/comment/45514926
type: Comment
type: QuestionComment
has text: Perhaps this might be a good starting point: http://stackoverflow.com/questions/4770025/how-to-disable-scrolling-temporarily . I would personally move in this way: If you have an event such as a div that is going to hide, once the hide event is triggered force the document to **focus** that div, then block the scroll. Else, just check if the scroll coords matches the desired position and block the scrolling using a similar way (or the same way) shown in the link above. Hope this helps :)
comment on: http://stackoverflow.com/q/28605092
score: 0

http://stackoverflow.com/comment/45514518
score: 0
has text: You should not get that reference error from the `console.log` line, but from the second alert statement.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28604915

http://stackoverflow.com/q/28619092
accepted answer: http://stackoverflow.com/a/28619553
tagged with: javascript
tagged with: jquery
upvote count: 2
has answer: http://stackoverflow.com/a/28619553
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
tagged with: css
type: AnsweredQuestion
score: 2
has title: Overlay icon on input box
downvote count: 0
has comment: http://stackoverflow.com/comment/45541433
has body: I am trying to overlay the x icon on my grey textbox, while maintaining it's 100% width. Is this possible? And if so, how? Up until this stage, all I can do is get it to work if the width of the grey textbox is 90%. HTML CSS .booking { outline: none; border: none; -webkit-box-shadow: none !important; -moz-box-shadow: none !important; box-shadow: none !important; background-color: #ccc; } input.form-control.booking, .twitter-typeahead { width:100%; display: inline-block; } .tt-dropdown-menu { padding: 1em; background-color: #ccc; width: 100%; Fiddle here
type: Question

http://stackoverflow.com/a/28666605
type: Answer
score: 1
upvote count: 1
has body: It might be better to add a class to distinguish them (that's what they're for), but if you must, you can use document.querySelectorAll() to match the specific ones you're looking for: document.querySelectorAll("div .notification") This will only match divs with the notification class. var elementsWanted = document.querySelectorAll("div .notification"); for(var i = 0; i < elementsWanted.length; i++){ elementsWanted[i].style.backgroundColor = "yellow"; } Span Div Div Div Div
downvote count: 0
answers question: http://stackoverflow.com/q/28666566

http://stackoverflow.com/comment/45782874
type: AnswerComment
has text: No, its just to make sure strings are converted to number, which, as it seems, is being done by driver anyway
type: Comment
comment on: http://stackoverflow.com/a/28749764
score: 1

http://stackoverflow.com/comment/45511134
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28602532
has text: Try this . Cleaner solution. http://jsfiddle.net/yL45ds8j/5/
score: 0

http://stackoverflow.com/a/28718251
score: 0
has body: Fixed on dev branch by the developer (Marco)
type: Answer
answers question: http://stackoverflow.com/q/28715374

http://stackoverflow.com/comment/45734781
comment on: http://stackoverflow.com/q/28723195
type: Comment
type: QuestionComment
has text: Run this in chrome then IE and youll see what I mean. http://jsfiddle.net/1hyep6dq/
score: 0

http://stackoverflow.com/q/28603695
score: -3
type: AnsweredQuestion
downvote count: 3
has body: I want to check value of all html controls with data-mandatory='1' I have tried this $("[data-mandatroy='1']").each(function(i, obj) { alert(obj.value); }); but not getting result Here is the fiddle... http://jsfiddle.net/pgrcs282/1/
type: Question
has comment: http://stackoverflow.com/comment/45512412
has answer: http://stackoverflow.com/a/28605978
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45512393
upvote count: 0
answer count: 1
favorite count: 0
has title: Checking Value of every control with specific Data tag Jquery
accepted answer: http://stackoverflow.com/a/28605978
has comment: http://stackoverflow.com/comment/45512487

http://stackoverflow.com/comment/45496871
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28594928
has text: It's always the small things that trip you up. Thanks I'll give this a try.

http://stackoverflow.com/q/28637416
has answer: http://stackoverflow.com/a/28637594
has body: I am trying to use Google Autocomplete on multiple class elements but it doesn't seem to be working. It works when I reference one id, as seen here but not with my fiddle. This is my code so far: $(document).ready(function () { addressLookup(); }); function addressLookup() { var address = document.getElementsByClassName('form-control booking address'); var options = { componentRestrictions: { country: 'uk' } }; new google.maps.places.Autocomplete(address, options); }
tagged with: javascript
favorite count: 0
type: AnsweredQuestion
upvote count: 0
possible better answer: http://stackoverflow.com/a/28637594
has answer: http://stackoverflow.com/a/28637635
downvote count: 1
accepted answer: http://stackoverflow.com/a/28637635
type: Question
has title: Google autocomplete not working on multiple elements with same class name
score: -1
duplicate of: http://stackoverflow.com/q/10693845
answer count: 2
linked to: http://stackoverflow.com/q/10693845
tagged with: google-maps

http://stackoverflow.com/comment/45605137
comment on: http://stackoverflow.com/a/28654038
has text: Not sure if you can put JavaScript inside <%# %> tags. Arent they for C#?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45743505
has text: They were answered, I forgot to remove that from the question.
comment on: http://stackoverflow.com/q/28705192
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28648233
has body: $(function() { function say() { alert("hello"); } }); Is there a way to call say() from the console ?
score: 0
has title: How to call a js function that is included into $(function()?
answer count: 1
has comment: http://stackoverflow.com/comment/45594338
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28648319
has comment: http://stackoverflow.com/comment/45594200
type: Question
has comment: http://stackoverflow.com/comment/45594135
has comment: http://stackoverflow.com/comment/45594140
tagged with: javascript

http://stackoverflow.com/a/28706630
has comment: http://stackoverflow.com/comment/90354859
has comment: http://stackoverflow.com/comment/45781557
has body: What you can do to get normal time format is; String.prototype.toHHMMSS = function () { var sec_num = parseInt(this, 10); // don't forget the second param var hours = Math.floor(sec_num / 3600); var minutes = Math.floor((sec_num - (hours * 3600)) / 60); var seconds = sec_num - (hours * 3600) - (minutes * 60); if (hours &lt; 10) {hours = "0"+hours;} if (minutes &lt; 10) {minutes = "0"+minutes;} if (seconds &lt; 10) {seconds = "0"+seconds;} var time = hours+':'+minutes+':'+seconds; return time; } if(commandCheck("/uptime")){ var time = process.uptime(); var uptime = (time + "").toHHMMSS(); console.log(uptime); }
upvote count: 12
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/63259724
has comment: http://stackoverflow.com/comment/79761843
score: 6
accepted answer of: http://stackoverflow.com/q/28705009
type: Answer
answers question: http://stackoverflow.com/q/28705009
downvote count: 6

http://stackoverflow.com/a/28730217
has comment: http://stackoverflow.com/comment/45790488
answers question: http://stackoverflow.com/q/28730153
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45777679
type: Answer
has body: Your solution is roughly correct. Recursively traverse the graph "downwards" recording all paths. Recursively traverse the graph "upwards" recording all paths. Produce all path combinations from the previous two sets. This assumes that the graph has no cycles (i.e. no creature feeds on itself or on any of its predators or predators of predators, etc.) Here is some pseudocode for traversal. Starting at the node of interest using a recursive approach: paths := [] for all children extendPath(paths, child) function extendPath(NodeList[] paths, Node node) for path in paths path.add(node) for child in node.children extendPath(paths, child)
accepted answer of: http://stackoverflow.com/q/28730153

http://stackoverflow.com/a/28669257
has comment: http://stackoverflow.com/comment/45633064
type: Answer
has body: as per your code, you have defined slry as a variable, and trying to use spry.value, which is not valid at all, change: ... slry.value =reformat(xxx); //its just a variable not input element to ... slry = reformat(xxx);
has comment: http://stackoverflow.com/comment/45632812
has comment: http://stackoverflow.com/comment/45632902
answers question: http://stackoverflow.com/q/28669003
has comment: http://stackoverflow.com/comment/45632966
score: 0

http://stackoverflow.com/comment/45700071
comment on: http://stackoverflow.com/a/28703103
type: AnswerComment
score: 0
has text: you do need `http://` here try: ` ` this doesn't log me in but does go to the correct page. "myusername" and "mypassword" must obviously be correct
type: Comment

http://stackoverflow.com/comment/45578924
type: Comment
has text: Thanks for your input, that gives me something to go off of. Its hard to find people who actually take time to answer questions so I appreciate it.
type: AnswerComment
comment on: http://stackoverflow.com/a/28639829
score: 0

http://stackoverflow.com/a/71553364
upvote count: 0
has body: What happens? The browser HTML parser will see the &lt;/script&gt; within the string and it will interpret it as the end of the script element. A commonly used technique is to use the concatenation operator: const test = '&lt;script&gt;...... &lt;/scr'+'ipt&gt;'; That fixed my issue.
type: Answer
downvote count: 1
answers question: http://stackoverflow.com/q/28643272
score: -1

http://stackoverflow.com/q/28628719
type: AnsweredQuestion
has title: UI datepicker won't close on keys (arrow, enter)
type: Question
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28630826
has body: I have a grid that tabs around the page with arrow keys. A couple of fields are date type. On tab or click I replace the contents with a unique input box and then on blur...replace back. ie. inline editing. the date picker pops up but I can't get it to remove on keys. It won't destroy itself. Thanks for the help in advance. ctrl.datepicker({ defaultDate: "+1w", changeMonth: true, numberOfMonths: 1, onClose: function (dT) { // do work } }).focus(); ctrl.on({ 'blur': function () { // puts the html back and sets value ctrl.datepicker('destroy'); }, 'keydown': function (k) { if (k.which == 27) { $(this).blur(); return; } if (k.which == 9) { k.preventDefault(); } if (k.which == 13 || k.which == 37 || k.which == 38 || k.which == 39 || k.which == 40 || k.which == 9) { $(this).blur(); that.handleColumnTab(e, k.which); // this tabs the grid up down left right etc. return; } } });
tagged with: datepicker
accepted answer: http://stackoverflow.com/a/28630826

http://stackoverflow.com/a/28734058
answers question: http://stackoverflow.com/q/28733813
score: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28733813
has body: I'm not sure I understand some of these design decisions (generating select boxes is an odd way to do a dropdown menu) but we'll skip that part for now and get to the good stuff. When you add new elements to the DOM after initial load, you need to think of event binding a little differently. Since these initial elements weren't around when you first said "Hey, all elements do this when I hover on you", the way you handle it is by telling a parent element instead. Sticking in jQuery-land: $('.parent-element').on('click', '.child-element', function (){ }); This gives you the same result as assigning click directly to .child-element if it was around at initial render. You can read more about delegated events here: http://api.jquery.com/on/ Here's a fiddle that cleans up your stuff a bit: http://jsfiddle.net/g6r8k6dk/1/
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/45753477

http://stackoverflow.com/q/28702502
has comment: http://stackoverflow.com/comment/45695132
has body: I'm beginner on Angular.js and am having some problems with the directive ng-include. I want to display contents of header.html inside index.html Well, here's my tree example: myapp . public . . lib . . . angular.js . . . . header.html . index.html Header.html code: Hello Angular Index.html code: When i run index.html, i have something like this:
has comment: http://stackoverflow.com/comment/45695245
type: Question
has answer: http://stackoverflow.com/a/28702918
has comment: http://stackoverflow.com/comment/45695024
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28702918
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45695347
has answer: http://stackoverflow.com/a/28702659
has title: What's the right way to use ng-include
tagged with: angularjs
linked to: http://stackoverflow.com/q/25499228
linked to: http://stackoverflow.com/q/13943471
has comment: http://stackoverflow.com/comment/45695667
possible better answer: http://stackoverflow.com/a/28702659
type: AnsweredQuestion

http://stackoverflow.com/comment/77426966
type: Comment
has text: Well I'm not sure why, but this worked while the textarea didn't. Thanks!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28618811

http://stackoverflow.com/comment/45768989
score: 0
type: QuestionComment
has text: I would recommend you to take a look at some stable solutions such as [fullPage.js](http://alvarotrigo.com/fullPage/). Trying to reinvent the wheel will just give you much more headaches when you start thinking about touch screen devices, touch laptops, animations performance, cross browser compatibility, old browsers compatibility, callbacks, infinite scrolling, keyboard accessibility, responsiveness... etc.
comment on: http://stackoverflow.com/q/28696993
type: Comment

http://stackoverflow.com/comment/45511954
comment on: http://stackoverflow.com/q/28603242
type: QuestionComment
score: 0
has text: You need to write a parser that converts `a.exaggerated#selector[data-myattr='data-here']` into ``. This is basically compiling something like Jade (not exactly) into HTML.
type: Comment

google-maps-api-3
tags question: http://stackoverflow.com/q/28696910
tags question: http://stackoverflow.com/q/28687526
tags question: http://stackoverflow.com/q/28627831
tags question: http://stackoverflow.com/q/28698813
tags question: http://stackoverflow.com/q/28742264
tags question: http://stackoverflow.com/q/28606149
tags question: http://stackoverflow.com/q/28619371
tags question: http://stackoverflow.com/q/28662810
tags question: http://stackoverflow.com/q/28617036
tags question: http://stackoverflow.com/q/28682425
tags question: http://stackoverflow.com/q/28625512
tags question: http://stackoverflow.com/q/28726244
tags question: http://stackoverflow.com/q/28695819
tags question: http://stackoverflow.com/q/28617292
tags question: http://stackoverflow.com/q/28636906
tags question: http://stackoverflow.com/q/28733277
tags question: http://stackoverflow.com/q/28706541
tags question: http://stackoverflow.com/q/28609623
tags question: http://stackoverflow.com/q/28652115
tags question: http://stackoverflow.com/q/28600639
tags question: http://stackoverflow.com/q/28649025
tags question: http://stackoverflow.com/q/28693252
tags question: http://stackoverflow.com/q/28688675
tags question: http://stackoverflow.com/q/28706144
tags question: http://stackoverflow.com/q/28669612
tags question: http://stackoverflow.com/q/28637312
tags question: http://stackoverflow.com/q/28627882
tags question: http://stackoverflow.com/q/28674279
tags question: http://stackoverflow.com/q/28716921
tags question: http://stackoverflow.com/q/28687094
tags question: http://stackoverflow.com/q/28742136
tags question: http://stackoverflow.com/q/28654688
tags question: http://stackoverflow.com/q/28681818
tags question: http://stackoverflow.com/q/28692758
tag name: google-maps-api-3
tags question: http://stackoverflow.com/q/28750179
type: Tag
tags question: http://stackoverflow.com/q/28619445
tags question: http://stackoverflow.com/q/28691129
tags question: http://stackoverflow.com/q/28683662
tags question: http://stackoverflow.com/q/28704994
tags question: http://stackoverflow.com/q/28610240
tags question: http://stackoverflow.com/q/28647332
tags question: http://stackoverflow.com/q/28741923
tags question: http://stackoverflow.com/q/28634935
tags question: http://stackoverflow.com/q/28608158
tags question: http://stackoverflow.com/q/28633273
tags question: http://stackoverflow.com/q/28594139
tags question: http://stackoverflow.com/q/28648766
tags question: http://stackoverflow.com/q/28595263
tags question: http://stackoverflow.com/q/28634184
tags question: http://stackoverflow.com/q/28727550
tags question: http://stackoverflow.com/q/28709975
tags question: http://stackoverflow.com/q/28600503

http://stackoverflow.com/comment/117054588
type: AnswerComment
has text: I'm trying to use the above snippet to remove Substack's annoying hiring call from my blog, but it also doesn't seem to be working. Here's their script: https://cdn.substack.com/min/main.bundle.js
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28601606

http://stackoverflow.com/comment/45725098
type: AnswerComment
type: Comment
has text: @Ovy.Istrate I'm not saying that jQuery should never be used but I would suggest that if you are having to rely heavily on jQuery you probably aren't using angular properly and will run into testing problems as a result
score: 2
comment on: http://stackoverflow.com/a/28718825

http://stackoverflow.com/comment/45495406
has text: interesting, will try this approach as well.
type: QuestionComment
comment on: http://stackoverflow.com/q/28594295
score: 0
type: Comment

http://stackoverflow.com/a/76698707
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28603292
has body: `window.onkeydown = keypress; function keypress(event) { if (event.keyCode === 27) { alert("triggered") } }
has comment: http://stackoverflow.com/comment/135221586
has comment: http://stackoverflow.com/comment/135228293

http://stackoverflow.com/comment/45505423
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28598417
has text: Hey again! Thanks a lot, I will check this out. The code I posted here is simply a (badly done) copy and paste. I have edited and changed mine, so it works fine, looks like a decent clock and the second hand it now move 6 degrees a second. So I do not need to add any more code to make the time display as the current time?
type: Comment

http://stackoverflow.com/q/28653391
has answer: http://stackoverflow.com/a/28653446
tagged with: javascript-databinding
answer count: 1
accepted answer: http://stackoverflow.com/a/28653446
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
score: 1
has body: I am an Angular noob trying to work through some examples that I find here and there. I found an interesting example here: http://kirkbushell.me/when-to-use-directives-controllers-or-services-in-angular/ that I have attempted to actually get running. For the most part it works as I would expect. The service is definitely storing the books and adding the new book as expected, however the list of books output in the view (DOM) is not updating. It would appear that the two-way binding is not set correctly. What might I be doing wrong? Here is the code that (mostly) works: var module = angular.module('bookModule', []); module.service('Book', ['$rootScope', function($rootScope) { var service = { books: [ { title: 'Magician', author: 'Raymond E. Feist' }, { title: 'The Hobbit', author: 'J.R.R Tolkien' } ], addBook: function(book) { service.books.push(book); $rootScope.$broadcast('books.updated'); } }; return service; }]); // Ctrl fn var ctrl = ['$scope', 'Book', function($scope, Book) { $scope.$on('books.updated', function(event) { console.log(Book.books); $scope.books = Book.books; }); $scope.books = Book.books; }]; // Initialize the controller module.controller('books.list', ctrl); // Directive to handle add book button module.directive('addBookButton', ['Book', function(Book) { return { restrict: 'A', link: function(scope, element, attrs) { element.bind('click', function() { Book.addBook({title: 'Star Wars', author: 'George Lucas'}); }); } }; }]); Book example Book list Title: {{book.title}} | Author: {{book.author}} Add book Thank you for your input!
upvote count: 1
has title: Two way binding issue for Angular book app example
type: Question
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/45666816
score: 1
has text: Any error in the console?
type: QuestionComment
comment on: http://stackoverflow.com/q/28684149
type: Comment

http://stackoverflow.com/q/28731563
type: Question
tagged with: forms
accepted answer: http://stackoverflow.com/a/28731758
answer count: 2
has body: I have the following form using angular. I want to submit the results to an email address and have set up a php action page with server side code to do this. However, it feels wrong the way I'm using the action="action.php" call on the form element. Dirty in fact... but i'm not sure of any other way to this. Is this the best way to submit the form? Should I be using an AJAX call via ng-submit to collect and store the data.... Here's a JSfiddle of the form but without the action="action.php" - I was experimenting with ng-submit="mealForm.$valid". Below is my code using the action="action.php" - you'll see I have added the action call in and omitted the ng-submit="mealForm.$valid" as was unsure how this would work, even after extensive reading of the docs Any help much appreciated - newbie to angular :) Thanks HTML Standard Form Custom Form Standard Form Use the standard form if the number people and meals are the same throughout your stay. E.G : 10 people wanting 7 dinners over a 7 day period. Use the custom form if the number of people wanting meals alters each day. * required fields First Name * Last Name * Email * Phone Number Start Date End Date Number of Days *(Discount of 10% Applies for 10 or more days) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Group Size *(max 15) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Meal Type *(Select from below options) {{meal.name}} - {{meal.description}} Accomodation Details (Please provide full address / specific dietery requirements and any other information) Total: (10% Discount of applied) Form complete: {{mealForm.$valid}} Submit ANGULAR JS (APP.JS) EDITED (function () { var app = angular.module('form', []); // start of edit app.controller('FormController', ['$scope','$window', function($scope,$window){ this.meals = mealTypes; $scope.handl…
tagged with: javascript
has title: how do i submit a angular js built form to an email address
tagged with: angularjs
tagged with: php
possible better answer: http://stackoverflow.com/a/28731896
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28731758
has answer: http://stackoverflow.com/a/28731896
score: 0

http://stackoverflow.com/q/28657739
score: 0
has title: Javascript Error in Nginx but not Apache
has comment: http://stackoverflow.com/comment/45612383
tagged with: apache
has comment: http://stackoverflow.com/comment/45637014
has comment: http://stackoverflow.com/comment/45620271
has body: After switching to Nginx, I've noticed a console error "unexpected end of file" in Chrome. The exact same file is fine though if served via Apache though. I tested by loading it from another domain being served by Apache. The file is "uglified" using grunt uglify and what's interesting is when I skip this, it's parsed fine when served by Nginx. So Nginx seems to be breaking the uglified version only in some way.
has comment: http://stackoverflow.com/comment/45616792
answer count: 0
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45611456
tagged with: uglifyjs
tagged with: nginx
has comment: http://stackoverflow.com/comment/45612265
tagged with: javascript
tagged with: grunt-contrib-uglify

http://stackoverflow.com/a/28625056
type: Answer
has body: Yes, everything accessible from JavaScript can be used with canvas, more or less. In this demo the color and text is fetched from HTML input and select elements, and rendered to canvas. var c = document.getElementById("canvas"), ctx = c.getContext("2d"), colors = document.getElementById("colors"), // get colors selector element text = document.getElementById("inp"), // get input text box x = 10, y = 10, dx = 4, dy = 5.5; // just for pin-pong ball ctx.font = "20px sans-serif"; (function loop() { // clear with alpha for trail-effect ctx.fillStyle = "rgba(255, 255, 255, 0.2)"; ctx.fillRect(0, 0, c.width, c.height); // calc ball speed and direction x += dx; y += dy; if (x < 0 || x > c.width) dx = -dx; if (y < 0 || y > c.height) dy = -dy; // reads current value from drop-down (select) ctx.fillStyle = colors.value; ctx.fillRect(x-5,y-5, 10,10); // reads current value from textbox ctx.fillText(text.value, x*0.25, 150); // loop requestAnimationFrame(loop); })(); #canvas {border:1px solid #000} Red Green Blue Orange Type something:
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28624709
upvote count: 1

http://stackoverflow.com/q/28724648
has comment: http://stackoverflow.com/comment/45736365
has comment: http://stackoverflow.com/comment/45736999
has body: I have the following code: function addData() { var arrayData = []; if (response != null) { for (i = 0; i &lt; response.results.features.length; i++) { arrayData.push(response.results.features[i]); } } return arrayData; } var arrayDataOP = addData(); function splitLines(arrayDataOP) { var arrayPOINTjson = []; for (var i = 0; i &lt; arrayDataOP.length; i++) { console.log(arrayData[i].geometry); if (arrayDataOP[i].geometry.type == "LineString") { for (key in arrayDataOP[i].geometry.coordinates.length) { arrayPOINTjson.push({ "type": "Feature", "properties": { "wheelchair": "yes", }, "geometry": { "type": "Point", "coordinates": arrayData[i].geometry.coordinates[key] } }); } } } console.log(arrayPOINTjson); return arrayPOINTjson; } addData(); splitLines(arrayDataOP); and it throws an error : Uncaught TypeError: Cannot read property 'geometry' of undefined and i dont know why couse if i console.log(arrayData[i].geometry); then i see a result. But that's only one error My point is that i want to split LineString inside my geoJSON file to points, like this: { "type":"Feature", "properties":{ "wheelchair":"yes", }, "geometry":{ "type":"Point", "coordinates":arrayData[i].geometry.coordinates[key] } } my geoSJON file sample: { "type": "FeatureCollection", "generator": "JOSM", "bbox": [ 23.4668, 58.9198, 23.6412, 58.974 ], "features": [ { "type": "Feature", "properties": { "wheelchair": "yes", "smoothness": "intermediate", "highway": "footway" }, "geometry": { "type": "LineString", "coordinates": [ [], [ 23.5410936, 58.9408252 ], [ 23.541092, 58.9408358 ], [ 23.5410706, 58.9410896 ], [ 23.5410448, 58.9412609 ], [ 23.541028, 58.9413309 ], [ 23.5409993, 58.9414512 ], [ 23.5408984, 58.9416477 ], [ 23.5408677, 58.9416962 ], [ 23.5407571, 58.9418706 ], [ 23.5405886, 58.9421204 ], [ 23.5405302, 58.9422071 ], [ 23.5403894, 58.9423888 ], [ 23.5401636, 58.9426413 ], [ 23.5400953, 58.9426593 ], [ 23.5399336, 58.9428447 ], [ 23.5399287, 58.9428504 ], [ 23.5399434, 58.9428895 ], [ 23.539…
tagged with: javascript
score: 0
tagged with: arrays
has comment: http://stackoverflow.com/comment/45736528
has comment: http://stackoverflow.com/comment/45736686
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45736784
answer count: 0
has title: GeoJSON file splitting
tagged with: http://stackoverflow.com/tag/json
type: Question

arrow-functions
tags question: http://stackoverflow.com/q/28638591
tag name: arrow-functions
type: Tag

http://stackoverflow.com/q/28669127
has title: javascript on page load check if a span (under ) with a specific class exist, if does not exist remove the entire
type: AnsweredQuestion
type: Question
tagged with: browser
has answer: http://stackoverflow.com/a/28669144
answer count: 2
tagged with: greasemonkey
tagged with: javascript
score: 0
has body: I am trying to create my own greasemonkey script for my favorite directory listing site :) The thing is not everything it list is beneficial to me, I inspected the website code and as it seems, each entry is under Now, and as it seems, I am only interested with those which have this format: This is an entry <~~~~~~~~~~ THIS SPAN $ Verified LOL As you can see, the existence of triggers it. I also wish that the javascript process this after the page loads, because the site populates the table via javascript too. I know I haven't done in my problem yet, but if somebody can just provide an example that can lead me, that is enough. Thank you very much!
has answer: http://stackoverflow.com/a/28673580
tagged with: http://stackoverflow.com/tag/html
tagged with: directory
accepted answer: http://stackoverflow.com/a/28669144
possible better answer: http://stackoverflow.com/a/28673580
has comment: http://stackoverflow.com/comment/45632448

http://stackoverflow.com/a/43031038
score: 5
has body: Please try below simple code - Jquery Code Example - $(window).on('beforeunload', function(){ Func_ToInsert_Record(); alert('Thanks And Bye!'); }); Javascript Code Example - // Anonymous function window.onbeforeunload = function(event) { var message = ''; if (window.event) { console.log(window.event); console.log(event.currentTarget.performance); console.log(event.currentTarget.performance.navigation); console.log(event.currentTarget.performance.navigation.type); } event = event || window.event; event.preventDefault = true; event.cancelBubble = true; event.returnValue = message; }
upvote count: 5
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/28627111

http://stackoverflow.com/a/28641417
downvote count: 0
answers question: http://stackoverflow.com/q/28641346
type: Answer
score: 1
upvote count: 1
has body: ([^\d].+) is actually matching the tab (any character except digits) after the first matched tab in the string then the greedy .+ will continue consuming and match the digits in the string. Also, you do not need to use a RegExp object here, a regular expression literal is enough. You can modify the regular expression and syntax as follows: var re = /^(.*?)\t+(\D+)$/ var parts = str.match(re); Note: Using both beginning of string ^ and end of string $ anchors here is important.

http://stackoverflow.com/q/28714239
accepted answer: http://stackoverflow.com/a/28715561
has answer: http://stackoverflow.com/a/28716119
has body: So I have an extra div which I show if the appropriate select option is selected. In Firefox works perfectly, but in Chrome or Safari when the extra div is shown, the footer stays where it was before. It does not goes back to the bottom. Here is an example, try to open it in Safari or Firefox. The window of the output should be small in height to see what is the problem Fiddle Some code, check the example on Fiddle (check link above) &lt;style&gt; html, body { height: 100%; margin: 0; overflow-x: hidden; padding: 0; position: relative; width: 100%; } body { display: -webkit-flex; /* Safari */ -webkit-flex-direction: column; /* Safari 6.1+ */ display: flex; flex-direction: column; } .content { background-color: #f7f7f7; clear: both; min-height: 250px; padding: 20px 10%; } &lt;/style&gt; &lt;script&gt; $(document).ready(function () { $("#extra_div").hide(); }); $('.selectpicker').change(function () { if ($(this).val() == '3') { $("#extra_div").show(); } else { $("#extra_div").hide(); } }) &lt;/script&gt; &lt;body&gt; &lt;div id="okvir_registracije" style="background-color: #f7f7f7;margin-top: 73px; -webkit-flex: 1; -ms-flex: 1; flex: 1;"&gt; &lt;/br&gt; &lt;div class="content" id="login_content"&gt; &lt;form name="registration" class="registration" method="post" id="form_login" onsubmit="return validateForm();"&gt; &lt;fieldset style="background: white"&gt; &lt;label style="margin-left: 10px"&gt;Choose one:&lt;/label&gt; &lt;select class="selectpicker" name="tip_uporabnika" id="tip_uporabnika" for="tip_uporabnika" onchange="show_div()"&gt; &lt;option value="1" selected="selected"&gt;izberi tip uporabnika&lt;/option&gt; &lt;option value="3"&gt;Uporabnik&lt;/option&gt; &lt;/select&gt; &lt;div id="extra_div"&gt; &lt;/br&gt; &lt;label style="margin-left: 10px" for="ime"&gt;Test 2&lt;/label&gt; &lt;/br&gt; &lt;label style="margin-left: 10px"&gt;Test&lt;/label&gt; &lt;select class="selectpicker" name="tip_uporabnika" id="tip_uporabnika" for="tip_uporabnika" onchange="show_d…
type: Question
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28715561
tagged with: javascript
tagged with: show
tagged with: jquery
has title: jQuery show function distorting style of page
has answer: http://stackoverflow.com/a/28714498
tagged with: http://stackoverflow.com/tag/html
tagged with: css
possible better answer: http://stackoverflow.com/a/28714498
type: AnsweredQuestion

http://stackoverflow.com/q/28716667
has title: What's the matter with the STEP parameter in my Highcharts graph?
accepted answer: http://stackoverflow.com/a/28717442
has comment: http://stackoverflow.com/comment/45720836
type: Question
has comment: http://stackoverflow.com/comment/45721755
tagged with: highcharts
answer count: 1
has answer: http://stackoverflow.com/a/28717442
tagged with: javascript
score: 0
tagged with: axis-labels
has comment: http://stackoverflow.com/comment/45720877
has body: I would have said that defining the STEP parameter for the xAxis would be rather straightforward. But there are weird things happening with my graphs. One thing is that although I am assigning a STEP value of 1, it only displays every fifth year. If I increase the value to 2, it displays every tenth year. This is the setting (with a fiddle here): "xAxis": { "labels": { "step": 1 }, "tickWidth": 0, "showFirstLabel": true, "showLastLabel": true }, Thanks for any help on this!
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45721520

web
tags question: http://stackoverflow.com/q/28614889
tags question: http://stackoverflow.com/q/28606858
tags question: http://stackoverflow.com/q/28646463
tags question: http://stackoverflow.com/q/28623039
tags question: http://stackoverflow.com/q/28733762
tags question: http://stackoverflow.com/q/28741337
tags question: http://stackoverflow.com/q/28640743
tags question: http://stackoverflow.com/q/28708919
tags question: http://stackoverflow.com/q/28646809
type: Tag
tags question: http://stackoverflow.com/q/28613193
tags question: http://stackoverflow.com/q/28598618
tags question: http://stackoverflow.com/q/28611504
tags question: http://stackoverflow.com/q/28634019
tags question: http://stackoverflow.com/q/28672172
tags question: http://stackoverflow.com/q/28710674
tags question: http://stackoverflow.com/q/28684461
tag name: web
tags question: http://stackoverflow.com/q/28619740
tags question: http://stackoverflow.com/q/28667256
tags question: http://stackoverflow.com/q/28704120
tags question: http://stackoverflow.com/q/28655685
tags question: http://stackoverflow.com/q/28734644
tags question: http://stackoverflow.com/q/28624950
tags question: http://stackoverflow.com/q/28712561

http://stackoverflow.com/q/28666255
score: 2
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/23829837
has title: Use Strict MeteorJS
has answer: http://stackoverflow.com/a/28666397
type: Question
has answer: http://stackoverflow.com/a/28666317
accepted answer: http://stackoverflow.com/a/28666397
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28666317
answer count: 2
has body: Accidental Duplicate: Should I add "use strict" to my meteor files? From what I understand, use strict is good practice in JavaScript. Should I use this when building MeteorJS Apps? If I should, where should I include this statement? If not, why not?
tagged with: strict
downvote count: 0
tagged with: meteor
favorite count: 0
upvote count: 2

http://stackoverflow.com/comment/45537227
type: QuestionComment
has text: are you expecting the whole html page or just the img in response ?
score: 0
comment on: http://stackoverflow.com/q/28616534
type: Comment

http://stackoverflow.com/a/28682457
accepted answer of: http://stackoverflow.com/q/28678466
has comment: http://stackoverflow.com/comment/45693765
answers question: http://stackoverflow.com/q/28678466
score: 31
upvote count: 31
has comment: http://stackoverflow.com/comment/45673784
has comment: http://stackoverflow.com/comment/64491729
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45672381
has comment: http://stackoverflow.com/comment/49253256
has comment: http://stackoverflow.com/comment/62013002
has body: I see you are using react-bootstrap, which includes a wrapper around regular input elements. In this case you need to use the getInputDOMNode() wrapper function in order to get the underlying input's actual DOM element. But you can also use the getValue() convenience function that react-bootstrap provides for Input elements. So your _handleDube function should look like: _handleDube: function(event) { DubeActionCreators.DubeTest({ message: this.refs.message.getInputDOMNode().value, tax: this.refs.tax.getInputDOMNode().value, validity: this.refs.valid_for.getValue() }); }, See this JSFiddle for a complete example: http://jsfiddle.net/mnhm5j3g/1/
type: Answer
has comment: http://stackoverflow.com/comment/57690654
has comment: http://stackoverflow.com/comment/45695075
has comment: http://stackoverflow.com/comment/57661510

http://stackoverflow.com/comment/45568109
has text: That will allow me to update marker info every X seconds without having to refresh the entire page? I guess I'm confused on how AJAX would fit in with this.
comment on: http://stackoverflow.com/a/28633967
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/28716201
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28718935
type: Question
accepted answer: http://stackoverflow.com/a/28718935
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
has title: Clone dropdown vs Clone
tagged with: asp.net
has body: I'm having the following code for clone a textbox: HTML: &lt;TextBox id="numericTextBoxClone"/&gt; jQuery code: var numericTextBoxClientID = '&lt;%= numericTextBoxClone.ClientID%&gt;'; var clonedElement = $('#' + numericTextBoxClientID).clone().attr('id', 'id_' + item.ID); $('#id_' + item.ID).show(); var element = $('&lt;div/&gt;'); element.append(clonedElement); Clon is working fine - I can see the new textbox on my page, but when I do the same for a dropdown it doesn't work, why?

permissions
tag name: permissions
type: Tag
tags question: http://stackoverflow.com/q/28715799

http://stackoverflow.com/q/28631752
has body: I am trying to make some simple 3D graphics. One of the things I need to do with this is figure out the z-order of the faces. I am doing this by calculating the distance of the plane to the camera. I have put these numbers in an array. I then copy it to make a second array. I want to be able to sort this array and compare it to the first one to find the render order of the planes. However, when I try and sort the second array, it sorts the first one as well! for(var i = 0; i &lt; faceDist.length; i++) { sortedDist[i] = faceDist[i]; } sortedDist.sort(sorter); for(var i = 0; i &lt; sortedDist.length; i++) { drawOrder[i] = faceDist.indexOf(sortedDist[i]); }
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28632196
type: Question
has title: javascript - array.sort sorts multiple arrays
tagged with: arrays
tagged with: javascript
tagged with: sorting
has answer: http://stackoverflow.com/a/28632196
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45563573

http://stackoverflow.com/comment/47316036
comment on: http://stackoverflow.com/a/29450361
score: 0
type: AnswerComment
has text: That's what I expected and how I think I set it up. See my updated post with my `var = should` part.
type: Comment

http://stackoverflow.com/q/28643401
type: AnsweredQuestion
tagged with: phantomjs
score: 1
has title: How to call python script from CasperJS
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45585292
tagged with: javascript
has body: I'm trying to call a python script from within CasperJS and grab the output from python. casp = require('casper').create({ verbose: true, logLevel: 'debug' }); casp.start().then(function() { var cp = require('child_process'); cp.execFile('/usr/bin/python','test.py', {},function(_,stdout,stderr){ console.log(stdout); console.log(stderr); }); }); casp.run(); test.py is just print "hello world" atm for testing, but this script when I run it just exits without running the python. If I replace the test.py arg with --version, e.g. cp.execFile('/usr/bin/python','--version', {},function(_,stdout,stderr){ Then I get the version information correctly. I think it must be an issue with how arguments are passed in execFile, but not sure what I should be doing.
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28644470
accepted answer: http://stackoverflow.com/a/28644470
tagged with: casperjs
has comment: http://stackoverflow.com/comment/45585091
tagged with: python

bluebird
tags question: http://stackoverflow.com/q/28736452
tags question: http://stackoverflow.com/q/28714298
tags question: http://stackoverflow.com/q/28642637
tags question: http://stackoverflow.com/q/28748742
tags question: http://stackoverflow.com/q/28713631
tag name: bluebird
tags question: http://stackoverflow.com/q/28724169
type: Tag

http://stackoverflow.com/a/28623303
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28623273
type: Answer
answers question: http://stackoverflow.com/q/28623273
has body: document.getElementsByTagName("tr")[0].addEventListener("click", function(){ alert(this.getElementsByTagName("th")[0].innerHTML); });
score: 0

http://stackoverflow.com/q/28711691
has answer: http://stackoverflow.com/a/28711927
tagged with: javascript
has comment: http://stackoverflow.com/comment/45711758
score: 0
has comment: http://stackoverflow.com/comment/45711880
linked to: http://stackoverflow.com/q/28241179
answer count: 1
tagged with: jquery
has body: I've written following code in order to implement filepicker.io into my HTML page but somehow I'm not able to do that. Also the firebug console is not showing me any error or warning for it. I've referred following question for this : filepicker.io -- easy implementation Following is the jsFiddle link that I referred : http://jsfiddle.net/krystiangw/61861wsv/ For your reference following is the code from my HTML file : Filepicker example Select MS-WORD file Filename: Filelink: Results: Upload file to see results Please guide and correct me where I'm making the mistake in integrating filepicker.io into the HTML. One more difference you'll observer in the fiddle and my code is, in the fiddle they have included Bootstrap 3.2.0 but I've not because I don't know how to include into my HTML. That's the only difference. Thanks. Waiting for your precious replies.
has title: Why I'm not able to implement filepicker.io into my HTML code?
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45711735
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
accepted answer: http://stackoverflow.com/a/28711927
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45711963
tagged with: filepicker.io

http://stackoverflow.com/comment/45769685
comment on: http://stackoverflow.com/q/28743466
score: 0
type: Comment
type: QuestionComment
has text: Not a THREEJS expert but couldn't the problem be that you're adding the whole collada scene and not just the model you need? ( collada.scene.clone(); ) ?

http://stackoverflow.com/comment/45530274
type: AnswerComment
score: 0
has text: Perfect!! Both options that you point out actually do work as intended, but I'll follow the parseZone code as laid out above. Thank you, Dan, I really appreciate it!
type: Comment
comment on: http://stackoverflow.com/a/28612906

http://stackoverflow.com/a/28644368
type: Answer
score: 3
downvote count: 0
has body: You could do it like this: var myArray = 'Congratulations ' + _.reduce(['Steve', 'Sally', 'George', 'Gina'], function(current, end) { return current + ', ' + end; }); // "Congratulations Steve, Sally, George, Gina" But reduce is not the most convenient tool for this, simple join feels more natural: 'Congratulations ' + ['Steve', 'Sally', 'George', 'Gina'].join(', ');
upvote count: 3
answers question: http://stackoverflow.com/q/28644326

http://stackoverflow.com/q/28644673
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 3
has title: Adding click event handlers recursively
tagged with: css
has answer: http://stackoverflow.com/a/28644854
favorite count: 0
accepted answer: http://stackoverflow.com/a/28644692
upvote count: 1
tagged with: recursion
possible better answer: http://stackoverflow.com/a/28644722
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28644722
score: 1
has body: I have an element #standardBox #standardBox.click --> replaces itself with #newBox #newBox.click --> replaces itself with #standardBox But this latest #standardBox has no click event listener. I want it to have an on click event listener and its subsequently created elements too. This is getting into a recursive loop, which I don't know how to address. I'm using this for header with standard contents, which gets replaced by something intermediate/new contents, which again is to get back to standard contents ... Thanks. HTML CSS html, body { margin: 0; padding: 0; height: 100%; } #container { position: relative; height: 5em; width: 5em; background: #C5CAE9; } #standardBox { position: absolute; top: 20%; right: 20%; bottom: 20%; left: 20%; background: #ffffff; cursor: pointer; } #newBox { height: 3em; width: 3em; background: #000000; cursor: pointer; } JAVASCRIPT $('#standardBox').click(function(){ $('#container').html(' '); // register event handler for new element created $('#newBox').click(function(){ $('#container').html(' '); // but this #standardBox has no click event listener }); }); http://codepen.io/anon/pen/YPLKLq
type: Question
has comment: http://stackoverflow.com/comment/45587641
has answer: http://stackoverflow.com/a/28644692

http://stackoverflow.com/q/28622090
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28622426
tagged with: jquery-plugins
has title: jQuery Plugin Interfering W/ Other Javascript
score: 0
answer count: 1
tagged with: jquery
has body: So I am using a plugin that creates a vertical paging animation. It basically makes a fullscreen box and moves the "sections" through this box. Here is the html to help show what I mean. I had a simple javascript function to hide my nav whenever you scroll down. The problem is, with this new plugin, you don't actually scroll down. Sections just move inside a stationary box. Here is the javascript function I was using for the nav. $(window).scroll(function (event) { var y = $(this).scrollTop(); if (y > 0) { $('#navBar').addClass('scroll'); } else{ $('#navBar').removeClass('scroll'); } }); So the y > 0 doesn't trigger with this plugin anymore so the nav won't hide properly. I'm thinking there has to be a way to change this simple code a little and make it work. Maybe by using IDs inside the sections possibly? Here is how my html looks with the general structure from the plugin applied. Aldi Rebrand Work About Blog ALDI Rebrand BRANDING | LOGO | PRINT ALDI is an international grocer, spanning from Germany to The United States and many other countries around the world. The premise behind this semester long project was to immerse ourselves in the company/brand we were assigned. I was assigned ALDI. In this scenario, the goal of the rebrand was to convey a new “fresh and local” side to ALDI and their proposed farmers market addition to their stores. We were asked to create a brand new logo, at least four pieces of collateral and a brand guideline to demonstrate our research, branding applications and flexibility. VIEW ON DRIBBBLE VIEW ON BEHANCE 1 3 And here is a jsfiddle of this page: https://jsfiddle.net/L0h1uxLo/1/
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28622426

http://stackoverflow.com/a/28608066
answers question: http://stackoverflow.com/q/28606147
type: Answer
has body: I don't see where you're asking to toggle fullscreen. Try this code, which adds the fullscreen request on click of the fadeOver button and only updates the src of the iframe, instead of recreating a new one. $(function () { var player = $('iframe'); var url = window.location.protocol + player.attr('src').split('?')[0]; var status = $('.status'); $( ".fadeOver" ).hide(); // Listen for messages from the player if (window.addEventListener) { window.addEventListener('message', onMessageReceived, false); } else { window.attachEvent('onmessage', onMessageReceived, false); } // Handle messages received from the player function onMessageReceived(e) { var data = JSON.parse(e.data); switch (data.event) { case 'ready': onReady(); break; case 'playProgress': onPlayProgress(data.data); break; case 'pause': onPause(); break; case 'finish': onFinish(); break; } } // Call the API when a button is pressed $('button').on('click', function () { post($(this).text().toLowerCase()); }); // Helper function for sending a message to the player function post(action, value) { var data = { method: action }; if (value) { data.value = value; } var message = JSON.stringify(data); player[0].contentWindow.postMessage(data, url); } function onReady() { status.text('ready'); post('addEventListener', 'pause'); post('addEventListener', 'finish'); post('addEventListener', 'playProgress'); } function onFinish() { $(".fadeOver").fadeIn("slow"); } function onPlayProgress(data) { status.text(data.seconds + 's played'); } }); $( ".fadeOver" ).click (function(){ $( "iframe" )[0].src= '//player.vimeo.com/video/119551148'; requestFullscreen($( "iframe" )[0]); }); function requestFullscreen(el){ if (el.requestFullscreen) { el.requestFullscreen(); } else if (el.msRequestFullscreen) { el.msRequestFullscreen(); } else if (el.mozRequestFullScreen) { el.mozRequestFullScreen(); } else if (el.webkitRequestFullscreen) { el.webkitRequestFullscreen(); } }
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/comment/45552574
type: Comment
comment on: http://stackoverflow.com/a/28624295
has text: try `var str = $(this).find(".jig-caption-title:visible").text(); $(".caption-perso").html(str);` to refer only to the mouse enter element. It works if `jig-caption-title` is child of `.jig-caption`
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45589105
type: AnswerComment
type: Comment
has text: Now it works! Thank you very much. I must admit though, this is very confusing that ng-include refers to a different scope!
comment on: http://stackoverflow.com/a/28645610
score: 0

http://stackoverflow.com/q/28672269
favorite count: 0
accepted answer: http://stackoverflow.com/a/28672382
possible better answer: http://stackoverflow.com/a/28672403
upvote count: 1
has answer: http://stackoverflow.com/a/28672403
type: AnsweredQuestion
score: 1
type: Question
has title: HTML Dropdown's redirection(using JS) not working on mobile, but works fine on PC
tagged with: mobile
has answer: http://stackoverflow.com/a/28672382
tagged with: javascript
tagged with: jquery
has body: I have a dropdown on my page: Select a week This Week When an is selected, it will be redirected to the page http://sample.com/page1/action. It works fine on PC, but when the site is viewed on mobile, the redirection doesn't work, and it simply redirects to a page undefined. The JS code for doing redirection is: $(window).load(function (event) { $(document).on('click','#menu-bars', function (event) { $('body').toggleClass('nav-collapsed'); $.scrollTo(0, 'fast'); }); var selectList = $('select'); if( !$('html').is('.touch') ){ selectList.select2({ minimumResultsForSearch: -1 }); } selectList.on("change", function (e) { var parent = $(this).parents('.dropdown'); var method = parent.data('method'); if (method == 'redirect') { window.location = e.val; } It's probably that when the site is viewed on mobile, window.location = e.val; contains no value. What could be the possible cause that the js is not working when redirecting the page?
answer count: 2
downvote count: 0

http://stackoverflow.com/q/28746595
score: 3
has answer: http://stackoverflow.com/a/28746897
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28746977
downvote count: 0
tagged with: javascript
tagged with: dom-events
favorite count: 0
has title: Prevent JavaScript event which is bound to an object to be overridden
has body: I do: // Can be edited window.onbeforeunload = function(){ console.log("A") } And then: // Cannot be edited (for example, this code appears in 3rd party library) window.onbeforeunload = function(){ console.log("B") } Then I refresh a page and see "B" in console log. Expected. But I want to prevent the second bind to actually happen. Basically, I want to lock an event and prevent it from being overridden forever (during page life). As a result, I want to see "A" in console log on page refresh. Note 1: I cannot edit a part of the code with console.log("B") as it may appear in third party JS library. Note 2: Cross-browser solution needed.
tagged with: cross-browser
upvote count: 3
type: UnansweredQuestion

http://stackoverflow.com/q/28740050
has comment: http://stackoverflow.com/comment/45763777
type: Question
has title: "Unexpected token" using JSONP with Angular JS
has body: I try to use JSONP because if i use $http.get I have the XMLHttpRequest error. This is my code: .controller("showbusCtrl", function ($scope,$http) { var url = "http://m.aucorsa.es/inc/json/lineas.json"; var urlJsonp = "?callback=JSON_CALLBACK"; $http.jsonp (url + urlJsonp) .success(function(data) { this.lineas = lineas.data; }); }); Any solution? Thank you!
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45763854
has comment: http://stackoverflow.com/comment/45763742
tagged with: angularjs
type: UnansweredQuestion
answer count: 0

http://stackoverflow.com/q/28622212
answer count: 1
has comment: http://stackoverflow.com/comment/45547274
tagged with: jquery
has comment: http://stackoverflow.com/comment/45547237
has title: Onchange event of dropdown in server side datatable
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28622774
tagged with: codeigniter
has body: This is my codeignitor datatable(http://postimg.org/image/jptkczs8p/).I m trying to create an event on status dropdown change.all dropdown has same class.its looks like dropdown is not at all connected to this script.m i missing something.please help. here is my code which does nothing. $( document ).ready(function() { $('.status_c').on("change", function() { //alert("i m working"); var id = this.attr('id'); var value = this.val(); 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('group_info').style.display='none'; //document.getElementById('library_info').style.display='block'; //document.getElementById("model_body1").innerHTML=xmlhttp.responseText; alert(xmlhttp.responseText); } } xmlhttp.open("GET","&lt;?php echo base_url();?&gt;records/changestatus?id="+id+"&amp;value="+value+"",true); xmlhttp.send(); }); }); This is my controller function changestatus() { $ids = $this-&gt;input-&gt;get('id'); $values = $this-&gt;input-&gt;get('value'); $data = array( 'status' =&gt;$values ); $this-&gt;db-&gt;where('id', $ids); $this-&gt;db-&gt;update('complaint', $data); echo "complain updated"; } here is script for server side datatable. $(document).ready(function() { $.fn.dataTable.ext.errMode = 'throw'; var ETable = $('#dataTables-example').dataTable({ "infoEmpty": "No records available", "sProcessing": "DataTables is currently busy", "processing": true, "bSort": false, "columnDefs": [ { "width": "20%", "targets": 0 } ], "serverSide": true, "sAjaxSource": "&lt;?php echo base_url();?&gt;records/numlistajax", "aLengthMenu": [[10, 25, 50,100], [10, 25, 50,100]], "iDisplayLength": 10, "aaSorting": 3, 'asc', "dom": 'T&lt;"clear"&gt;lfrtip', "bDeferRender": true, "oLanguage": { "sInfoFiltered": "", "sProcessing": "&lt;…
type: Question
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28622774
tagged with: datatables

http://stackoverflow.com/q/28715306
tagged with: jquery
type: Question
has title: Load dropdown list based on another dropdown selected item
has comment: http://stackoverflow.com/comment/45718318
has comment: http://stackoverflow.com/comment/45719189
score: 0
has comment: http://stackoverflow.com/comment/45718207
has body: Load dropdown list based on another dropdown selected item Here my js : $("#Ownerstate").change(function () { var procemessage = "&lt;option value=`0`&gt; Please wait...&lt;/option&gt;"; $("#OwnerAgency").html(procemessage).show(); var url = "/Index/GetAgencyState/"; // Get state code var Ownerstate = $("#Ownerstate :selected").val(); $.ajax({ url: url, data: { statecode: Ownerstate }, cache: false, type: "POST", success: function (carData) { if (carData.length &gt; 1) { $("#OwnerAgency").prop("disabled", false); } var select = $("#OwnerAgency"); select.html(''); $.each(carData, function (index, itemData) { select.append($('&lt;option/&gt;', { value: itemData.Value, text: itemData.Text })); }); }, error: function (reponse) { alert("error : " + reponse); } }); }); Not getting load dropdownlist
has comment: http://stackoverflow.com/comment/45719161
answer count: 0
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/q/28604444
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/45513752
has comment: http://stackoverflow.com/comment/45513830
tagged with: javascript
has answer: http://stackoverflow.com/a/28604749
accepted answer: http://stackoverflow.com/a/28604749
tagged with: asp.net
tagged with: http://stackoverflow.com/tag/html
duplicate of: http://stackoverflow.com/q/2732488
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45513672
has body: I want to save screenshot of the current page ( full page with scroll) and save it as an image or pdf .
downvote count: 5
score: -3
has title: How to get screenshot of current page in asp.net.
type: AnsweredQuestion
tagged with: c#
linked to: http://stackoverflow.com/q/2732488

http://stackoverflow.com/q/28728852
tagged with: javascript
has title: Error when creating directive: TypeError: undefined is not a function
score: 0
answer count: 2
has body: Hi, I am a angular newbie. I'm trying to declare a custom directive. But i'm getting the console error as follows. Uncaught TypeError: undefined is not a function directives.js:5 (anonymous function) See here : Link app.js 'use strict'; var app = angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.widgets','myApp.directives']); app.run(['$route', '$window', '$rootScope', function($route, $window, $rootScope) { $route.when('/login', {template: 'partials/login.html', controller: loginCtrl}); $route.when('/home', {template: 'partials/home.html', controller: homeCtrl}); $route.otherwise({redirectTo: '/login'}); var self = this; $rootScope.$on('$afterRouteChange', function(){ $window.scrollTo(0,0); }); }]); directives.js angular.module('myApp.directives', []) .directive('hello', function() { return { template : '&lt;div style="position: relative"&gt;&lt;img id="map" src="http://www.lonelyplanet.com/maps/asia/india/map_of_india.jpg" /&gt;&lt;img id="marker" src="http://maps.google.com/mapfiles/ms/micons/blue.png" style="display: none; position: absolute;" /&gt;&lt;/div&gt;' } }; });
tagged with: angularjs
has answer: http://stackoverflow.com/a/28728964
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45743999
possible better answer: http://stackoverflow.com/a/28728995
type: Question
tagged with: angularjs-directive
has answer: http://stackoverflow.com/a/28728995
accepted answer: http://stackoverflow.com/a/28728964

http://stackoverflow.com/q/28698082
has answer: http://stackoverflow.com/a/28698189
has body: In javascript is there a way to reload the current page from the browser cache when the current URL includes a fragment (#)? I know that window.location.reload(false) should do that, but I've tried and it doesn't, it still makes a request to the server. If I do window.location.href=window.location.href it will load the HTML from the cache, but only when the URL does not include a fragment. Does anyone know a solution?
type: UnansweredQuestion
tagged with: page-refresh
has comment: http://stackoverflow.com/comment/45732822
has title: How to force reload of current page from browser cache
has comment: http://stackoverflow.com/comment/45698796
has comment: http://stackoverflow.com/comment/45690221
has comment: http://stackoverflow.com/comment/45690572
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45686517
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45690418

http://stackoverflow.com/q/28658152
has answer: http://stackoverflow.com/a/28658227
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28658213
possible better answer: http://stackoverflow.com/a/28658229
has answer: http://stackoverflow.com/a/28658229
answer count: 4
score: 8
favorite count: 0
has answer: http://stackoverflow.com/a/28658213
tagged with: css
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/28658328
has body: I'm curious why this one &lt;div class = "overlay"&gt; fdsfsd &lt;/div&gt; .overlay{ width: 100px; height: 200px; background-color:red; } alert(document.getElementsByClassName("overlay")[0].style.width); is not alerting nothing. Of course I can write &lt;div style = "width:100px"&gt; then everthing works fine, but it is not good for me, I need css. Here you can find a jsfiddle demo So exact question is: why this code is not alerting width of div and how alert it if width is given by css?
upvote count: 8
type: Question
has title: Javascript element style

http://stackoverflow.com/q/28596095
score: 0
answer count: 1
tagged with: jquery
linked to: http://stackoverflow.com/q/3439316
has comment: http://stackoverflow.com/comment/45498723
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45498929
has comment: http://stackoverflow.com/comment/45498942
has title: IE8 issue with jQuery attr()
type: Question
has comment: http://stackoverflow.com/comment/45499992
has body: I am using IE8 and am receiving an error of “object not found” with the line: var l_classList = $(this).attr('class').trim().split(/\s+/); The actual code block is as follows: $( "div.panel" ).each(function(index) { var l_classList = $(this).attr('class').trim().split(/\s+/); if ( l_classList.length == 1 ) $(this).addClass("panel-default"); }); Any ideas of how to get around this within IE8?
has comment: http://stackoverflow.com/comment/45499114
tagged with: internet-explorer-8
tagged with: javascript
has answer: http://stackoverflow.com/a/28596681

http://stackoverflow.com/q/28696744
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45684223
has comment: http://stackoverflow.com/comment/45684033
has comment: http://stackoverflow.com/comment/45695778
has comment: http://stackoverflow.com/comment/45683716
has comment: http://stackoverflow.com/comment/45684871
has answer: http://stackoverflow.com/a/28696895
answer count: 1
score: 1
has title: Is there any advantage to naming function declarations?
favorite count: 0
upvote count: 1
linked to: http://stackoverflow.com/q/336859
has comment: http://stackoverflow.com/comment/45685638
type: AnsweredQuestion
has body: A. function foo( ){ } B. var foo = function foo( ){ } I write all my JavaScript functions in the A fashion because I think B is redundant. My coworker likes to go in and do mass find/replace to rewrite my functions like B because he says it's best practice according to airbnb. What is the fundamental/practical difference between the two? Is there danger of him breaking my code by doing this? Is one better practice than the other (can you cite any sources)?
accepted answer: http://stackoverflow.com/a/28696895
has comment: http://stackoverflow.com/comment/45684111
has comment: http://stackoverflow.com/comment/45683803
type: Question
has comment: http://stackoverflow.com/comment/45687949
has comment: http://stackoverflow.com/comment/45683865
tagged with: function

http://stackoverflow.com/comment/45728315
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28720567
has text: @JeremyThille: Any function can have a callback: see [**callbacks**](http://learn.jquery.com/about-jquery/how-jquery-works/#callbacks-and-functions).
type: AnswerComment

http://stackoverflow.com/comment/45668092
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28686799
has text: I have what seems to me to be a strange issue: I have an object that looks something like `dataObject = {"timeCollected": 3432547, "publicIP": {"ip": "xx.xxx.xx.xx"} (...plus many others) }`. Then I pull some values from there into a new object: `systemInfo = {"timeCollected": dataObject.timeCollected, "publicIP": dataObject.publicIP.ip,}`. I want to update the timeCollected and publicIP fields in my existing document (both fields are set to 0 in the doc initially).
type: AnswerComment

http://stackoverflow.com/comment/134033248
type: Comment
has text: Especially if you are working with polifil event source it's important to set event:message, otherwise eventSource.addEventListener("message", ...) won't work on the front-end side
type: AnswerComment
comment on: http://stackoverflow.com/a/42803814
score: 0

http://stackoverflow.com/q/28599470
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/45505037
tagged with: twitter-bootstrap
type: UnansweredQuestion
has body: I am basically trying to create the following (an image from GitHub): Notice that this widget is composed of two halves. I am having a lot of difficulty trying to re-create this type of widget. I am able to create individual halves but attempting to display both in the same fashion becomes distorted. Below is one attempt, Text here! Some Text! Any help would be kindly appreciated.
upvote count: 1
score: 1
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
has title: How to copy "GitHub Project Display Widget" in Bootstrap?
has comment: http://stackoverflow.com/comment/45525543
favorite count: 0
has answer: http://stackoverflow.com/a/28600770

http://stackoverflow.com/a/28707387
type: Answer
accepted answer of: http://stackoverflow.com/q/28706231
score: 2
answers question: http://stackoverflow.com/q/28706231
downvote count: 0
type: AcceptedAnswer
has body: Get a startDate on mouseDown then get endDate on mouseUp and calculate difference between these dates, convert second. And.... just console.log :)
upvote count: 2

http://stackoverflow.com/q/28684653
has body: I had to create a function that will accept user input for the name and number grade for a series of student. I click on the add button to add the data to the array. Now I want to display the name and grade, but convert the number grade to letter grade. I have everything working except the number to letter change. My code will show you that i used a for loop with if else statements but it does not seem to be grabbing the data. Here is my code: &lt;html&gt; &lt;head&gt; &lt;meta charset=utf-8 /&gt; &lt;title&gt;Compute the average marks and grade&lt;/title&gt; &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;Looping.css&quot;&gt; &lt;meta REQUIREMENT= &quot;Using JavaScript, create a function that will accept user input for the name and grade for a series of students. As input is given, store information (name and grade) in an array. Click the 'Add' button after entering each student's data. Click the 'Display' button to display the name and grade for each student and, then, the average for all grades.&quot;&gt; &lt;script&gt; var userName, userAge; var nameData = []; var gradeData = []; function addToArray() { txtName = document.getElementById(&quot;txtName&quot;).value; txtGrade = parseInt(document.getElementById(&quot;txtGrade&quot;).value); alert(txtName + &quot; &quot; + txtGrade); nameData.push(txtName); gradeData.push(txtGrade); document.getElementById(&quot;txtName&quot;).focus(); document.getElementById(&quot;txtName&quot;).value = &quot;&quot;; document.getElementById(&quot;txtGrade&quot;).value = &quot;&quot;; } function displayContent() { for (var i = 0; i &lt; nameData.length; i++) { //document.write(&quot;&quot; + nameData[i] + &quot; ,&quot; + gradeData[i] + &quot;&lt;br&gt;&quot;); if (gradeData &gt;= 90) { document.write( &quot;&quot; + nameData[i] + &quot;A&quot;); } else if (gradeData &gt;= 80) { document.write(&quot;&quot; + nameData[i] + &quot;B&quot;); } else if (gradeData &gt;= 70) { document.write(&quot;&quot; + nameDat…
favorite count: 0
has comment: http://stackoverflow.com/comment/45662392
accepted answer: http://stackoverflow.com/a/28684815
has answer: http://stackoverflow.com/a/28684714
has title: change number grade to letter grade
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/28684815
type: Question
has comment: http://stackoverflow.com/comment/45662160
tagged with: if-statement
score: -2
tagged with: arrays
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28684714
answer count: 2
downvote count: 2

http://stackoverflow.com/a/28660004
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28659922
has body: Try this way for javascript var re = /(t=|start=)(?:\d+)/g; var str = 'http://youtu.be/xxxxxxxx?t=30s\n\nhttps://www.youtube.com/watch?v=xxxxxxxx&amp;start=30'; var m; while ((m = re.exec(str)) != null) { if (m.index === re.lastIndex) { re.lastIndex++; } // View your result using the m-variable. alert(eg m[0]) } DEMO

http://stackoverflow.com/comment/45717173
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28711298
type: Comment
has text: No, If you write normal 'click', while compiling that line by browser the particular element should be present in the DOM. But when we use jQuery "on" function no need to present the element in the DOM, when ever the element added to DOM then event will bind to that element

http://stackoverflow.com/q/28690307
answer count: 3
downvote count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28690400
favorite count: 0
has answer: http://stackoverflow.com/a/28690355
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28690347
accepted answer: http://stackoverflow.com/a/28690347
tagged with: append
type: AnsweredQuestion
has title: Removing div's appended using jQuery append()
score: 1
possible better answer: http://stackoverflow.com/a/28690400
type: Question
linked to: http://stackoverflow.com/q/203198
tagged with: javascript
has body: Hi i have a button which add's a div to my html using jquery append(). Now each of the div's appended has a close button which removes the appended div using jquery remove(). The code looks like this: $(document).ready(function(){ $("#image-btn").click(function(){ var $imageElement = $(" Upload Image "); $("#element-holder").append($imageElement); $imageElement.fadeIn(1000); $("#close-img-btn").click(function(){ $imageElement.remove(); }); }); }); Now the problem is arises while removing the appended div's. When i add multiple div's (Each has a close button) and click on the close button of the last appended div nothing happens. But clicking on the close button of the first appended div closes all the other appended div. I am trying to close only the div that i hit close and not the others. How do i do this ? Would really appreciate if someone could guide me through. Thanks.
upvote count: 2

http://stackoverflow.com/a/28701432
score: 0
type: Answer
has body: I guess you need to address the array the other way around. Use data[i][3] instead of data[3][i]: for(var i = 0, len = data.length; i < len; i++) { var currentDesc = data[i][2]; if(currentDesc.indexOf("may refer to:") <= -1) { $('#results').append(' '+ data[i][1] +' '+ data[i][2] +' '); } }
answers question: http://stackoverflow.com/q/28701159

http://stackoverflow.com/a/29290218
has body: If you care about performance, probably the best choice would be not to use $filter('filter') at all. Assuming your data is a JSON you can do the following: function contains(src, value, except) { var key; switch(typeof src) { case 'string': case 'number': case 'boolean': return String(src).indexOf(value) > -1; case 'object': except = except || []; for(key in src) { if( src.hasOwnProperty(key) && except.indexOf(key) < 0 && contains(src[key], value, except) ) { return true; } } } return false; } angular.module('app', []). factory('appService', function() { var data = [ {"id":"1a", "name": "aaa", "emails": ["123@123.com", "123@123.info"]}, {"id":"2a", "name": "aba", "emails": ["23@123.com", "3@123.info"]}, {"id":"3a", "name": "aab", "emails": ["3@123.com", "3@123.info", ["1@123.com", "2@123.info"]]} ]; return { getFilteredData: function(filter, except) { return filter ? data.filter(function(item) { return contains(item, filter, except) }) : data.slice(0); } } }). controller('appController', ['$scope', 'appService', function($scope, appService) { $scope.search = ''; $scope.$watch('search', function(val) { $scope.data = appService.getFilteredData(val, ['id']); }); }]); Code above will make a deep search in all fields of data and it's items excluding list of fields passed as parameter (in this example ['id']) Tip #1: Implementing business logic inside controller is kind of bad practice in Angular, which has services for that purpose. Tip #2: If you have large data-sets to be displayed, debouncing filter change will be very beneficial from performance point of view. Tip #3: If your data-set items are immutable, you can take advantage of one-time binding (using syntax) and speed-up your app by reducing number of watches created by Angular.
has comment: http://stackoverflow.com/comment/46788386
answers question: http://stackoverflow.com/q/28745387
score: 6
has comment: http://stackoverflow.com/comment/46797611
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46867309
has comment: http://stackoverflow.com/comment/46855319
has comment: http://stackoverflow.com/comment/46880886
type: Answer
upvote count: 6
accepted answer of: http://stackoverflow.com/q/28745387
has comment: http://stackoverflow.com/comment/46857950

http://stackoverflow.com/comment/122324751
type: AnswerComment
has text: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-ask).
score: 0
type: Comment
comment on: http://stackoverflow.com/a/69203521

http://stackoverflow.com/comment/45746096
has text: Keyword "this" is referred toa global scope, as you can see in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this
comment on: http://stackoverflow.com/q/28729895
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45610382
score: 0
type: AnswerComment
has text: Thank you, Dreamwalker!! This is exactly what I want to happen. Your detailed answer has helped me tremendously. I have made all the changes you suggest and because you stepped through each one with your explaination, I now understand it much better.
comment on: http://stackoverflow.com/a/28616769
type: Comment

http://stackoverflow.com/q/28690110
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28690333
tagged with: angularjs
has body: I have the below data model in my scope. $scope.staff = [ {"id": "1","name": "Alex"}, {"id": "2","name": "Brad"}, {"id": "3","name": "Cam"} ]; $scope.closedShop =[ {"day": "monday","staffID": "1"}, {"day": "wednesday","staffID": "2"}, {"day": "thursday","staffID": "3"}, {"day": "friday","staffID": "1"} ]; What I want to do is output which staff member closed the shop each day, so based on the above my ideal output would be. Alex closed the shop on monday Brad closed the shop on wednesday Cam closed the shop on thursday Alex closed the shop on friday The problem I am having is the closedShop data only contains staffID, how can I look this up based on the staff.id data to get the persons name? I have a working example below however, this is not a scalable solution, for more than a handful of staff? 'use strict'; var app = angular.module('app', []); app.controller('MainCtrl', ['$scope', function ($scope) { $scope.staff = [ {"id": "1","name": "Alex"}, {"id": "2","name": "Brad"}, {"id": "3","name": "Cam"} ]; $scope.closedShop =[ {"day": "monday","staffID": "1"}, {"day": "wednesday","staffID": "2"}, {"day": "thursday","staffID": "3"}, {"day": "friday","staffID": "1"} ]; }]); {{staff[0].name}} {{staff[1].name}} {{staff[2].name}} closed the shop on {{closed.day}} What is the best way to get this working?
has title: Find object by id using another object's id property from array of objects with ng-repeat
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28690313
has answer: http://stackoverflow.com/a/28690229
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/45672126
possible better answer: http://stackoverflow.com/a/28690229
type: Question
has answer: http://stackoverflow.com/a/28690333
tagged with: javascript
score: 0
answer count: 3

http://stackoverflow.com/comment/45622431
has text: You still need to add a little more code to your post, having a link to a site that is not a fiddle does not help always. I could spend an hour reading over your code or just wait til you post a fiddle reproducing the error. Looking at your page, it does not produce any javascript errors when you change pages. But your pages are dynamic, not static.. So my first guess would be that when you change pages.. your losing reference to the div/container or something along those lines
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28658927

http://stackoverflow.com/a/28678809
accepted answer of: http://stackoverflow.com/q/28678692
score: 0
type: AcceptedAnswer
has body: Not sure if you've ever looked at the Ionic Framework, but that sounds up your street. http://ionicframework.com/.
type: Answer
answers question: http://stackoverflow.com/q/28678692

http://stackoverflow.com/q/28613200
has body: I am using the following function to show message on my HTML page, that a file was successfully uploaded. The problem is that when i upload multiple files it only shows message of the last file that has been uploaded, instead of this i want to show messages for all the files that have been uploaded. i tried something like this but didnt work. function completeHandler(event){ var prevstatus = ""; $id("status").innerHTML = event.target.responseText + prevstatus; prevstatus = $id("status").innerHTML; $id("progressBar").value = 0; $id("progressBar").style.visibility = 'hidden'; } Doesnt seem to work using $id("status").innerHTML += event.target.responseText; The function that calls completeHandler() is: function UploadFile(file){ $id("progressBar").style.visibility = 'visible'; var xhr = new XMLHttpRequest(); xhr.upload.addEventListener("progress", progressHandler, false); xhr.addEventListener("load", completeHandler, false); xhr.addEventListener("error", errorHandler, false); xhr.addEventListener("abort", abortHandler, false); //start upload xhr.open("POST", $id("upload").action, true); xhr.setRequestHeader("X_FILENAME" , file.name); xhr.send(file); } Also this function uses the div status field function progressHandler(event){ var percent = (event.loaded / event.total) * 100; $id("progressBar").value = Math.round(percent); $id("status").innerHTML = Math.round(percent)+"% uploaded... please wait"; }
has answer: http://stackoverflow.com/a/28613954
type: UnansweredQuestion
has title: using javascript to show messages that php echoes
type: Question
has comment: http://stackoverflow.com/comment/45529942
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28613287
has answer: http://stackoverflow.com/a/28613257
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/45529972

http://stackoverflow.com/comment/45704179
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28707156
has text: I tried to find something here, but I couldn't. Should I delete it here? @isherwood
score: 0

http://stackoverflow.com/a/28678162
score: 4
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45691765
has comment: http://stackoverflow.com/comment/45684666
has comment: http://stackoverflow.com/comment/45706760
type: Answer
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/45684571
has comment: http://stackoverflow.com/comment/45677768
accepted answer of: http://stackoverflow.com/q/28652632
answers question: http://stackoverflow.com/q/28652632
has body: There are two parts to this answer. First, I recommed you use a LayoutView with CollectionViews, since you don't need a template for the collection itself (you'll still use the ItemView templates, though). Second, you'll have to let your Row view know how many check-mark columns you'll need (this will be trivial as you'll see) and we'll have to create those columns in the Row view. Load up your LayoutView Your FoodLayout view and template are perfect. You laid the foundation. What you need to populate it with is two CollectionView views: FoodManager.ColItemView = Marionette.ItemView.extend({ template: "#food-col-item", tagName: "th", }); FoodManager.ColView = Marionette.CollectionView.extend({ itemView: FoodManager.ColItemView }); FoodManager.RowItemView = Marionette.ItemView.extend({ template: "#food-row-item", tagName: "tr", }); FoodManager.RowView = Marionette.CollectionView.extend({ itemView: FoodManager.RowItemView }); Note that I changed your CompositeView to CollectionView, and changed your the tagName in the ItemView to tr for the Row view. (Note: you're going to want to remove the &lt;th&gt; tags in #food-col-item, Backbone will generate them for you.) Generating dynamic columns in Row view Now here comes the fun part. We're going to use templateHelpers to make the check-mark rows in your Row views. If you'll look at the docs, templateHelpers is a hash that let's you add data to your template before rendering. That "data", or JavaScript objects, can be functions (since function are first class objects in JavaScript). So, we're going to use templateHelpers to pass the food columns we'll need check-marks for, and to put together a function that will take as a parameter the food columns, and will return with the html for those check-mark columns. Put this templateHelpers property in your 'FoodManager.FoodLayout view: templateHelpers: function () { return { foods: function () { return this.foodColumns }, addColumns: function (foodcols) { var html = ''; for (foo…
has comment: http://stackoverflow.com/comment/45677711

http://stackoverflow.com/a/71164126
answers question: http://stackoverflow.com/q/28684902
score: 0
type: Answer
has body: You can also use \b(AI)\b for this instance.

http://stackoverflow.com/a/28747440
downvote count: 1
answers question: http://stackoverflow.com/q/28743152
score: -1
upvote count: 0
has comment: http://stackoverflow.com/comment/53069947
has body: Your helper function should simply return the Session value, instead of a function. Like this: getText: function () { return Session.get('editorContent'); } Here's a working example that you can clone and play around with.
type: Answer

http://stackoverflow.com/comment/45653769
has text: thanks, everyone for the help.
score: 0
comment on: http://stackoverflow.com/q/28680060
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45648158
comment on: http://stackoverflow.com/a/28677394
has text: @dave - The usage of for-in loop is not relevant to the question asked. This answers the question and resolves the problem.
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/a/28739287
type: Answer
upvote count: 1
has body: You can't do that you have to check once again on the server side and for the boxes like check box you know the value and for text box you can use regular expression
score: 1
answers question: http://stackoverflow.com/q/28738881
downvote count: 0

http://stackoverflow.com/comment/45774134
type: QuestionComment
has text: try req.body.access_token or req.params.access_token
score: 0
comment on: http://stackoverflow.com/q/28744805
type: Comment

http://stackoverflow.com/comment/45670088
type: Comment
has text: where is path defined in all this? i see the path.join references but no instantiation.
comment on: http://stackoverflow.com/a/28688669
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45751417
score: 0
has text: `It's retrieving the function object for the map method so that you can call call on it.` I'm very confused by this. `Array.prototype.map` creates a new array with the results of calling a provided function on every element in this array, right? What is the `function object` I'm retrieving in this case, and why do I need to get the function object to call `call` on it?
type: Comment
comment on: http://stackoverflow.com/a/28732564
type: AnswerComment

http://stackoverflow.com/q/28639805
tagged with: variables
favorite count: 0
has title: How do I select an element within a variable to trigger play
has comment: http://stackoverflow.com/comment/45578822
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28812123
has body: I'm using the RoyalSlider plugin. I'm getting the DOM content of the current slide using the following code. jQuery(document).ready(function($) { var sliderS = $('.royalSlider').data('royalSlider'); sliderS.ev.on('rsAfterSlideChange', function(e, slideObject) { var currentDOM = jQuery('.royalSlider').data('royalSlider').currSlide.content.context; // I want to PLAY the &lt;video&gt; in the currentDOM variable here. }); }); How does one go about selecting the &lt; video > in the variable? I've tried everything from .getElementById() to .find(). Nothing is working. HALP! To look at what I have going on: Current Sample
type: Question
score: 0
upvote count: 1
tagged with: jquery-selectors
answer count: 1
downvote count: 1
tagged with: javascript

http://stackoverflow.com/comment/45578221
type: Comment
has text: Are you running on a local web server? Or on a local C drive?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28616301

partial-application
type: Tag
tag name: partial-application
tags question: http://stackoverflow.com/q/28611122
tags question: http://stackoverflow.com/q/28744753

http://stackoverflow.com/a/28641326
score: 6
has comment: http://stackoverflow.com/comment/45612575
has comment: http://stackoverflow.com/comment/108622434
has comment: http://stackoverflow.com/comment/45618610
has body: You need to setup the program, then attributes and uniforms for each model before you draw it. use program for cube set attributes for cube set uniforms for cube draw cube use program for tetrahedon set attributes for tetrahedon set uniforms for tetrahedon draw tetrahedon use program for sphere set attributes for sphere set uniforms for sphere draw sphere use program = gl.useProgram set attributes = gl.enableVertexAttribArray, gl.vertexAttribPointer set uniforms = gl.uniformXXX, gl.activeTexture + gl.bindTexture See this answer as well
type: AcceptedAnswer
upvote count: 6
type: Answer
accepted answer of: http://stackoverflow.com/q/28614956
answers question: http://stackoverflow.com/q/28614956
downvote count: 0

http://stackoverflow.com/q/28631374
has title: angular select box - ng-options custom description
has answer: http://stackoverflow.com/a/28636278
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: angularjs
type: UnansweredQuestion
type: Question
has body: I've got a working angular select box: Which I'm trying to modify the 'as' portion in the ng-options, to look like this: The difference is some FeatureTypeFeatures have a custom description and some do not. I want to display the custom description when its available, and the normal description when its not. The problem is - it will only display the regular description whether there is custom description or not.
answer count: 2
has answer: http://stackoverflow.com/a/28636587
tagged with: javascript

http://stackoverflow.com/q/28706389
score: 0
has comment: http://stackoverflow.com/comment/45702528
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28707248
has comment: http://stackoverflow.com/comment/45702348
tagged with: ajax
has answer: http://stackoverflow.com/a/28707642
answer count: 5
has title: Echo PHP message after AJAX success
tagged with: php
has answer: http://stackoverflow.com/a/28707431
has comment: http://stackoverflow.com/comment/45702486
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45702295
accepted answer: http://stackoverflow.com/a/28707431
has body: I have a modal that will display when the user clicks a delete button. Once they hit the delete button I am using AJAX to subimit the form. Eveything works fine, but it is not display my success message which is set in PHP. Here is my AJAX code: function deleteUser(){ var id = &lt;?php echo $userdetails['id'] ?&gt;; $.ajax({ type: "POST", url: 'admin_user.php?id=' + id, data: $('form.adminUser').serialize(), error: function(e){ alert(e); }, success: function () { // This is empty because i don't know what to put here. } }); } Here is the PHP code: if ($deletion_count = deleteUsers($deletions)) { $successes[] = lang("ACCOUNT_DELETIONS_SUCCESSFUL", array($deletion_count)); } else { $errors[] = lang("SQL_ERROR"); } And then I call it like this: &lt;div class="col-lg-12" id="resultBlock"&gt; &lt;?php echo resultBlock($errors,$successes); ?&gt; &lt;/div&gt; When I use AJAX it does not display the message. This works fine on other pages that does not require AJAX to submit the form.
type: Question
possible better answer: http://stackoverflow.com/a/28706501
has answer: http://stackoverflow.com/a/28706580
has answer: http://stackoverflow.com/a/28706501

http://stackoverflow.com/comment/45635122
type: QuestionComment
has text: you can't; method closures to private in-constructor variables must happen in-constructor. if you make `_size` public, you can use prototype methods to reach it.
score: 0
comment on: http://stackoverflow.com/q/28670514
type: Comment

http://stackoverflow.com/a/28683146
has body: You can replace all special characters with the same, prefixed with a backslash to escape them. This is a very liberal replace, it escapes everything that's not whitespace or alphanumeric. You could be more strict by putting the specific characters in the character class, just remember to escape them (ala [\?\.]). nstring = "table_?" xstring = nstring.replace(/([^\s\w])/g,"\\$1"); alert("Start string: " + nstring + "; end: " + xstring); xstring then contains an escape-friendly string.
type: Answer
answers question: http://stackoverflow.com/q/28682352
score: 0

http://stackoverflow.com/comment/45648971
type: QuestionComment
has text: the log of beer is : Object {timeline: Object}
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28675748

http://stackoverflow.com/q/28727339
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28727450
has title: override fadeout() display: none
type: Question
has body: Have a fiddle here: http://jsfiddle.net/BP6rq/1514/ Fades my element out and puts it in a fixed position once it has reached the necessary point. I am using fadeOut() for the back-in effect. The problem is I do not want it to hide. I know about fadeTo, however I haven't been able to achieve that same effect. I've also tried overriding the display: none, but that eliminates the functionality of the fade effect. What can I do to maintain the fade effect, but not have fadeOut() disappear when scrolled back up and back to its original position? Thoughts?
has comment: http://stackoverflow.com/comment/45741138
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion

http://stackoverflow.com/q/28619433
has body: I have a javascript stopwatch displaying the time in MM:SS (minutes:seconds). If the time reaches 59:59 MM:SS then it should be automatically stopping (until the user hits Clear and Start again) instead of increasing to 60:00, 60:01 etc. How do I set a maximum time to prevent this? The code below allows the user to Stop, Start, Clear, and Save the Stopwatch which is perfect minus limiting the maximum time permitted on the javascript. Any help or links to documentation would be appreciated. javascript: html/php: Time:
has comment: http://stackoverflow.com/comment/45541731
downvote count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/28619585
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45541718
score: -1
has title: javascript stopwatch limit maximum time
has comment: http://stackoverflow.com/comment/45541680
answer count: 1
accepted answer: http://stackoverflow.com/a/28619585
has comment: http://stackoverflow.com/comment/45541621
has comment: http://stackoverflow.com/comment/45541648
favorite count: 0
has comment: http://stackoverflow.com/comment/45541719
has comment: http://stackoverflow.com/comment/45541834
has comment: http://stackoverflow.com/comment/45541745
has comment: http://stackoverflow.com/comment/45541640
has comment: http://stackoverflow.com/comment/45541711
has comment: http://stackoverflow.com/comment/45541781
has comment: http://stackoverflow.com/comment/45541771
type: AnsweredQuestion

http://stackoverflow.com/comment/45640325
type: Comment
type: QuestionComment
has text: seems correct, do you have any errors on the console? What is the problem?
comment on: http://stackoverflow.com/q/28673312
score: 0

http://stackoverflow.com/q/28749523
favorite count: 0
has title: Sending keyboard and mouse events from one browser tab to another
tagged with: events
score: 2
has answer: http://stackoverflow.com/a/28750599
tagged with: tabs
downvote count: 0
type: UnansweredQuestion
tagged with: google-chrome
type: Question
tagged with: dispatchevent
tagged with: javascript
upvote count: 2
answer count: 1
has body: So, I have web page that opens another page (browser tab) as a child to the first. The parent tab holds the code that performs the bulk of the application's work. The child tab holds a component that is normally embedded in the parent tab, but sometimes the user may want to open it in its own tab. So they can. The problem is, the component in the child tab supports about 20 different keyboard commands and a number of mouse related commands (as combos with keyboard commands). I was trying to avoid remapping each keyboard command in the child window to a call in the parent window. Right now, in the parent window, I use a plugin to map and handle keyboard commands that all get sent to the right component API call. What I want to do, is to just pipe keyboard and mouse events from the child window back to the parent, so that the regular handling of those events can proceed as normal. I don't want to have to setup specific handlers for every command all over again in the child window. Piping the key/mouse events feels more elegant, and would, ideally, take less code. The first thing I tried, is this: // CHILD WINDOW window.document.addEventListener("keydown", Redispatch, false); function Redispatch(event){ window.opener.myRedirector.dispatchChildEvent(event); } And in the parent window, it had this: myRedirector.dispatchChildEvent = function(event){ var r = dispatchEvent(e); console.log('dispatched event from child window'); } In this case, nothing happens. The console.log() function in the parent window never fires, and stepping through it, the console.log() line never gets hit. The dispatchEvent(e) call behaves as though an error occurs, but nothing is thrown (this is the latest Chrome). So I tried instantiating a new event in the parent like this (seen from another StackOverflow post): myRedirector.dispatchChildEvent = function(e){ var event = document.createEvent('KeyboardEvent'); var method = typeof event.initKeyboardEvent !== 'undefined' ? "initKeyboardEvent" : "ini…

http://stackoverflow.com/q/28595263
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/28595726
has body: Wondering if anyone can help me with this since I'm a javascript noob. My code works fine except for an error that I get: ReferenceError: Can't find variable: marker The moveMarker function is not seeing the variable "marker". I realize that I've added it within a keypress function and that's the only way I can get it to work but I don't know how to place the variable so that it can be accessed globally. I've added it outside the functions but then the map doesn't load at all. Can anyone give me a hand here? Thanks in advance &lt;script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=places"&gt;&lt;/script&gt; &lt;script&gt; var geocoder; var map; var nature = new google.maps.LatLng(45.51948, -73.59488); function initialize() { geocoder = new google.maps.Geocoder(); var latlng = new google.maps.LatLng(45.51948, -73.59488); var mapOptions = { zoom: 13, center: latlng } map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var ctaLayer = new google.maps.KmlLayer({ url: 'http://pa-nature.supermarchepa.com/assets/pa-nature.kmz' }); ctaLayer.setMap(map); var natureMarker = new google.maps.Marker({ position: nature, map: map, icon: 'http://pa-nature.supermarchepa.com/assets/pa-solo-map.svg', title: 'PA Nature' }); var input = document.getElementById('address'); var autocomplete = new google.maps.places.Autocomplete(input, { types: ["geocode"] }); autocomplete.bindTo('bounds', map); var infowindow = new google.maps.InfoWindow(); google.maps.event.addListener(autocomplete, 'place_changed', function() { infowindow.close(); var place = autocomplete.getPlace(); if (place.geometry.viewport) { map.fitBounds(place.geometry.viewport); } else { map.setCenter(place.geometry.location); map.setZoom(14); } moveMarker(place.name, place.geometry.location); }); $("input").focusin(function () { $(document).keypress(function (e) { if (e.which == 13) { infowindow.close(); var firstResult = $(".pac-container .pac-item:first").text(); var g…
score: -1
downvote count: 1
tagged with: google-maps
has comment: http://stackoverflow.com/comment/45497142
tagged with: javascript
has title: ReferenceError: Can't find variable: marker
tagged with: google-maps-api-3
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/28595710
has answer: http://stackoverflow.com/a/28595726
has comment: http://stackoverflow.com/comment/45497184
favorite count: 0
accepted answer: http://stackoverflow.com/a/28595710

http://stackoverflow.com/comment/45682617
score: 1
has text: Thanx Djip, now i know what its doing!
comment on: http://stackoverflow.com/q/28695992
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45712530
type: AnswerComment
comment on: http://stackoverflow.com/a/28712196
type: Comment
score: 1
has text: @AkbarBasha you want the position based on document or parent div? If it's based on the document, remove `position:relative` from the parent container.

http://stackoverflow.com/a/28704943
type: Answer
has comment: http://stackoverflow.com/comment/45700625
score: 5
has body: It sounds like you are not getting the correct element from the jQuery you provided in: $("textarea[name=icerik]") Right click on your CKEditor you don't want and click on 'Inspect Element'. In the console, look for the top div of the CKEditor and find its id or its name. If you find the id of it you will be able to call: $('#ckeditor-id').hide(); You will need to provide more details about your problem if there is no id for the CKEditor. It would be easier to diagnose the problem if you provided some code from your project or the html that is generated from the code. TIP: You can also use the 'console' tab after you click 'inspect element' to view any javascript/jQuery errors you are having. If indeed you are not getting the correct element from the jQuery you provided, an error will show up in the console. EDIT Try calling this inside the on load callback for CKEditor, not the document: CKEDITOR.on("instanceReady", function(event) { //put your code here });
upvote count: 5
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28704330
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28704330

http://stackoverflow.com/q/28719322
has title: How to make a function affect everything with a class but also take into account a data attribute
tagged with: javascript
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/28719482
possible better answer: http://stackoverflow.com/a/28719446
tagged with: jquery
has answer: http://stackoverflow.com/a/28719446
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28719482
has comment: http://stackoverflow.com/comment/45725826
upvote count: 1
downvote count: 1
type: Question
has body: I am making a comments system for my site and want to have the time since posted update at a set interval. Currently my javascript only takes into account one data-time attribute for every class but I want it to use each classes data-time attribute. My html looks something a little like this 0 days and 0 hours and 5 minutes and 40 seconds 0 days and 0 hours and 5 minutes and 40 seconds 0 days and 0 hours and 5 minutes and 40 seconds etc... data-time is the time in seconds since 1970. Now here's my javascript. //Time Update Function function time_elapsed() { time = $(".commentTime").attr("data-time"); currentTime = new Date().getTime() / 1000; time = currentTime - time; var days = Math.floor(time / 86400); var hours = Math.floor((time - (days * 86400 ))/3600); var minutes = Math.floor((time - (days * 86400 ) - (hours *3600 ))/60); var seconds = Math.floor((time - (days * 86400 ) - (hours *3600 ) - (minutes*60))); if ( seconds > 1 ){ updatedTime = seconds + " seconds"; }else{ updatedTime = seconds + " second"; } if ( minutes > 1 ){ updatedTime = minutes + " minutes and " + updatedTime; }else{ updatedTime = minutes + " minute and " + updatedTime; } if ( minutes > 1 ){ updatedTime = hours + " hours and " + updatedTime; }else{ updatedTime = hours + " hour and " + updatedTime; } if ( minutes > 1 ){ updatedTime = days + " days and " + updatedTime; }else{ updatedTime = days + " day and " + updatedTime; } $(".commentTime").html(updatedTime); } setInterval(time_elapsed(),1000); I'm pretty new to javascript and I just can't seem to make it treat each div uniquely.

http://stackoverflow.com/a/28671186
upvote count: 3
has body: I like to park a div off screen like so the image is preloaded: Loading... then use a bit of JQuery: var div = $("#LoadingDiv"); function LoadingDiv() { div.animate({ left: parseInt(div.css('left'), 10) == 0 ? -div.outerWidth() * 2 : 0 }); } (that's the simpler version)
score: 3
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28670953

http://stackoverflow.com/comment/45551602
type: Comment
comment on: http://stackoverflow.com/a/28625312
score: 0
type: AnswerComment
has text: Please show the corrected code here, not just as a link.

http://stackoverflow.com/comment/45738726
score: 0
type: QuestionComment
type: Comment
has text: if you are doing this than i would say dont do this instead I would use a stylized
comment on: http://stackoverflow.com/q/28726072

http://stackoverflow.com/q/28705646
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28705767
score: 1
upvote count: 1
tagged with: http
type: Question
has body: I just started out coding angular, and I'm not sure what I'm exactly doing wrong. I have a factory with a method that uses an $http get: angular.module('d3_survey') .factory('currentSurvey', ['$http', function($http) { return{ sweep : function(number) { console.log('resources/currentSurvey/' + number + '.json'); return $http.get('resources/currentSurvey/' + number + '.json').then(function (response) { return response; }); } } }]); I thought that I could do this since sweep is a closure and everything and it would still have access to $http. I resolve the service in my ui-router config. resolve : { surveyDetails : ['surveyQuestions', function(surveyQuestions){ return surveyQuestions.all(); }], messages : ['currentSurvey', function(currentSurvey) { return currentSurvey; }] } I inject "messages" onto my controller and try to call the sweep method: var messages = $scope.currentSurvey.sweep('1'); $scope.result = JSON.stringify(messages); But when I bind $scope.result to my view I get something weird on the page: {"$$state":{"status":0}} I saw other questions where some people have done a further .then() on the result of the factory method, but even this didn't work out. This is what I see on the console, but it doesn't make any sense: SyntaxError: Unexpected token m at Object.parse (native) at pc (http://localhost:63342/SurveyTool/js/angular.min.js:14:208) at Zb (http://localhost:63342/SurveyTool/js/angular.min.js:76:379) at http://localhost:63342/SurveyTool/js/angular.min.js:77:237 at s (http://localhost:63342/SurveyTool/js/angular.min.js:7:302) at Zc (http://localhost:63342/SurveyTool/js/angular.min.js:77:219) at c (http://localhost:63342/SurveyTool/js/angular.min.js:78:349) at http://localhost:63342/SurveyTool/js/angular.min.js:112:20 at l.$eval (http://localhost:63342/SurveyTool/js/angular.min.js:125:305) at l.$digest (http://localhost:63342/SurveyTool/js/angular.min.js:122:398) angular.js:11939
tagged with: javascript
has answer: http://stackoverflow.com/a/28705767
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
has title: Angularjs - Passing data to factory method not working

http://stackoverflow.com/comment/45660236
has text: @BenDavis: :) If `promiseReturner` wouldn't need a parameter, you could do `p = p.then(promiseReturner);` (note that I'm not calling the function). But actually, there is an alternative to the IIFE (immediately invoked function expression), `.bind`: `p = p.then(promiseReturner.bind(null, i));`.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28683318

http://stackoverflow.com/comment/45737691
score: 0
type: QuestionComment
type: Comment
has text: Transitions do not work on the `display` property. You will need to show/hide the element in another way if you want a transition. `Visibility` or `opacity` should work.
comment on: http://stackoverflow.com/q/28725431

http://stackoverflow.com/q/28611383
has comment: http://stackoverflow.com/comment/45526782
possible better answer: http://stackoverflow.com/a/28611568
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28611568
has comment: http://stackoverflow.com/comment/45526673
has answer: http://stackoverflow.com/a/28611519
has comment: http://stackoverflow.com/comment/45526859
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
has comment: http://stackoverflow.com/comment/45526717
has answer: http://stackoverflow.com/a/28611570
has title: Avoid background color from border color
score: 1
accepted answer: http://stackoverflow.com/a/28611519
upvote count: 1
has answer: http://stackoverflow.com/a/28611909
type: Question
type: AnsweredQuestion
has body: I have a div with a background color of rgba(255,0,0,1), and a border color of rgba(0,255,0,0.2), and a 10px border-radius. The problem is that the border color have the background color under it. This is my code: div{ background-color: rgba(255,0,0,1); border: 10px solid rgba(0,255,0,0.2); border-radius: 10px; width: 200px; height: 200px; } article{ margin: 10px; margin-top: 20px; background-color: rgba(255,0,0,1); outline: 10px solid rgba(0,255,0,0.2); outline-radius: 10px; width: 200px; height: 200px; } &lt;div&gt;&lt;/div&gt; &lt;article&gt;&lt;/article&gt; I need a border like at the outline. Saddly I can't use outline instead because it doesn't have "outline-radius" property, only "-moz-outline-radius", but it doesn't work on Chrome.

http://stackoverflow.com/q/28603292
favorite count: 0
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 4
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/28603634
has title: javascript execute function pressing 'esc' key
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28603634
has answer: http://stackoverflow.com/a/76698707
possible better answer: http://stackoverflow.com/a/28603442
has answer: http://stackoverflow.com/a/28603442
type: Question
has answer: http://stackoverflow.com/a/44028538
has body: I have 2 javascript functions: one of them shows div 'PhotoFull' another hides. 'PhotoFull' is a container Div.. Just black background for another Div inside of it. When the user clicks on black background, PhotoFull dessapears.. but if affects also the Div which is inside of 'PhotoFull' (PhotoFull dessapears while clicking the div which is inside). So For the Div which is inside I use event.stopPropagation(); Both functions work, but I also need to hide Div hideDiv() when "ESC" key is pressed. hideDiv() is executing Div function showDiv() { document.getElementById('PhotoFull').style.display = "inherit"; event.stopPropagation(); } function hideDiv() { var target = event.target || event.srcElement; if (event.currentTarget == target) { document.getElementById('PhotoFull').style.display = "none"; } } window.onload=function() { document.onkeyup = key_event; } function key_event(e) { if (e.keyCode == 27) hideDiv(); } And HTML: &lt;div id="PhotoFull" style="position: absolute; width: 100%; height: 100%; background-color: rgba(0,0,0, 0.75); display:none; z-index: 999;" onclick="hideDiv()"&gt; &lt;div style="width: 960px; border-radius: 3px; background-color: #ffffff; margin-top: 100px;"&gt; &lt;img id="one_full" src="numbers/1.jpg" style="max-width: 940px; margin: 10px;" /&gt; &lt;/div&gt; &lt;/div&gt; Without event.stopPropagation(); Pressing ESC button executes function hideDiv() but with it, nothing happens. Don't know why. Thanks for attention
tagged with: javascript
has comment: http://stackoverflow.com/comment/45511761

http://stackoverflow.com/q/28723659
tagged with: jquery
has comment: http://stackoverflow.com/comment/45734385
has answer: http://stackoverflow.com/a/28723749
answer count: 3
linked to: http://stackoverflow.com/q/507138
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45734083
has body: I was wondering if someone could help me. I'm trying to add .fancy-btn to the below using JavaScript. Get a quote I want .fancy-btn class added to the div container, but cant seem to figure out how to achieve is Thanks
has title: Add a class to an element with javascript
type: Question
has answer: http://stackoverflow.com/a/28723709
score: 0
has answer: http://stackoverflow.com/a/28723743
tagged with: javascript

http://stackoverflow.com/comment/45650936
score: 0
comment on: http://stackoverflow.com/q/28676085
type: Comment
type: QuestionComment
has text: I did try running with a local copy of all three JS. But it still doesn't display. I thought I downloaded the wrong JS.

http://stackoverflow.com/a/28703493
has comment: http://stackoverflow.com/comment/45697031
has body: Something like this var elems = document.querySelectorAll('#container .ball'); for (var i=elems.length; i--;) { elems[i].addEventListener('click', myFunc, false); } function myFunc() { this.innerHTML = parseInt(this.innerHTML, 10) + 1; } 1 2 3
answers question: http://stackoverflow.com/q/28703376
accepted answer of: http://stackoverflow.com/q/28703376
upvote count: 4
type: AcceptedAnswer
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/45697110
has comment: http://stackoverflow.com/comment/45696843
has comment: http://stackoverflow.com/comment/45697204
type: Answer
has comment: http://stackoverflow.com/comment/45696886

http://stackoverflow.com/comment/45581782
comment on: http://stackoverflow.com/a/28641453
score: 0
has text: That is correct. This approach is often used to improve the performance of a loop, to decrement the iterator toward 0 instead of incrementing it.
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/45660615
has text: Where is the element with class `.btnClass` in your html code?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28683910

http://stackoverflow.com/comment/45586916
has text: just how winhowes answered
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28644413
score: 0

http://stackoverflow.com/comment/45695368
has text: @TrueBlueAussie Yes, I am reconnecting the `localscroll` to the new element after cloning. HTML markup added. Thanks for your response
score: 0
comment on: http://stackoverflow.com/q/28702553
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45648154
comment on: http://stackoverflow.com/q/28676446
has text: You can try something like that, but without full code, I'm not able to tell you for 100% that this will work ( http://jsfiddle.net/hm0y59w4/ ), you should also read more about binding events in jquery/ javascript ( e.g. here http://api.jquery.com/on/ )
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45648527
has text: I've exhausted all the space here I can for this thread. I'm going to create a new thread with just the last comment and the code being used to start fresh. With this approach, hopefully, something will stand out very easily...
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28664050

http://stackoverflow.com/comment/45568389
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28612292
has text: I was pondering over that! Technically speaking my answer is the correct answer to the question, and it's code that will work as opposed to pseudo. In the interest of being nice, I'll let you decide :)
score: 3

http://stackoverflow.com/comment/45565826
type: AnswerComment
type: Comment
has text: I formed it as a npm module, so you can use it like a usual node module: npm i passport-url
comment on: http://stackoverflow.com/a/28623321
score: 0

http://stackoverflow.com/q/28749331
downvote count: 0
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/45781321
tagged with: javascript
has title: Angular JQuery Datepicker Not Setting MinDate on Load
upvote count: 2
answer count: 2
has comment: http://stackoverflow.com/comment/45782414
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28753101
possible better answer: http://stackoverflow.com/a/28759119
tagged with: angularjs
has answer: http://stackoverflow.com/a/28759119
tagged with: datepicker
has comment: http://stackoverflow.com/comment/45781010
has answer: http://stackoverflow.com/a/28753101
score: 2
has body: I'm using JQuery UI's Datepicker on Date From and Date To fields in an AngularJS project. I've added the directive to bind the value to the model value, and I've also added a check to OnSelect that sets the minDate and maxDate options for each field (so the Date To is never earlier than the Date From). The problem is that, on loading the page, no date has actually been selected (even though the model has a value), so it is still possible to select a To date earlier than the Date From. I added a $watch service to at least correct the error, but I still can't figure out how to set the minDate on load either within the directive or inside the controller. I've also tried $(document).ready outside of the Angular code, but that isn't working either. Here's my code prior to adding anything to set the minDate. Within controller: $scope.messagesForm.dateFrom = moment().subtract('days', 30).format('MM/DD/YYYY'); $scope.messagesForm.dateTo = moment().format('MM/DD/YYYY'); $scope.$watch('messagesForm.dateTo', function(newVal, oldVal) { if (!newVal) return; if (Date.parse(newVal) &lt; Date.parse($scope.messagesForm.dateFrom)) { $scope.messagesForm.dateFrom = newVal; } }); Directive: .directive('datepicker', function() { return { restrict: 'A', require : 'ngModel', link : function (scope, element, attrs, ngModelCtrl) { $(function(){ element.datepicker({ dateFormat: 'mm/dd/yy', showStatus: true, showWeeks: true, highlightWeek: true, maxDate: 0, numberOfMonths: 1, showAnim: "scale", showOptions: { origin: ["bottom", "right"] }, onSelect: function (date) { if (this.id === "MessageDateFrom") { $("#MessageDateTo").datepicker("option", "minDate", date); } else if (this.id === "MessageDateTo") { $("#MessageDateFrom").datepicker("option", "maxDate", date); } ngModelCtrl.$setViewValue(date); scope.$apply(); } }); }); } } }); HTML: &lt;div class="form-group"&gt; &lt;input type="text" id="MessageDateFrom" class="form-control dates" ng-model="messagesForm.dateFrom" datepicker readonly="reado…
type: AnsweredQuestion

http://stackoverflow.com/q/28624950
downvote count: 0
has comment: http://stackoverflow.com/comment/45555287
has comment: http://stackoverflow.com/comment/45553426
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28626707
tagged with: http://stackoverflow.com/tag/html
tagged with: web
upvote count: 1
has body: I have an HTML page with a button that when pressed download a file. I need to create a new website that will include the possibility to download that file and I would like to use the first page to do that. In other way I would like to make the new website to load the first HTML page without displaying it and use it only to download the file, emulating the button pressed. The only way that comes to my mind is parsing the HTML page and discover where the file is located and then download it. Are there other way to do the same in PHP? And in Javascript?
tagged with: php
has comment: http://stackoverflow.com/comment/45555443
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28626707
has comment: http://stackoverflow.com/comment/45555225
has title: Simulate a web page without displaying it
has comment: http://stackoverflow.com/comment/45555572
has comment: http://stackoverflow.com/comment/45555173
type: Question
answer count: 1

http://stackoverflow.com/q/28688439
has answer: http://stackoverflow.com/a/40825954
tagged with: web-worker
score: 2
type: AnsweredQuestion
downvote count: 0
favorite count: 0
has title: Shared worker do share variables
type: Question
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28700853
has body: I've been reading some documents about shared worker context. Lots of them point out shared worker do not share variables, which means they can not use each other variables. However, my experiment againsts that. Parent worker var port = new SharedWorker('worker.js').port; port.start(); port.postMessage('Hello'); Worker var ports = []; onconnect = function(e){ var port = e.ports[0]; port.start(); ports.push(port); console.log('Number of tabs: '+ports.length); }; ports.length keeps increasing when I open more tabs, which means ports is shared between workers. Could anybody please explain this?
accepted answer: http://stackoverflow.com/a/28700853
upvote count: 2
possible better answer: http://stackoverflow.com/a/40825954
tagged with: javascript

http://stackoverflow.com/a/28643486
has body: javascript changes 1.taken window variables t1,t2 where the timers are going to be assigned 2.added a button(name:reset),which on click calls doReset function 3.added doStuff function window.t1=null; window.t2=null; function do_countdown() { var start_num = document.getElementById("value").value; var unit_var = document.getElementById("countdown_unit").value; start_num = start_num * parseInt(unit_var); var countdown_output = document.getElementById('countdown_div'); if (start_num &gt; 0) { countdown_output.innerHTML = format_as_time(start_num); window.t1=setTimeout("update_clock(\"countdown_div\", "+start_num+")", 1000); } return false; } function update_clock(countdown_div, new_value) { var countdown_output = document.getElementById(countdown_div); var new_value = new_value - 1; if (new_value &gt; 0) { new_formatted_value = format_as_time(new_value); countdown_output.innerHTML = new_formatted_value; window.t2=setTimeout("update_clock(\"countdown_div\", "+new_value+")", 1000); } else { countdown_output.innerHTML = "Time's UP!"; } } function format_as_time(seconds) { var minutes = parseInt(seconds/60); var seconds = seconds - (minutes*60); if (minutes &lt; 10) { minutes = "0"+minutes; } if (seconds &lt; 10) { seconds = "0"+seconds; } var return_var = minutes+':'+seconds; return return_var; } function doReset(){ window.clearTimeout(window.t1); window.clearTimeout(window.t2); document.getElementById('countdown_div').innerHTML=""; } HTML &lt;form id="countdown_form" onSubmit="return do_countdown();"&gt; Countdown from: &lt;input type="text" style="width: 30px" id="value" value="10" text-align="center"/&gt; &lt;select id="countdown_unit"&gt; &lt;option value="1"&gt;Seconds&lt;/option&gt; &lt;option value="60"&gt;Minutes&lt;/option&gt; &lt;option value="3600"&gt;Hours&lt;/option&gt; &lt;/select&gt; &lt;input type="submit" value="Start" /&gt; &lt;input type="button" onClick="return doReset();" value="Reset" id="reset"&gt; &lt;/form&gt; &lt;div id="countdown_div"&gt;&amp;nb…
accepted answer of: http://stackoverflow.com/q/28642852
upvote count: 1
answers question: http://stackoverflow.com/q/28642852
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/45684973
comment on: http://stackoverflow.com/q/28697412
type: Comment
type: QuestionComment
has text: How about build the object as you want it and then use `JSON.stringify(myObject);` however, is it the actually JSON string you want, or are you asking how to build an object? You want a list of something,then use an array and `push()` each item in to that array
score: 2

grunt-concurrent
tag name: grunt-concurrent
tags question: http://stackoverflow.com/q/28641850
type: Tag

http://stackoverflow.com/comment/45690141
comment on: http://stackoverflow.com/a/28698729
has text: very good... you should go to http://www.responsivegridsystem.com there you can find an easy way to get responsive divs
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45595103
type: Comment
type: QuestionComment
has text: This is not "achieved", its simply a side effect of a particular implementation. It might not even hold for all keys (some engines are known to treat numerical keys differently).
score: 1
comment on: http://stackoverflow.com/q/28648083

http://stackoverflow.com/comment/45592966
type: AnswerComment
has text: @user456789123 I've updated the code and the explanation inside the yellow box.
type: Comment
comment on: http://stackoverflow.com/a/28647092
score: 0

http://stackoverflow.com/comment/45685867
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28697674
score: 0
has text: Sorry, missed it, I corrected the comment. What you have to do is simply `result = string.match(strlok)`. No need for loop. `result` will be an array if something is found and the length of an array will be the count. Otherwise it will be null.

http://stackoverflow.com/q/28715077
type: UnansweredQuestion
type: Question
has body: I have problem with request, because about 1-3 requests run away and I don't know why. I put two variables: counter and check, they should be equal but generally they don't. If I check this on small data, e.g. 1 service, it works, but for all the data has not working. var request = require('request'); var UserAgent = 'Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0' var check = "" var counter = "" services = [ { name: "otodom", url: 'http://otodom.pl/', css_selector: '.search__counter', sell: { individual: { house: 'http://otodom.pl/index.php?mod=listing&amp;source=context&amp;objSearchQuery.OfferType=sell&amp;objSearchQuery.OnlyFromRegularUser=y&amp;objSearchQuery.ObjectName=House', terrain: 'http://otodom.pl/index.php?mod=listing&amp;source=context&amp;objSearchQuery.OfferType=sell&amp;objSearchQuery.OnlyFromRegularUser=y&amp;objSearchQuery.ObjectName=Terrain', flat: 'http://otodom.pl/index.php?mod=listing&amp;source=context&amp;objSearchQuery.OfferType=sell&amp;objSearchQuery.OnlyFromRegularUser=y&amp;objSearchQuery.ObjectName=Flat', }, totalUser: { house: 'http://otodom.pl/index.php?mod=listing&amp;source=context&amp;objSearchQuery.OfferType=sell&amp;objSearchQuery.ObjectName=House', terrain: 'http://otodom.pl/index.php?mod=listing&amp;source=context&amp;objSearchQuery.OfferType=sell&amp;objSearchQuery.ObjectName=Terrain', flat: 'http://otodom.pl/index.php?mod=listing&amp;source=context&amp;objSearchQuery.OfferType=sell&amp;objSearchQuery.ObjectName=Flat', } }, rent: { individual: { house: 'http://otodom.pl/index.php?mod=listing&amp;source=context&amp;objSearchQuery.OfferType=rent&amp;objSearchQuery.OnlyFromRegularUser=y&amp;objSearchQuery.ObjectName=House', terrain: 'http://otodom.pl/index.php?mod=listing&amp;source=context&amp;objSearchQuery.OfferType=rent&amp;objSearchQuery.OnlyFromRegularUser=y&amp;objSearchQuery.ObjectName=Terrain', flat: 'http://otodom.pl/index.php?mod=listing&amp;source=context&amp;objSearchQuery.OfferType=rent&amp;objSe…
tagged with: httprequest
score: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45734329
has title: Javascript NodeJS - too many request at once?
tagged with: node.js
has comment: http://stackoverflow.com/comment/45718114
answer count: 0
has comment: http://stackoverflow.com/comment/45718486
has comment: http://stackoverflow.com/comment/45758898

http://stackoverflow.com/q/28649650
has title: How to implement variable tension functionality, D3 hierarchical edge bundling?
possible better answer: http://stackoverflow.com/a/50169534
has answer: http://stackoverflow.com/a/50169534
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
accepted answer: http://stackoverflow.com/a/28663615
type: Question
has body: I am following a d3 sample on hierarchical edge bundling - http://mbostock.github.io/d3/talk/20111116/bundle.html What I am only interested in is, how may I incorporate tension functionality in the above sample in the simplest way possible on top of the following example (its code is here): I've studied the code @ the 1st link but cannot determine which parts of the code attribute to the desired functionality. @ the 2nd link however, I know the following code may be involved / altered. Please guide me along. var line = d3.svg.line.radial() .interpolate("bundle") .tension(.85) .radius(function (d) { return d.y; }) .angle(function (d) { return d.x / 180 * Math.PI; });
upvote count: 4
answer count: 2
tagged with: bundle-layout
downvote count: 0
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/28663615
favorite count: 0

http://stackoverflow.com/q/28633771
type: Question
has title: Change depth level of nested for each loop during runtime
has body: I want to be able to iterate over the same collection to a specified depth. For example: function (depth){ var arr = [1,2,3]; //depth = 1 arr.forEach(function(val) { func(val); }); // depth = 2 arr.forEach(function (val) { arr.forEach( function (val2) { func(val, val2); }); }); //and so on } is there a way to do this in JS?
score: 0
answer count: 1
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/45567556
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28633851

http://stackoverflow.com/q/28665873
tagged with: function
downvote count: 0
has title: using dependency injection to return a function in javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28665905
possible better answer: http://stackoverflow.com/a/28665908
has answer: http://stackoverflow.com/a/28665908
has body: Is there a way to return a function in javascript without calling it, but still specifying parameters? I'm working on a simple imitation of angular's dependency injection system in javascript using node.js--the inject() method is called like this: var injectedFunction = module.inject(function (funcToRegister) { return funcToRegister(); }); And the module.inject() function looks like this: var inject = function(func) { var args = resolveDependencies(func); // so 'args' is an array of function dependencies, like [Function: funcToRegister] return func.apply(null,args); // not sure how to correctly return this function! }; Currently I can't figure out how to return the function with its updated dependencies (as arguments) without actually calling it, or just returning a null object. Any ideas? Thanks!
tagged with: node.js
type: AnsweredQuestion
tagged with: return
upvote count: 1
accepted answer: http://stackoverflow.com/a/28665905
type: Question
tagged with: dependency-injection
score: 1
tagged with: javascript
answer count: 2

http://stackoverflow.com/comment/45596940
type: QuestionComment
score: 0
has text: @A.Wolff Actually, I just tried `$('iframe.cboxIframe').contents().find("form.form-vertical").length` from the Chrome dev console and it shows that it exists. If I do that same code from the JS code block at the bottom of the page, it shows it doesn't exist, which doesn't make sense since the iframe is loaded when the `.ready()` call is made (and this is in that).
comment on: http://stackoverflow.com/q/28648906
type: Comment

http://stackoverflow.com/q/28749011
upvote count: 0
type: UnansweredQuestion
has title: Check which button was selected on previous page
has answer: http://stackoverflow.com/a/28749112
type: Question
has comment: http://stackoverflow.com/comment/46204560
tagged with: javascript
score: -1
answer count: 1
downvote count: 1
tagged with: jquery
favorite count: 0
has body: I have an initial landing page which has 2 submit buttons on it. One button will display a specific set of results and the other button will display a different set. Basically I am passing through the text value onto the next page for it to display some player biographys and reviews. &lt;form action="resultpage.html" method="GET"&gt; &lt;input type="text" name="playerName" /&gt; &lt;input type="submit" value="Submit"/&gt; &lt;input type="submit" value="Submit"/&gt; &lt;/form&gt; I was wondering is it possible when I hit button 1 it will display my biography function information and only it, then when I hit button 2 it will display only the blogreviews functions' information. $(document).ready(function() { biography(files); blogsreviews(files); });

http://stackoverflow.com/q/28652308
answer count: 1
tagged with: jquery
type: UnansweredQuestion
tagged with: tablesorter
has answer: http://stackoverflow.com/a/28652368
has body: I'm trying to use the tablesorterPager addon to paginate a table. I've followed this tutorial precisely, but when I load the page, I see the whole table and I get a console error saying that tablesorterPager is undefined. Here is my JS code in my HTML page: $(function(){ $("#myTable").tablesorter(); }); $('#my-table') .tablesorter({ theme: 'blue', widget: ['zebra'] }) .tablesorterPager({ container: $('#pager'), size: 2 }); I have identical copies of the JS and CSS files from the tutorial and they are loading just fine. When the page loads, I can sort the table, but none of the pagination features work. I'm still very new to JS and jQuery so I don't know how to debug the problem further.
tagged with: ruby-on-rails
type: Question
tagged with: javascript
has title: jQuery Tablesorter Pager not working in Rails 4
score: 0

http://stackoverflow.com/q/28639077
score: 0
answer count: 1
tagged with: facebook-graph-api
has answer: http://stackoverflow.com/a/29987706
has title: Only run Facebook log-in when user clicks button
type: UnansweredQuestion
tagged with: facebook
has body: I am using the Facebook SDK to retrieve the current logged in user on Facebook and output their name and e-mail address. The issue I am having is when a user visits my page their name and e-mail address is automatically being displayed. I would like this to only happen if they click the Facebook log-in function. My JS is: function statusChangeCallback(response) { if (response.status === 'connected') { updateUIWithFacebookFields(); } } function checkLoginState() { FB.getLoginStatus(function(response) { statusChangeCallback(response); }); } window.fbAsyncInit = function() { FB.init({ appId : 'snipped', cookie : false, xfbml : true, version : 'v2.1' }); FB.getLoginStatus(function(response) { statusChangeCallback(response); }); }; (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); function updateUIWithFacebookFields() { FB.api('/me', function(response) { var registerUsernameElm = document.getElementById('username'); var registerUserEmailElm = document.getElementById('useremail'); if(registerUsernameElm) { registerUsernameElm.value = response.name; } if(registerUserEmailElm) { registerUserEmailElm.value = response.email; } }); } And my button code is: &lt;fb:login-button scope="public_profile,email" size="large" onlogin="checkLoginState();"&gt;&lt;/fb:login-button&gt;&lt;/span&gt; How can I only have this run when the button is clicked?
type: Question
tagged with: javascript

http://stackoverflow.com/comment/45756297
has text: The correct methodology here is to [authenticate the user](https://www.firebase.com/docs/web/guide/user-auth.html), and utilize [security rules](https://www.firebase.com/docs/security/) to control read/write access (e.g. `".write": "auth.uid === $user_id"`).
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28721024
score: 1

http://stackoverflow.com/a/28638102
has comment: http://stackoverflow.com/comment/45576237
has comment: http://stackoverflow.com/comment/45578064
accepted answer of: http://stackoverflow.com/q/28636498
has comment: http://stackoverflow.com/comment/45576328
has comment: http://stackoverflow.com/comment/45576004
upvote count: 4
has comment: http://stackoverflow.com/comment/45576577
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/45576296
type: AcceptedAnswer
has body: You are assigning the HTML id attribute inside the options hash; you want to assign it inside the html_options hash. Try passing an empty hash for options: &lt;%= f.select( :user, User.not_god.map{|u| [u.to_s, u.id]}, {}, { id: 'user-select' } ) %&gt; Take a look at the docs to see the order of the formal arguments. http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#method-i-select Edit: Also, check that your jQuery, selectize, and custom scripts are being loaded in the correct order. app/assets/javascripts/application.js //= require jquery //= require jquery_ujs //= require selectize $(function() { $('#user-select').selectize({ create: true, sortField: 'text' }); });
type: Answer
answers question: http://stackoverflow.com/q/28636498

http://stackoverflow.com/comment/45610165
has text: i don't know jquery can you give the code
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28656944

http://stackoverflow.com/a/28697698
answers question: http://stackoverflow.com/q/28697557
has comment: http://stackoverflow.com/comment/45685628
score: 1
has comment: http://stackoverflow.com/comment/45685977
upvote count: 1
has body: Have you looked at the source? My guess is that the original data is itself wrapped in a paragraph. You're adding some text after the paragraph closes, so the browser interprets it as a new paragraph.
downvote count: 0
has comment: http://stackoverflow.com/comment/45685764
type: Answer

http://stackoverflow.com/comment/45632379
type: Comment
comment on: http://stackoverflow.com/a/28669053
has text: What actually is happening here is that :- I am working on a popup window while deleting the contact, on success I want the popup to close which I am doing using the openModal function which resets every popup window.
type: AnswerComment
score: 0

http://stackoverflow.com/a/28713664
accepted answer of: http://stackoverflow.com/q/28713264
answers question: http://stackoverflow.com/q/28713264
score: 0
type: AcceptedAnswer
has body: You could use the CSS3 "columns" property as shown on CSS-Tricks
type: Answer

http://stackoverflow.com/comment/52682789
type: Comment
comment on: http://stackoverflow.com/a/32402374
score: 5
type: AnswerComment
has text: It's called *destructuring*, not "deconstructor", and it's not an operator :-/

http://stackoverflow.com/q/28713493
accepted answer: http://stackoverflow.com/a/28713623
possible better answer: http://stackoverflow.com/a/28714073
type: AnsweredQuestion
tagged with: typescript
has body: "TypeScript lets you write JavaScript the way you really want to. TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. Any browser. Any host. Any OS. Open Source." According to it, Typescript is created just to ease the JavaScript development. Am I right ? or it has something more to offer ? Can in use in html pages ? Is it compatible with all the modern browsers ? I was looking for these answers but the most of the basic thread related to TypeScript are closed.
has answer: http://stackoverflow.com/a/28713623
type: Question
answer count: 2
tagged with: javascript
upvote count: 2
score: 0
downvote count: 2
has answer: http://stackoverflow.com/a/28714073
favorite count: 0
has title: What the purpose of Typescript?

http://stackoverflow.com/a/28712701
has body: By using jQuery: $( window ).resize(function() { // Adding table when window resized to below 500px if($(this).width() <= 500){ $( "body" ).append( " Table created "); }else if($(this).width() > 500){ // Removing table from DOM when window resized to above 500px $( "#dynamicTable" ).remove(); } });
downvote count: 0
answers question: http://stackoverflow.com/q/28712561
type: Answer
score: 1
upvote count: 1

deserialization
type: Tag
tags question: http://stackoverflow.com/q/28736104
tags question: http://stackoverflow.com/q/28706300
tag name: deserialization

http://stackoverflow.com/comment/83797307
type: Comment
has text: Essentially re-create what you want printed to pdf on a page in the background.
comment on: http://stackoverflow.com/a/31726736
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47100194
comment on: http://stackoverflow.com/a/29435855
score: 0
has text: Completely the same code as above but instead I want to see home.html as a partial page
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/45608739
type: Comment
comment on: http://stackoverflow.com/a/28649905
has text: Thanks Alexander, your answer helps. I want to get other opinions too, so I will wait before I accept on final answer :)
type: AnswerComment
score: 0

http://stackoverflow.com/q/28654203
possible better answer: http://stackoverflow.com/a/29145377
has answer: http://stackoverflow.com/a/28660730
has answer: http://stackoverflow.com/a/29145377
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45605730
accepted answer: http://stackoverflow.com/a/28660730
has comment: http://stackoverflow.com/comment/45605536
has comment: http://stackoverflow.com/comment/45605374
answer count: 2
tagged with: javascript
tagged with: web-worker
score: 0
has comment: http://stackoverflow.com/comment/45606109
has comment: http://stackoverflow.com/comment/45605739
has body: Trying out the web worker API for the first time and can't seem to get a response from the background worker. Markup: Trigger Worker Contents of script.js file: function TriggerWorker() { var myWorker = new Worker('worker.js'); myWorker.onmessage = function (e) { console.log(e.data); } console.log(myWorker); myWorker.postMessage("Text sent to worker"); } Contents of worker.js file: onmessage = function (e) { postMessage('OK'); } I can get the myWorker object to write to the console, but the response "OK" never makes it back into the console. When inspecting the myWorker object, I can see that the onmessage property is set to "Permission denied".
tagged with: http://stackoverflow.com/tag/html
has title: <Permission denied> error trying to instantiate web worker object

http://stackoverflow.com/comment/45873967
type: AnswerComment
has text: Thta is just splendid!..Thank you very much.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28706435

http://stackoverflow.com/a/28746644
has body: create a custom directive and u can call manually keypress event app.directive("myDirective",function(){ return{ link:function(scope,elem,attrs){ elem.on('keypress', function(){ // do some thing here } } } })
type: Answer
has comment: http://stackoverflow.com/comment/45812138
has comment: http://stackoverflow.com/comment/45813564
has comment: http://stackoverflow.com/comment/45812719
answers question: http://stackoverflow.com/q/28745553
score: 0

http://stackoverflow.com/comment/45720536
type: Comment
type: QuestionComment
has text: An HTTP 405 error is Method Not Allowed, The resource you're trying to hit does not accept the POST method
comment on: http://stackoverflow.com/q/28716424
score: 0

http://stackoverflow.com/q/28677789
favorite count: 0
has answer: http://stackoverflow.com/a/28678099
has answer: http://stackoverflow.com/a/28678045
tagged with: d3.js
has title: D3 Arrow marker representing Target - Source flow, as opposed to Source - Target flow
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28678045
tagged with: javascript
answer count: 2
has body: I have been playing around with multiple D3 examples for my project. I have just added the feature where multiple lines (or links) going between the same two nodes are individually shown - using arcs. I took great help from: http://jsfiddle.net/zhanghuancs/a2QpA/ I then attempted to show directionality through the marker attribute, but have noticed that my arrows show the opposite direction between my nodes. For example, if I have a node source A, targeting node B, the arrow will point from B to A, instead of A to B. I have created a simple jsfiddle showing my problem. Could someone please tell me what I'm doing wrong? http://jsfiddle.net/RoshPlaha/5xj4159t/ var path = svg.append("svg:g") .selectAll("path") .data(force.links()) .enter().append("svg:path") .style("stroke", function(e) { return strokeLineColour(e)}) .attr("marker-end", "url(#arrow)"); &lt;marker id="arrow" viewbox="0 -5 10 10" refX="20" refY="0" markerWidth="10" markerHeight="10" orient="auto"&gt; &lt;path d="M0,-5L10,0L0,5Z"&gt; &lt;/marker&gt; I have used the above same arrow functionality previously, so am unsure why the direction has been flipped. Thanks in advance
downvote count: 0
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28678099

http://stackoverflow.com/a/28704745
has body: By default, every prototype has a constructor property that refers to the function that it "belongs" to. function A() { } console.log(A.prototype.constructor === A); // true If you overwrite a prototype in its entirety with an object literal or with some other constructed prototype, this constructor value will get wiped away and be left undefined or with some other value. function A() { } A.prototype = { greeting: "Hello!" }; console.log(A.prototype.constructor === A); // false The prototype constructor property is not needed in order for the constructor to operate correctly, but people will often reassign prototype.constructor back to its initial value in order to maintain consistency, and that's what you are seeing for Lexer. Consider: function A() { } function B() { } B.prototype = Object.create(A.prototype); var b = new B(); console.log(b.constructor === A); // true console.log(b.constructor === B); // false B.prototype.constructor = B; console.log(b.constructor === A); // false console.log(b.constructor === B); // true One can only speculate as to why this was left out for HashMap. I doubt it was done for any good reason and may have just been an oversight.
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28703896
has comment: http://stackoverflow.com/comment/45700662
upvote count: 8
type: Answer
score: 8
has comment: http://stackoverflow.com/comment/45700853
accepted answer of: http://stackoverflow.com/q/28703896

http://stackoverflow.com/comment/45507431
comment on: http://stackoverflow.com/a/28599267
type: AnswerComment
has text: oh yeah, chaining is a thing. THXS
score: 0
type: Comment

http://stackoverflow.com/q/28599203
has answer: http://stackoverflow.com/a/28599462
tagged with: angularjs
upvote count: 2
has body: I want to know difference between ng-bind, ng-bind-html and ng-bind-html-unsafe. Also when I run below code, I am getting error which is as mentioned below : Code : <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> HTML Injection Security in AngularJS Normal Text Error : Error: [$sce:unsafe] Attempting to use an unsafe value in a safe context. http://errors.angularjs.org/1.3.11/$sce/unsafe at REGEX_STRING_REGEXP (https://www.angularapprj.com:4443/js/angular.js:63:12) at htmlSanitizer (https://www.angularapprj.com:4443/js/angular.js:15053:13) at getTrusted (https://www.angularapprj.com:4443/js/angular.js:15217:16) at Object.$get.sce.(anonymous function) [as getTrustedHtml] (https://www.angularapprj.com:4443/js/angular.js:15897:16) at Object.ngBindHtmlWatchAction [as fn] (https://www.angularapprj.com:4443/js/angular.js:20449:29) at Scope.$get.Scope.$digest (https://www.angularapprj.com:4443/js/angular.js:14230:29) at Scope.$get.Scope.$apply (https://www.angularapprj.com:4443/js/angular.js:14493:24) at bootstrapApply (https://www.angularapprj.com:4443/js/angular.js:1449:15) at Object.invoke (https://www.angularapprj.com:4443/js/angular.js:4182:17) at doBootstrap (https://www.angularapprj.com:4443/js/angular.js:1447:14) What does it mean? I know using declarative code within imperative code is not good practice, though I was just trying with Hello World in ng-bind-html directive.
accepted answer: http://stackoverflow.com/a/28599462
score: 2
type: AnsweredQuestion
type: Question
tagged with: ng-bind-html
tagged with: javascript
tagged with: ng-bind
downvote count: 0
answer count: 1
favorite count: 0
has title: Difference between ng-bind, ng-bind-html, ng-bind-html-unsafe in AngularJS?

http://stackoverflow.com/comment/45726409
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28719612
has text: contentEditable pages support undo commands, but I don't know how good the browser support for that is

http://stackoverflow.com/q/28691547
has title: Preventing memory leak with my code
has comment: http://stackoverflow.com/comment/45674450
tagged with: javascript
has answer: http://stackoverflow.com/a/28691698
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/45674451
has answer: http://stackoverflow.com/a/28691682
has comment: http://stackoverflow.com/comment/45674784
tagged with: ajax
type: UnansweredQuestion
tagged with: memory-leaks
has body: im using this code: &lt;!-- Progress bar holder --&gt; &lt;div id="progress" style="width:300px; height:20px; border:1px solid #ccc; float: right; margin-top: 7px; margin-right: 7px;"&gt;&lt;/div&gt; &lt;!-- Progress information --&gt; &lt;div id="information" style="width; text-align: center; margin-top: 7px;"&gt;&lt;/div&gt;&lt;/div&gt; inside a while loop: // Javascript for updating the progress bar and information echo '&lt;script language="javascript"&gt; document.getElementById("progress").innerHTML="&lt;div style=\"width:'.$percent.';background-color:#ddd;\"&gt;&amp;nbsp;&lt;/div&gt;"; document.getElementById("information").innerHTML="'.$i.' av '.$no_lines.' rader processade."; &lt;/script&gt;'; // This is for the buffer achieve the minimum size in order to flush data echo str_repeat(' ',1024*64); // Send output to browser immediately flush(); $i will increase with +1 every time the while loop does something, this can be very large. upwards of 300k. and currently the code crashes at ~14000 (memory usage is above 1gb ram then). it also hovers at around 30% cpu usage and makes internet usage very unpleasant while uploading ive never worked with javascript before, and ive read up about memory leaks in javascript, however it doesnt help me with how i prevent this. i found some links which help me sort of, however i dont know how to apply them to my code http://javascript.info/tutorial/memory-leaks for example: empty(), remove(), removeData(). i also looked at this post: http://www.javascriptkit.com/javatutors/closuresleak/ it was helpful to understand what was happening but couldnt figure out what i did wrong. currently im only doing the code if $i % 100 == 0 which is so bad im not even proud of that "solution". could anyone of you help me prevent the memory leak in my code?
has answer: http://stackoverflow.com/a/28691752
type: Question

http://stackoverflow.com/q/28639715
type: Question
answer count: 1
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45583733
has answer: http://stackoverflow.com/a/28702890
accepted answer: http://stackoverflow.com/a/28702890
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45584451
has comment: http://stackoverflow.com/comment/45652173
tagged with: google-analytics
type: AnsweredQuestion
has title: Google analytics recording simultaneous events at different rates
has body: We are trying to track 2 different metrics at the same point in our code. Events of both types are being recorded, but there is a significant difference in the totals reports. The totals for the first call made are roughly 20% higher. I am hoping someone can tell my why the totals reported for one metric are not the same as the other one, which should be created simultaneously. Here is the relevant code: in the controller: if (type === 'yahoo') { analyticsService.sync('yahoo', PathYahoo + '/' + YahooKey); analyticsService.sync('Launch:' + $rootScope.launchType, 'yahoo'); }; in the analyticsService: popupApp.factory('analyticsService', ['$http', function( $http) { return { sync: function(action, label) { _gaq.push(['_trackEvent', 'Sync', action, label]); } } }]}; We are getting far more 'yahoo' events than 'Launch:' events. If anyone can explain the difference or point me towards a fix I would really appreciate it. I am pretty sure that we are well under the rate limits, and that we have few enough sessions to not invoke sampling. Thanks for your help!

http://stackoverflow.com/q/28655685
upvote count: 1
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/45608311
type: Question
tagged with: javascript
has title: What is the difference between light and dark blue in Chrome network tab
has comment: http://stackoverflow.com/comment/45607851
downvote count: 0
tagged with: web
has comment: http://stackoverflow.com/comment/45608489
favorite count: 0
type: UnansweredQuestion
tagged with: sockets
has comment: http://stackoverflow.com/comment/45608568
tagged with: php
has body: I'm experiencing a problem where requests (clicks on internal a hrefs) get stuck in pending state. Then when the page does respond, I see in the network tab the pending task divided to light and dark blue. Like this: What does the light blue actually mean? Does this mean it was stuck at the client side for the light-blue time, or might it be that the request was stuck at the server?
has comment: http://stackoverflow.com/comment/45608442
answer count: 0
score: 1

http://stackoverflow.com/comment/45602030
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28646980
has text: I want to be sure my site works in cultures using a "," instead of a "." as decimal separator.
score: 0

http://stackoverflow.com/comment/45644690
has text: No it isn't. Try this: `console.time('CSS'); $('*').css({ color: 'black' }); console.timeEnd('CSS')`. 13.875ms for me, on this page...
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28675291
score: 0

http://stackoverflow.com/a/28707939
has comment: http://stackoverflow.com/comment/53919100
answers question: http://stackoverflow.com/q/28701750
downvote count: 0
type: Answer
upvote count: 1
has body: propTypes propTypes is an object because it's used to declare that a prop is a specific JS primitive. For example: React.createClass({ propTypes: { optionalArray: React.PropTypes.array, optionalBool: React.PropTypes.bool, optionalFunc: React.PropTypes.func } }); This helps to ensure components are used correctly. When an invalid value is provided for a prop a warning will be shown in the JavaScript console. getDefaultProps() getDefaultProps is used to define default values for props, and is invoked once and cached when the class is created. Why I believe the advantage, or reason rather, getDefaultProps() is a function is so it can be cached to avoid recalculation the next time the component is used.
has comment: http://stackoverflow.com/comment/45750240
score: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28701750

http://stackoverflow.com/comment/45942549
type: AnswerComment
score: 0
type: Comment
has text: But are you sure there will always be updated content on server side every 30seconds ? If not, then you're unnecessarily making requests to get same content :)
comment on: http://stackoverflow.com/a/28836006

http://stackoverflow.com/comment/45649076
has text: Your error is elsewhere, the expression is fine.
type: Comment
comment on: http://stackoverflow.com/q/28677907
score: 0
type: QuestionComment

http://stackoverflow.com/a/28714642
score: 0
has comment: http://stackoverflow.com/comment/45717116
type: Answer
answers question: http://stackoverflow.com/q/28712860
has body: code for assigning multiple texboxes values to multiple labels. if any code redundancy is ther . plz let me know ... $(function () { $("#&lt;%= TextMonday.ClientID%&gt;").keyup(function () { $("#&lt;%= LMonday.ClientID%&gt;").text($(this).val()); }); $("#&lt;%= TextTuesday.ClientID%&gt;").keyup(function () { $("#&lt;%= LblTuesday.ClientID%&gt;").text($(this).val()); }); $("#&lt;%= Textwednesday.ClientID%&gt;").keyup(function () { $("#&lt;%= LblWednesday.ClientID%&gt;").text($(this).val()); }); $("#&lt;%= TextThursday.ClientID%&gt;").keyup(function () { $("#&lt;%= LblThursday.ClientID%&gt;").text($(this).val()); }); $("#&lt;%= TextFriday.ClientID%&gt;").keyup(function () { $("#&lt;%= LblFriday.ClientID%&gt;").text($(this).val()); }); $("#&lt;%= TextSataurday.ClientID%&gt;").keyup(function () { $("#&lt;%= LblSataurday.ClientID%&gt;").text($(this).val()); }); });

http://stackoverflow.com/q/28635141
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28635228
upvote count: 29
has comment: http://stackoverflow.com/comment/45570828
has answer: http://stackoverflow.com/a/28635195
has title: Sequence in which HTML page loads?
downvote count: 1
type: Question
score: 28
tagged with: javascript
has answer: http://stackoverflow.com/a/28635288
answer count: 3
has body: What is the sequence in which a HTML page loads. Please see below a basic HTML outline - <link rel="stylesheet" href="css/sheet2.css" button1 button2 What i know - (please correct me if i am not right) head section is loaded first. and then body section loads. My questions - 1. Does body section begin to load only once head section is loaded completely? 2. Does css sheet1 load completely, and then only sheet2 and JS file start loading? 3. Does CSS files load in parallel? same with JS files..? or does CSS and JS file together load in parallel? 4. Since HQ* images are big files, it takes time to load. does button2 load and show up in page only once HQ1 and HQ2 is loaded completely? 5. Does downloading of HQ1 and HQ2 happen in parallel, or is it synchronous which is first HQ1 and then HQ2?
favorite count: 0
has comment: http://stackoverflow.com/comment/45570440
has comment: http://stackoverflow.com/comment/45570323
linked to: http://stackoverflow.com/q/8996852
type: UnansweredQuestion

http://stackoverflow.com/comment/45642372
has text: That seems to be an accident. Should I remove the first one? Or remove more than one? What should I leave?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28674513

http://stackoverflow.com/q/28730521
has comment: http://stackoverflow.com/comment/45747306
has body: I want to output a value in PHP, something like the example below. How can I achieve this? var number='1'; var $user_link = "&lt;?php echo bp_core_get_user_domain('" + number + "') ?&gt;";
favorite count: 0
score: -1
type: UnansweredQuestion
downvote count: 2
tagged with: php
has comment: http://stackoverflow.com/comment/45747490
upvote count: 1
has title: how can I put a string into php in jquery in this situation?
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28730735
answer count: 1

http://stackoverflow.com/a/28676249
type: Answer
answers question: http://stackoverflow.com/q/28675738
has comment: http://stackoverflow.com/comment/45646469
has body: The selection of technologies for building an application depends on the use of your application and the platform you want it to run on. Web applications in contrast to Desktop applications are hosted and served by servers (like Tomcat) which are then requested and present to you by your browser. Desktop applications are running on your local machine and they are independent from your browser. However node webkit, allows you to design applications using HTML and making them dynamic using node. The end result is a standalone application that runs as a browser emulation that is able to render and run software based on HTML and javascript. (In this case nodejs serves the application locally and the standalone web-app is the client). Long story short node-webkit emulates the client-server model that is used for classic web apps, to build desktop applications. It is an unorthodox way for doing things IMHO, but it might be a good start for getting into application development.
score: 4
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/45645830

http://stackoverflow.com/comment/45693935
comment on: http://stackoverflow.com/q/28701913
type: Comment
type: QuestionComment
score: 1
has text: For part1, have you tried it out? `/(value1|value2|value3|(v|b|c)alue4)/.test("balue4")`

http://stackoverflow.com/a/28612984
answers question: http://stackoverflow.com/q/28612903
has body: I expect that you have an element with id select-card. Your code is otherwise fine. But you should be using. select.addEventListener("change", function(){ } );
score: 6
upvote count: 6
has comment: http://stackoverflow.com/comment/45529504
downvote count: 0
type: Answer

google-fusion-tables
type: Tag
tags question: http://stackoverflow.com/q/28709975
tags question: http://stackoverflow.com/q/28684428
tags question: http://stackoverflow.com/q/28635493
tag name: google-fusion-tables

twitter-bootstrap
tags question: http://stackoverflow.com/q/28627794
tags question: http://stackoverflow.com/q/28625938
tags question: http://stackoverflow.com/q/28639783
tag name: twitter-bootstrap
tags question: http://stackoverflow.com/q/28599671
tags question: http://stackoverflow.com/q/28603374
tags question: http://stackoverflow.com/q/28717029
tags question: http://stackoverflow.com/q/28686437
tags question: http://stackoverflow.com/q/28700609
tags question: http://stackoverflow.com/q/28749882
tags question: http://stackoverflow.com/q/28705503
tags question: http://stackoverflow.com/q/28667681
tags question: http://stackoverflow.com/q/28593579
tags question: http://stackoverflow.com/q/28677363
tags question: http://stackoverflow.com/q/28729259
tags question: http://stackoverflow.com/q/28661705
tags question: http://stackoverflow.com/q/28665814
tags question: http://stackoverflow.com/q/28746769
tags question: http://stackoverflow.com/q/28671920
tags question: http://stackoverflow.com/q/28745164
tags question: http://stackoverflow.com/q/28695229
tags question: http://stackoverflow.com/q/28613992
tags question: http://stackoverflow.com/q/28637997
tags question: http://stackoverflow.com/q/28736200
tags question: http://stackoverflow.com/q/28733762
tags question: http://stackoverflow.com/q/28740164
tags question: http://stackoverflow.com/q/28647604
tags question: http://stackoverflow.com/q/28701028
tags question: http://stackoverflow.com/q/28603496
tags question: http://stackoverflow.com/q/28739189
tags question: http://stackoverflow.com/q/28608378
tags question: http://stackoverflow.com/q/28603082
tags question: http://stackoverflow.com/q/28687550
tags question: http://stackoverflow.com/q/28709641
tags question: http://stackoverflow.com/q/28607292
tags question: http://stackoverflow.com/q/28623041
tags question: http://stackoverflow.com/q/28595687
tags question: http://stackoverflow.com/q/28701957
tags question: http://stackoverflow.com/q/28669033
tags question: http://stackoverflow.com/q/28705093
tags question: http://stackoverflow.com/q/28700969
tags question: http://stackoverflow.com/q/28713787
tags question: http://stackoverflow.com/q/28635578
tags question: http://stackoverflow.com/q/28712207
tags question: http://stackoverflow.com/q/28644597
tags question: http://stackoverflow.com/q/28711129
tags question: http://stackoverflow.com/q/28649894
type: Tag
tags question: http://stackoverflow.com/q/28605515
tags question: http://stackoverflow.com/q/28600564
tags question: http://stackoverflow.com/q/28614523
tags question: http://stackoverflow.com/q/28736294
tags question: http://stackoverflow.com/q/28666946
tags question: http://stackoverflow.com/q/28649570
tags question: http://stackoverflow.com/q/28743214
tags question: http://stackoverflow.com/q/28686005
tags question: http://stackoverflow.com/q/28646215
tags question: http://stackoverflow.com/q/28728724
tags question: http://stackoverflow.com/q/28654289
tags question: http://stackoverflow.com/q/28695960
tags question: http://stackoverflow.com/q/28703738
tags question: http://stackoverflow.com/q/28613120
tags question: http://stackoverflow.com/q/28734731
tags question: http://stackoverflow.com/q/28631631
tags question: http://stackoverflow.com/q/28639327
tags question: http://stackoverflow.com/q/28730114
tags question: http://stackoverflow.com/q/28707957
tags question: http://stackoverflow.com/q/28599470
tags question: http://stackoverflow.com/q/28617705
tags question: http://stackoverflow.com/q/28633796
tags question: http://stackoverflow.com/q/28639676
tags question: http://stackoverflow.com/q/28666826
tags question: http://stackoverflow.com/q/28612125
tags question: http://stackoverflow.com/q/28694132
tags question: http://stackoverflow.com/q/28650978
tags question: http://stackoverflow.com/q/28679560
tags question: http://stackoverflow.com/q/28722248
tags question: http://stackoverflow.com/q/28617332
tags question: http://stackoverflow.com/q/28711513
tags question: http://stackoverflow.com/q/28685398

http://stackoverflow.com/a/53773916
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: What I try to understand is if I can use the .pipe() method on something, doesn't it mean that it's a stream? Yes! It is a stream. But it's a an object stream! Instead of streaming a series characters, it streams a series of objects, which are the files that you sourced. Each 'data' event in a gulp stream emits a Vinyl file object, which looks something like this: { cwd: '/', //&lt;string&gt; base: '/test/', //&lt;string&gt; path: '/test/file.js', //&lt;string&gt; contents: contents //&lt;string&gt; | &lt;Buffer&gt; | &lt;stream.Readable&gt; } So gulp-buffer plugin is a Transform stream that converts the file contents from stream.Readable to Buffer. You can see this in the source, where it saves the original content stream on line 24 and assigns a Buffer as the new file contents on line 35. Streamify does the same thing, on line 35 and line 48. It's ok to leave the file contents as a Buffer after Uglify is done processing it. It's always ok for the contents to be a Buffer, gulp just doesn't do this when sourcing because it's too costly.
answers question: http://stackoverflow.com/q/28683949

http://stackoverflow.com/a/28699476
answers question: http://stackoverflow.com/q/28698584
downvote count: 0
score: 1
upvote count: 1
has body: Your code have a watch in it if you remove then your code will be working fine. HTML Drop Images or PDFs files here File Drag/Drop is not supported for this browser Js var app = angular.module('myApp', ['angularFileUpload']); app.controller('fileUploadCtrl', function($rootScope, $scope, $upload) { $scope.$watch('files', function () { $scope.onFileSelect($scope.files); }); $scope.fileUploadFinished = false; $scope.onFileSelect = function($files) { for (var i = 0; i < $files.length; i++) { var file = $files[i]; $scope.upload = $upload.upload({ url: 'system/upload.php', method: 'POST', file: file }).progress(function(evt) { // progress bar ... }).success(function(data, status, headers, config) { // file is uploaded successfully }); } }; }); Updated js link
has comment: http://stackoverflow.com/comment/45689336
type: Answer

http://stackoverflow.com/comment/45604881
type: QuestionComment
comment on: http://stackoverflow.com/q/28653939
score: 0
type: Comment
has text: `sr` is not an object, it is a property name.

http://stackoverflow.com/a/39587716
score: 0
answers question: http://stackoverflow.com/q/28599638
type: Answer
has body: Better if you are sending all form data then use data: $(this).serialize() in ajax, and inside form use {{ csrf_field() }}

http://stackoverflow.com/a/28745243
downvote count: 0
has body: You can use tc.getIndexOfChild() and tc.selectedChildWidget along with tc.getChildren() to be able to avoid using id's. Like this: nextTab = function () { var tc = registry.byId("mainTabContainer"); console.log("next tab", tc); var currIndex = tc.getIndexOfChild(tc.selectedChildWidget); var tabs = tc.getChildren(); if (currIndex &lt; tabs.length - 1) { tc.selectChild(tabs[currIndex+1]); } Here is a fiddle: http://jsfiddle.net/aGCFs/252/
accepted answer of: http://stackoverflow.com/q/28738794
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28738794
score: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/45624694
has text: Your dependencies don't match up - $stateParams is the the 3rd param in the dependency list, but the last parameter in your controller function.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28664663
type: Comment

http://stackoverflow.com/comment/45701104
type: QuestionComment
has text: Boxing day is the same day as Christmas?!?
comment on: http://stackoverflow.com/q/28705618
score: 0
type: Comment

http://stackoverflow.com/a/28671623
has comment: http://stackoverflow.com/comment/45636886
has body: The born function should be within the Human declaration. function Human(age, name, lastname) { this.age = age; this.name = name; this.lastname = lastname; this.born = function () { var currentyear = 2015; var born = this.age - currentyear; return born; } } var asaf = new Human(16,"Asaf","shlush"); var daniel = new Human(19 , "Daniel" , "Bivas"); document.write(asaf.born()); Note the parenthesis around the function call in the last line as well.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28671536

http://stackoverflow.com/a/28609036
has comment: http://stackoverflow.com/comment/75785343
downvote count: 0
has comment: http://stackoverflow.com/comment/75743290
has comment: http://stackoverflow.com/comment/75717232
type: Answer
has body: You can use RegExp /(,|\D)(?=\1)|^[,\D]|[^,\d]$/g to match comma or non-digit character followed by comma or non-digit character or comma or non-digit at beginning of string or last character of string is not a digit or comma, replace match with empty string. $(".commaseparated").on("input", function(e) { $(e.target).prop("value", function(_, val) { return val.replace(/(,|\D)(?=\1)|^[,\D]|[^,\d]$/g, ""); }) }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt; &lt;/script&gt; &lt;input type="text" class="commaseparated"/&gt;
has comment: http://stackoverflow.com/comment/75717048
has comment: http://stackoverflow.com/comment/75759034
answers question: http://stackoverflow.com/q/28594889
score: 4
upvote count: 4

http://stackoverflow.com/q/28682091
has comment: http://stackoverflow.com/comment/45810483
answer count: 0
has comment: http://stackoverflow.com/comment/45766432
type: UnansweredQuestion
has title: Is there a way to password protect an assemble.io website?
has comment: http://stackoverflow.com/comment/45712481
tagged with: assemble
type: Question
has comment: http://stackoverflow.com/comment/45812698
score: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45766276
has body: I'm looking for a way to restrict access and password protect an assemble.io website. The idea is to mimic a web application authorization where there is a login form with user/password fields. In this case there would be just one user and password. The member would login and gai. Access to the restricted area of the application and be able to view/browse beyond the login area. Being a static website, I want to avoid .htacess basic authentication. Is there a way to do this in assemble? Using pure js or something else which would provide a basic authentication for static websites? I was imagining sending the user and password to an external API and if there are valid the user is redirected to the restricted area. Don't know how it would deal with the session in this case but maybe there's a js way to deal with them.
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45723638
comment on: http://stackoverflow.com/q/28703854
score: 0
type: Comment
type: QuestionComment
has text: I am not sure I fully understand your need, but you may want to try using the changes feed to run a view that gets all the people in the room when person 1 leaves. Then run your second view, this is assuming your events are being recorded on the same person document. Hope this helps. As far as your question, I don't think you can call a view within a view.

http://stackoverflow.com/q/28705536
linked to: http://stackoverflow.com/q/12930202
favorite count: 0
tagged with: ajax
has title: PhantomJs - Getting value out of page.evaluate + ajax (Synchronous Version)
score: 2
type: AnsweredQuestion
downvote count: 0
has body: Problem: Extracting data from ajax request inside page.evaluate Description: I usually get variables out of page.evaluate by simply returning them. However, I need to make an ajax request within the context of a page, and then I need to process its result out of the page's context. The code I'm trying to fix is: var theOutput = page.evaluate(function () { return $.ajax({ async: false, url: 'http://localhost:8080/captcha.php', data: { filename: 'C:\\wamp\\www\\images\\0.png' }, type: 'post', success: function (output) { parsed_output = $.parseHTML(output); return parsed_output[4].data.trim(); }, }); }); console.log(theOutput); The variable parsed_output[4].data.trim() is a string. But when I log output I get a [object Object], with the properties abort, always, complete, done, error, fail, getAllResponseHeaders, getResponseHeader, overrideMimeType, pipe null, progress, promise, readyState, setRequestHeader, state, statusCode, success,then. Question: How can I extract theOutput from page.evaluate?
type: Question
has answer: http://stackoverflow.com/a/28705633
accepted answer: http://stackoverflow.com/a/28705633
tagged with: phantomjs
tagged with: javascript
has comment: http://stackoverflow.com/comment/45741116
upvote count: 2
answer count: 1
tagged with: jquery

http://stackoverflow.com/comment/45676298
type: Comment
comment on: http://stackoverflow.com/a/28691121
has text: And this solution does not provide really random values, if output count less than all items count. It depends on previously generated values, so consequent numbers gets more chances.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45609720
type: AnswerComment
comment on: http://stackoverflow.com/a/28656541
type: Comment
has text: the problem of this would be difficult access to each element i wanted e.g. i wanted to get the data for 2009-01": { "bbcfour": 324}. I could access the array[0] but in order to get to bbcfour's value?
score: 0

http://stackoverflow.com/q/28663772
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has title: $q: default reject handler
has answer: http://stackoverflow.com/a/28665592
has comment: http://stackoverflow.com/comment/45622534
tagged with: promise
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45623361
upvote count: 3
has body: I want to return a $q instance so that if clients don't call 'then' with a reject handler, then a default one runs. E.g. assume the default is to alert(1) Then mypromise.then(function(result){...}) will alert 1 but mypromise.then(null, function(reason){alert(2)}) will alert 2
tagged with: angular-promise
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/28665592
has comment: http://stackoverflow.com/comment/45632885
has comment: http://stackoverflow.com/comment/45625602

http://stackoverflow.com/q/28655824
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/28655861
has answer: http://stackoverflow.com/a/28655861
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28655860
has body: I have been toying with creating a small library for a web app I am working on. In creating this library, I can enter a log statement at the top of the script, and everything below works fine. However, if I remove the top console.log statement, I get errors. Code is below. Errors are: ReferenceError: assignment to undeclared variable TestFirst Code: $(document).ready(function() { (function() { console.log('starting'); 'use strict'; function define_TestFirst() { function TestFirst () {}; return TestFirst; } if (typeof(TestFirst) === 'undefined') { console.log('defined'); TestFirst = define_TestFirst(); TestFirst.prototype.test = function () { console.log('TestFirst object created.'); } } else { console.log('TestFirst library already defined!'); } })(); });
type: Question
has title: Why does console.log stop errors in javascript Library?
possible better answer: http://stackoverflow.com/a/28655860
tagged with: javascript

http://stackoverflow.com/comment/45643837
has text: Don't rely on user agents, use feature detection, instead.
comment on: http://stackoverflow.com/a/28593949
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28653876
answers question: http://stackoverflow.com/q/28653797
type: Answer
accepted answer of: http://stackoverflow.com/q/28653797
has comment: http://stackoverflow.com/comment/45649800
score: 1
upvote count: 1
has body: If culling them in a periodic batch process is not feasible, I would make the check as part of whatever code gets the document. You may have notifications longer than two weeks in the database, but assuming you have a single place where a 'get' takes place, you could do the check there and guarantee that no document with a stale notification is returned untrimmed.
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28726193
has title: increment / decrement a url pathname click
has comment: http://stackoverflow.com/comment/45741105
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45741130
has body: I have a site with a URL structure like www.example.com/en-US/some-campaign-2469/. On my page, I have hardcoded "next" and "previous" links that is supposed to take the user to /some-campaign-2470" on "next"-click and "/some-campaign-2468" on "previous"-click. I've managed to access the path of the url by using the window.location.pathname which retrieves /en-US/some-campaign-2469/. So far so good, but what I don't seem to be able to wrap my head around is how to target the last part of the url and increment/decrement a href when clicking on my next/prev-button.
has comment: http://stackoverflow.com/comment/45739017
score: 0
has comment: http://stackoverflow.com/comment/45739257
has comment: http://stackoverflow.com/comment/45738974
tagged with: url
has answer: http://stackoverflow.com/a/28726302
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28726412

http://stackoverflow.com/comment/45539101
has text: Who knew it wasn't even a javascript issue. I'll just go ahead and say it. Making a website is hard....
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28617977
type: AnswerComment

http://stackoverflow.com/a/28602625
type: Answer
has body: You can place the script links anywhere in the document within . Where you should place is arguable. The only think you should make sure whether you have placed the script in right order. For example JqueryUI plugin depends on Jquery plugin. So you should always include Jquery first then Jquery UI. In the video Visual Studio placed Render module at the end of the page the author just decided to place it at the start of the page and then when he added the Jquery UI he added it on the index.cshtml to render the jquery ui after jquery If you want to keep the render at the bottom of _Layout page you should add jquery UI link in the _Layout page after the Render Section module. Example @ViewBag.Title @Styles.Render("~/Content/css") @RenderBody() @Scripts.Render("~/bundles/jquery") @RenderSection("Scripts", required: false) Hope this helps!!
score: 2
has comment: http://stackoverflow.com/comment/45554590
upvote count: 2
has comment: http://stackoverflow.com/comment/45864621
has comment: http://stackoverflow.com/comment/45526108
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28600828
answers question: http://stackoverflow.com/q/28600828

http://stackoverflow.com/comment/45515152
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28603025
has text: Do `echo $_POST["id"]` in your xyz.php. And when the ajax success it should get stores inside `html`. Check whether it is in console or not.

http://stackoverflow.com/a/28598297
has body: You don't have to access the rowIndex, you can directly find the amount like $('input.qtyPrice').on('change', function () { var $tr = $(this).closest('tr'); $tr.find('td:nth-child(5) input').val('updated') })
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28598251
has comment: http://stackoverflow.com/comment/45502958
accepted answer of: http://stackoverflow.com/q/28598251
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/28613343
has body: I have these "pages" aka div's inside a scrollable container. On command, I am trying to find out what part of the div in question, is touching the top of .pageContent. So for example, right when the page loads, no part of #page_1 is touching the top of pageContent, but as I scroll down. #page_1 hits the top of .pageContent and I now want to figure out where that is. I know I can get the position of .pageContent using $("#pageContent").scrollTop() but these page's could be different sizes and I am not sure how to go about figuring it out. Could anyone put me in the right direction? jsfiddle HTML CSS #pageContent { overflow: auto; width:500px; height:300px; padding:10px; border:1px solid black; background-color:grey; } .content { height:400px; width:300px; margin:0 auto; background-color:red; margin-bottom:10px; }
answer count: 4
has answer: http://stackoverflow.com/a/28614146
has answer: http://stackoverflow.com/a/28614085
type: Question
has answer: http://stackoverflow.com/a/28613835
has answer: http://stackoverflow.com/a/28613637
tagged with: javascript
tagged with: jquery
has title: Finding position of element within scrollable div
score: 0
type: UnansweredQuestion

http://stackoverflow.com/q/28648929
has body: I am trying to send a simple ajax request while using node.js: $.ajax({ type: "POST", data: { name: "John", location: "Earth" } }) But I am getting the following error: POST http://localhost:3000/ 403 (Forbidden)jquery-2.1.3.min.js:4 n.ajaxTransport.k.cors.a.crossDomain.sendjquery-2.1.3.min.js:4 n.extend.ajaxVM475:2 (anonymous function)VM465:777 InjectedScript._evaluateOnVM465:710 InjectedScript._evaluateAndWrapVM465:626 InjectedScript.evaluate I have a controller set up that handles other types of POST requests, but for some reason it won't handle this one. I thought that perhaps it was occuring because I was running the code in the console, but when I did the following I got the same error message: $(document).on('click',function() { $.ajax({ type: "POST", data: { name: "John", location: "Earth" } }) }); ALSO, when I use type:"GET" it works no problem. I am assuming it is some sort of cross site scripting error, but I'm not scripting cross site? What do I need to do to send this POST request? UPDATE, I am using the hackathon starter package: https://github.com/sahat/hackathon-starter#why-do-i-get-403-error-forbidden-when-submitting-a-form Which states the following: "You need to add the following hidden input element to your form. This has been added in the pull request #40 as part of the CSRF protection. input(type='hidden', name='_csrf', value=_csrf) Note: It is now possible to whitelist certain URLs. In other words you can specify a list of routes that should bypass CSRF verification check. Note 2: To whitelist dynamic URLs use regular expression tests inside the CSRF middleware to see if req.originalUrl matches your desired pattern."
has comment: http://stackoverflow.com/comment/45595383
tagged with: javascript
type: UnansweredQuestion
tagged with: ajax
has comment: http://stackoverflow.com/comment/45595476
has answer: http://stackoverflow.com/a/28649807
type: Question
has comment: http://stackoverflow.com/comment/45595464
answer count: 1
tagged with: node.js
score: 0
has comment: http://stackoverflow.com/comment/45595533
has title: Getting 403 error and "n.ajaxTransport.k.cors.a.crossDomain.send" when sending a post request using Node.js

http://stackoverflow.com/q/28635103
has comment: http://stackoverflow.com/comment/45570169
tagged with: jquery-animate
tagged with: javascript
tagged with: jquery
has title: horizontally repeated picture twitches when using .animate() to move it in y direction
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45570220
has comment: http://stackoverflow.com/comment/45592946
answer count: 0
type: UnansweredQuestion
tagged with: css
has body: I am coding a loading screen with a div that slowly moves out of the screen. But it is twitching for reasons I do not know. This is the code I am talking about: function fadeLoadingScreen() { $('#loadingBanner').animate({ bottom: "-15%", opacity: 0 }, 2000, function() { $('#loadingDiv').hide(); }); } $(document).ready(function() { fadeLoadingScreen(); }); #loadingDiv { position: fixed; width: 100%; height: 100%; background-color: white; z-index: 10000; } #loadingBanner { background-image: url("http://images.gofreedownload.net/thumps/crown-pattern-banner-erected-europeanstyle-vector-89228.jpg"); background-size: auto 100%; background-repeat: repeat-x; position: fixed; bottom: 0; height: 15%; width: 100%; z-index: 10000; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div id="loadingDiv"&gt; &lt;div id="loadingBanner"&gt;&lt;/div&gt; &lt;/div&gt; https://jsfiddle.net/71btwr2j/ can anyone explain this behavior?
type: Question

httppostedfilebase
type: Tag
tags question: http://stackoverflow.com/q/28666676
tag name: httppostedfilebase

abide
type: Tag
tag name: abide
tags question: http://stackoverflow.com/q/28686981

http://stackoverflow.com/comment/45685514
comment on: http://stackoverflow.com/q/28696171
has text: I would have gladly shown a screen-shot, but this site doesnt seem to allow for that
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45555579
comment on: http://stackoverflow.com/q/28626161
score: 0
type: Comment
type: QuestionComment
has text: Well if the `manage_user_create.php`-script doesn't exists on the other server or that script doesn't accept the `POST` parameters you post and you don't have access to the server so you can change the script, then there isn't whole lot you can do...

http://stackoverflow.com/q/28646237
has answer: http://stackoverflow.com/a/28646272
accepted answer: http://stackoverflow.com/a/28646272
has title: javascript for loop array
has body: can someone please explain how I add/subtract one part of an array (xpos) to another (speed) and then put the answer back into the xpos array. ive tried for loops but can get it to work. is there another way? &lt;script&gt; var xpos = []; var speed = []; for (i=0;i&lt;10;i++) { vx = Math.floor((Math.random() * 5) + 1); xpos.push(vx); vy = Math.floor((Math.random() * 100) + 10); speed.push(vy); } document.write(xpos+"&lt;br&gt;"); document.write(speed); &lt;/script&gt;
type: AnsweredQuestion
upvote count: 0
type: Question
tagged with: arrays
tagged with: javascript
score: -1
downvote count: 1
answer count: 1
favorite count: 0

http://stackoverflow.com/a/28599897
answers question: http://stackoverflow.com/q/28599664
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45506234
has body: You can use jquery in your footer.php file to archieve this , here is the fiddle $(document).ready(function() { if($("#log").length){ $( "#first_reading" ).keyup(function() { $.sum(); }); $( "#second_reading" ).keyup(function() { $.sum(); }); } $.sum = function(){ $("#total_reading").val(parseInt($("#first_reading").val()) + parseInt($("#second_reading").val())); } });
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45506197
has comment: http://stackoverflow.com/comment/45506850
has comment: http://stackoverflow.com/comment/45506768
accepted answer of: http://stackoverflow.com/q/28599664
upvote count: 2
has comment: http://stackoverflow.com/comment/45506824
has comment: http://stackoverflow.com/comment/45506565

http://stackoverflow.com/comment/45519078
type: AnswerComment
comment on: http://stackoverflow.com/a/28607130
has text: @JayD.. you can create a fiddle and try to show me where it goes wrong
type: Comment
score: 0

http://stackoverflow.com/q/28620318
has body: Suppose you have a textarea and a button, and that you wanted that button to get the position of the caret in a textarea, whenever that button was clicked. (I know, there would be a loss of focus from the text area to the button.) Is there a way to recall where the caret was in the textarea? If so, how would one go about doing that (so that they could, for example, have said button write text to that area)?
score: 5
upvote count: 5
accepted answer: http://stackoverflow.com/a/28620495
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45543100
has comment: http://stackoverflow.com/comment/45543164
answer count: 2
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has answer: http://stackoverflow.com/a/35032635
favorite count: 0
has title: Getting the position of the caret in textarea on click
possible better answer: http://stackoverflow.com/a/35032635
has answer: http://stackoverflow.com/a/28620495
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/28691735
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: mongodb
has title: Coverting Circular structure to JSON in Moongoose and NodeJS
tagged with: mongoose
tagged with: javascript
score: 0
type: UnansweredQuestion
has body: I am trying to build a query builder in mongodb with Node.Js as my back-end. So my server side code is like: exports.runPostQuery = function(req, res) { console.log(JSON.stringify(req.body.q)); var collection = mongoose.connection.collection(req.body.collection); collection.find(JSON.stringify(req.body.q), function(err, docs) { if (err) throw err; res.json(docs); }); }; here req.body.colletion is the collection name and req.body.q consist the query condition . for simplicity I just pass an empty json object in it. And its throwing me an error as : TypeError: Converting circular structure to JSON at Object.stringify (native) at ServerResponse.json (/Users/prateek/webapps/ecommerce-toolbox/node_modules/meanio/lib/core_modules/server/node_modules/express/lib/response.js:228:19) I sear for this error and found that this is the case when we have circular json object like : var a ={}; a.b = a But this is not the case with my JSON . can anyone please explain me the detail about the reason for this error and how to solve this .
tagged with: node.js
has comment: http://stackoverflow.com/comment/45695885
answer count: 0
has comment: http://stackoverflow.com/comment/45676080

http://stackoverflow.com/q/28670953
has answer: http://stackoverflow.com/a/28671617
has body: I want to do something very simple. I have one button in my page.. &lt;body&gt; &lt;img src="images/myloadingimage.png" style="display: none;" id="loading_image"&gt; &lt;form id="myform" type="post" action="test.php" &gt; Name : &lt;input type="name" id="name" value="" /&gt;&lt;br /&gt; LName : &lt;input type="lname" id="lname" value="" /&gt;&lt;br /&gt; &lt;input type="submit" id="submit" name="Submit" /&gt; &lt;/form&gt; &lt;/body&gt; Now what I want is when the user presses this submit button.. It shows that "loading" gif animation until form submission completes. I want in Javascript. How do i implement this.
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45635839
has answer: http://stackoverflow.com/a/28671094
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28671186
answer count: 6
tagged with: forms
has answer: http://stackoverflow.com/a/28671100
has answer: http://stackoverflow.com/a/28671037
accepted answer: http://stackoverflow.com/a/28671037
has comment: http://stackoverflow.com/comment/45635776
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28671150
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28671186
has title: Wait Message when submitting form
score: 1

http://stackoverflow.com/a/28821820
answers question: http://stackoverflow.com/q/28715799
type: Answer
has body: I create a simply sheet to test the script. Here it is: https://docs.google.com/spreadsheets/d/1DhDo_1A20tWdSaYMknAmuxnVJFW14QY6xBXr9BGyS-g/edit#gid=0 If I use the "menuTeacher" 2. and 3. as admin to sort the sheet it works correctly. but as user it doesn't work ( use only the menu "1.sortSURNAME" to test the permissions ) I protect columnA:B and columnE:M I put Mr Sandy Good as admin like me ( with his mail xxxtrashmatXXX@gmail.com ) to make tests....
score: 0

http://stackoverflow.com/comment/45772217
has text: In CreateParticipant view as called in the controller above.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28744490

http://stackoverflow.com/comment/45904520
type: Comment
comment on: http://stackoverflow.com/a/28665319
has text: What I meant, is that it's not optimal if you're always going to inject the same service into the directive (which may be what most people want). Then I would recommend the top version, as it should offer less confusion. If you're going to use different services depending on context, then the bottom one is for you. So I guess it's wrong to say that it's less optimal in your case :)
type: AnswerComment
score: 0

http://stackoverflow.com/comment/73038777
has text: As WEBP images format is supported only in Chrome and Opera, Whammy won't work in other browsers(( http://caniuse.com/#search=webp
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/31245834

http://stackoverflow.com/a/28605037
score: 0
has body: It's hard to say how do you want to achieve such workflow but one thing that comes to my mind is returning values with ie. error in TempData store and doing proper redirection to next step or if validation fails to the same step. For simple model like this: public class Cart { [Required] public string Item { get; set; } [Required] public string Quantity { get; set; } } Some code example for controller could look like this: public class CartController : Controller { // // GET: /Cart/ public ActionResult Index() { return View(); } [HttpPost] public ActionResult Index(Cart model) { if (ModelState.IsValid) return RedirectToAction("Step1"); TempData["Error"] = "Validation failed"; return View(); } public ActionResult Step1() { // add more logic, steps etc return View(); } } On view side: @using (Html.BeginForm()) { Item: @Html.TextBox("Item") @Html.ValidationMessage("Item", "*") @Html.Editor("Quantity") } @if (TempData["Error"] != null) { Please fix all errors! } I would probably embeed this into view master page ie. only for those steps. Edit: Changed some code added more real-world example :-) Btw. keep in mind using such mechanism you'll get validation from MVC framework for free so you'll get your fields highlighted if needed. You can as well pass this model later on to other steps if needed. Overall here's nice starting guide for validation: http://www.asp.net/mvc/overview/older-versions/getting-started-with-aspnet-mvc4/adding-validation-to-the-model If you would like to go AJAX way then you could use something like this: $.post("@Url.Action("Index")", values, function(data) { // add logic for loading next page or error }); where values object you'll have to construct yourself with proper structure. Good luck!
type: Answer
has comment: http://stackoverflow.com/comment/45516829
has comment: http://stackoverflow.com/comment/45533157
has comment: http://stackoverflow.com/comment/45522793
answers question: http://stackoverflow.com/q/28604610
has comment: http://stackoverflow.com/comment/45515623

http://stackoverflow.com/q/28676181
type: Question
has body: I am creating a website with a team of people which allows the user to draw different types of charts. I am developing the Work Breakdown Tree (WBT) chart at the moment and having trouble with the svg elements. I would like to be able to allow the user to resize the elements on the canvas by dragging the shape from the corner. I have searched around the web for hours looking for a suitable solution but can't seem to find anything. Could anyone be of any help to me please? Thanks
tagged with: javascript
has title: Creating svg elements which can be resized by dragging from the corner
score: 0
upvote count: 1
answer count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/28687326
accepted answer: http://stackoverflow.com/a/28687326
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45651674
has comment: http://stackoverflow.com/comment/45645811

http://stackoverflow.com/q/28742325
tagged with: onclick
has comment: http://stackoverflow.com/comment/45767671
has title: how to prevent unclearing a textbox when selection is made?
tagged with: selection
type: Question
has body: I'm trying to build a texteditor and for that I'm using a textarea to fill in my text My problem is when I click a button the textarea selection is gone. Here is some code to show the problem: Address: California Road Click the button to select the contents of the text area. Try it
linked to: http://stackoverflow.com/q/499126
has answer: http://stackoverflow.com/a/28742703
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45767701
tagged with: textarea
linked to: http://stackoverflow.com/q/5379120
possible better answer: http://stackoverflow.com/a/28742477
has comment: http://stackoverflow.com/comment/45767670
has comment: http://stackoverflow.com/comment/45767785
has answer: http://stackoverflow.com/a/28742477
accepted answer: http://stackoverflow.com/a/28742703
type: AnsweredQuestion

http://stackoverflow.com/comment/45499804
has text: Oops, sorry @user3754676. You should replace `position:absolute;` to your `btncontainer` ;) See http://jsfiddle.net/ghx80Lgs/33/
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28596595
type: Comment

http://stackoverflow.com/comment/54167349
score: 0
has text: Oh apparently you did not fully understand what I meant, I wanted to "prevent" the caret from being, those "|" characters was just explaining
type: AnswerComment
comment on: http://stackoverflow.com/a/33144443
type: Comment

http://stackoverflow.com/q/28691060
type: Question
has title: Get a UID primary key before inserting in database
has answer: http://stackoverflow.com/a/28694517
tagged with: javascript
has comment: http://stackoverflow.com/comment/45677173
score: 0
has answer: http://stackoverflow.com/a/28692827
answer count: 2
tagged with: sql
tagged with: asp.net
has comment: http://stackoverflow.com/comment/45675668
has comment: http://stackoverflow.com/comment/45674885
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28692827
accepted answer: http://stackoverflow.com/a/28694517
has body: I am creating user profiles (javascript webpage) that I store in a SQL database Those profiles have a primary key ID that has auto increment feature. When the user is creating its profile, he has to upload a file. I'd like this file to be named id.ext, the problem is I upload the file through ajax during the creation of the profile, before the profile is saved in database as the user need to profide information about this file in order for the profile to be acceptable. I could retried the max(id) in database and use it during my ajax upload but if 2 people are creating a profile at the same time : problem. I've come up with other solutions : naming the file bigrandom.ext and storing this name in database, but my boss absolutely wants id.ext creating blank profile with an "uncomplete" flag + date at upload and run a batch each month to delete uncomplete entries in database upload with id.ext, if the file already exist, name it id+1.ext and inform the webpage through json message in return of the POST query As I think it's a common problem I guess there is some best practices about this, maybe even a feature from SQL I don't know.

http://stackoverflow.com/comment/45614057
comment on: http://stackoverflow.com/a/28659117
type: Comment
has text: updated to fix error. This is probably 1) easier to read, and 2) more efficient than using map.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28741941
has comment: http://stackoverflow.com/comment/45767285
score: 3
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28742166
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45767334
has title: ie11 Detecting Enter Key pressed
answer count: 4
has comment: http://stackoverflow.com/comment/45766985
upvote count: 3
has answer: http://stackoverflow.com/a/62746590
has body: I have the following piece of code in an asp mvc page $('#regForm').submit(function (event) { if (event.keyCode == '13') { event.preventDefault(); } }); The aim is to prevent the form from submitting when enter is pressed. We have noticed that in ie 11, this is not working, and on stepping into the code via debug, event.keycode is null. I have been doing some researching on this, and it seems to be an issue because we have the IE-8 Compatibility Meta Tag present on the page, which means that event.keyCode (and event.which) returns undefined for the event, and so my form is always submitted. So how do I rewrite this to get round the issue?
has comment: http://stackoverflow.com/comment/45767474
type: Question
has answer: http://stackoverflow.com/a/28742064
has answer: http://stackoverflow.com/a/28742060
tagged with: javascript
has comment: http://stackoverflow.com/comment/45767048

http://stackoverflow.com/q/28645242
has comment: http://stackoverflow.com/comment/45588460
tagged with: jquery-ui
type: Question
has comment: http://stackoverflow.com/comment/45590306
tagged with: javascript
tagged with: jquery
score: 0
answer count: 0
has title: Different handlers for jQuery UI Tooltip
type: UnansweredQuestion
has body: How can I make them work together? One tooltip for images and one for inputs. For now I have to choose between them because they won't work together. // CODE 1 $(document).tooltip({ items: ".photo-id img[data-tooltip]" }, { track: true, content: function(){ return $(this).attr("data-tooltip"); }, }); // CODE 2 $(document).tooltip({ items: "input[type=text]" }, { content: function(){ return $(this).val(); }, }); &lt;input type="text" value="foo" /&gt; &lt;div class="photo-id"&gt; &lt;img data-tooltip="big img src" src="small img src" /&gt; &lt;/div&gt;
has comment: http://stackoverflow.com/comment/45588594

http://stackoverflow.com/a/28630125
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: At initial render this.state.bodypartsis undefined hence the error you got. you should return {bodyparts:[]} from getInitialState. Also in your success callback you should set state like: this.setState(data); because your api already returns bodyparts as part of its result.
has comment: http://stackoverflow.com/comment/75810553
score: 7
answers question: http://stackoverflow.com/q/28630005
has comment: http://stackoverflow.com/comment/45560324
accepted answer of: http://stackoverflow.com/q/28630005
upvote count: 7

http://stackoverflow.com/q/28746802
upvote count: 1
possible better answer: http://stackoverflow.com/a/28746942
has comment: http://stackoverflow.com/comment/45781489
favorite count: 0
has comment: http://stackoverflow.com/comment/48773141
tagged with: visual-studio-2013
has answer: http://stackoverflow.com/a/28746942
has comment: http://stackoverflow.com/comment/45780501
has comment: http://stackoverflow.com/comment/45780352
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45780529
has title: javascript not recognized by visual studio 2013
linked to: http://stackoverflow.com/q/11488208
downvote count: 0
has body: Yesterday I was working in Visual Studio 2013 on some google map feature using javascript. Today when I started up Visual studio 2013, all my javascript code was in plain black and visual studio wouldn't recognize variables and intellisense didn't work. It's like I'm writing javascript in notepad.. Is this a setting that got changed or just visual studio being silly? EDIT: Let me elaborate. I started visual studio this morning and saw that visual studio wasn't interpreting? my javascript code. I had no intellisense support and it wouldn't even pick up a basic javascript keyword such as var. I was basically coding blind in sense similar to writing code in notepad(basic text editor). Where is when it worked before, it would highlight all the javascript key words, code-completion, intellisense etc all worked. Working: Not working:
score: 1
has comment: http://stackoverflow.com/comment/45780745
has answer: http://stackoverflow.com/a/28748041
accepted answer: http://stackoverflow.com/a/28748041
type: Question
has comment: http://stackoverflow.com/comment/45780646
answer count: 2
has comment: http://stackoverflow.com/comment/45780616
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45780615

http://stackoverflow.com/q/28636380
type: Question
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
answer count: 1
favorite count: 0
tagged with: ratchet-bootstrap
has title: Use cached pages with Ratchet (Push.js)
type: UnansweredQuestion
has body: I'm developing an hybrid app and I'm using Ratchet for that. On the first page (index.html) the app retrieves content dynamically and adds that content via jQuery to the DOM. When I navigate to another tab (sub-page), and navigate back to the main page (index.html), everything is gone. How can I navigate (or use) the cached page of the main page?
has answer: http://stackoverflow.com/a/31076785
score: 1
tagged with: push.js
upvote count: 1

go
tags question: http://stackoverflow.com/q/28708919
tag name: go
tags question: http://stackoverflow.com/q/28663273
type: Tag

http://stackoverflow.com/a/29882835
has comment: http://stackoverflow.com/comment/131916281
downvote count: 0
answers question: http://stackoverflow.com/q/28727587
type: Answer
has comment: http://stackoverflow.com/comment/131916284
score: 5
upvote count: 5
has body: A few months late, but in case others stumble upon this and want an answer: This behaviour is described in the Web Audio API spec: The createMediaElementSource method Creates a MediaElementAudioSourceNode given an HTMLMediaElement. As a consequence of calling this method, audio playback from the HTMLMediaElement will be re-routed into the processing graph of the AudioContext. Emphasis mine. Since the output from the audio element is now routed into the newly created MediaElementAudioSourceNode instance (instead of the original destination, usually your speakers), you need to route the output of the instance back to the original destination: var audio = document.getElementById('myAudio'); var ctx = new AudioContext(); var src = ctx.createMediaElementSource(audio); src.connect(ctx.destination); // connect the output of the source to your speakers audio.play(); The reason it worked when you added [0] is that document.getElementById doesn't return an array, or an element with a defined key of "0". As such, you might as well have written ctx.createMediaElementSource(undefined), which doesn't re-route the audio from the #myAudio element.

http://stackoverflow.com/comment/45750348
comment on: http://stackoverflow.com/a/28731509
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/71726/discussion-between-lshas-and-developerwjk).
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45824199
type: Comment
comment on: http://stackoverflow.com/a/28731064
score: 0
type: AnswerComment
has text: Sorry I can't get into the chat. It says, `CHAT` undefined. Problably some js error. However, you are already my hero. I got the value show now. In the vb I posted, I stored the value of hourDiff into hf1, just below, hourDiff=endhour-starthour. If you have any solution to the other issue I raised, please share with me. If you don't I will close this. I am very grateful. The issue is that I am getting undefined when using the ValidateDuration sub customValidator.

http://stackoverflow.com/comment/45599968
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28651091
has text: Thank you a lot. It is really smth that I need. But on my site the background doesn't fit my image div. It appears at the top of the page.
type: Comment

http://stackoverflow.com/q/28624758
accepted answer: http://stackoverflow.com/a/28635735
tagged with: css
has title: Scrolling window with fixed and overlapping background
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28626867
has comment: http://stackoverflow.com/comment/45571382
downvote count: 1
has answer: http://stackoverflow.com/a/28626867
type: Question
upvote count: 0
has comment: http://stackoverflow.com/comment/45552395
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45554904
has answer: http://stackoverflow.com/a/28635735
answer count: 2
has body: I am trying to reproduce the background image fixed with window scrolling from this website https://ringly.com/. Can anybody suggest/guide me how can I do this... Thanks..
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/45553534

http://stackoverflow.com/q/28657642
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28657772
tagged with: javascript
type: AnsweredQuestion
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28657772
type: Question
has title: Jquery slider fix
has body: I made a slider (http://jsfiddle.net/k8f6wp17/) and the problem is in the right button.When you click it , it plays only the #slide2 and #slide3. And one more thing, if you have any suggestions about how I can make it reset. I mean after #slide3 it should play back #slide1. And the JS code: $('.move-slide').click(function() { var hiding_image = { "direction" : "right", "mode" : "hide"}; var showing_image = { "direction" : "left", "mode" : "show"}; var direction = "right"; // $(this) == current element you clicked if($(this).hasClass('glyphicon-chevron-left')) { direction = 'left'; hiding_image = { "direction" : "left", "mode" : "hide"}; showing_image = { "direction" : "right", "mode" : "show"}; } var current_element = $(".slide.active"); if(direction == 'right' &amp;&amp; current_element.next(".slide").length &gt; 0) { current_element.next(".slide") .effect( "slide", showing_image, 1000) .addClass('active') .removeClass('inactive'); current_element.effect( "slide", hiding_image, 1000) .removeClass('active'); } else if(current_element.prev(".slide").length &gt; 0) { current_element.prev(".slide") .effect( "slide", showing_image, 1000) .addClass('active') .removeClass('inactive'); current_element.effect( "slide", hiding_image, 1000) .removeClass('active'); } }); Thank you!

http://stackoverflow.com/comment/45537018
has text: @Bergi I thought the same thing too, but I couldn't find an answer. I plan on looking into it further, but for now this was the only thing getting me past that error.
score: 1
comment on: http://stackoverflow.com/q/28616584
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28618537
tagged with: java
has body: My boss came to me today and requested that I develop a snippet of code that we can share with some of our clients, which will display latest posts from an RSS feed. The idea is they will be able to paste the snippet on their site, and it will display the latest postings from out site. Is this a common practice, and if so, how is it done? Through JavaScript?
score: 0
answer count: 1
tagged with: javascript
has title: Broadcasting RSS feed to another site through javascript
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
tagged with: rss
has answer: http://stackoverflow.com/a/28620437
accepted answer: http://stackoverflow.com/a/28620437
type: Question

http://stackoverflow.com/q/28617331
has answer: http://stackoverflow.com/a/28617404
answer count: 4
has answer: http://stackoverflow.com/a/28617394
favorite count: 0
has comment: http://stackoverflow.com/comment/45537808
has comment: http://stackoverflow.com/comment/45537783
upvote count: 1
has body: I have coded this small script which increments a given value, in this case 200, by 1 every 3.2 seconds. var i = 200; function increment() { i++; document.getElementById('generated').innerHTML = Number(i).toLocaleString('en'); } setInterval('increment()', 3200); I'm trying to make the script stop increasing the value once it reaches a certain point (let's say 300 for example). I'm sure it's a simple fix but I can't think up of how to go about this.
has comment: http://stackoverflow.com/comment/45537743
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28617404
score: 1
has answer: http://stackoverflow.com/a/69526981
has answer: http://stackoverflow.com/a/28617572
type: Question
has title: Stop javascript increment at a certain value
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28617394
has comment: http://stackoverflow.com/comment/45537835

http://stackoverflow.com/comment/45642513
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28606715
has text: did u try this url: "http://10.138.77.27:222/focisqmobile/Service1.svc/getProduct insteaf of url: "http://10.138.77.27:222/focisqmobile/Service1.svc?wsdl
score: 0

html-framework-7
tag name: html-framework-7
tags question: http://stackoverflow.com/q/28702184
type: Tag

http://stackoverflow.com/comment/45561155
type: QuestionComment
has text: You can not submit the form???
comment on: http://stackoverflow.com/q/28630449
type: Comment
score: 0

http://stackoverflow.com/comment/45581370
score: 0
has text: Functions declared inside other functions are **private** and not visible outside. That's the answer to your question.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28640879

http://stackoverflow.com/a/28600429
has comment: http://stackoverflow.com/comment/45506872
has body: Your jQuery code has syntax error in success callback, that's why its not making any post request to Laravel, please try below javascript it will work a b c In Laravel , you can just return array or object and it will automatically convert it to json response return ['success' => true, 'data' => $data];
downvote count: 0
answers question: http://stackoverflow.com/q/28599638
type: Answer
upvote count: 3
score: 3

http://stackoverflow.com/q/28608659
score: 0
has comment: http://stackoverflow.com/comment/45521370
answer count: 1
has body: I been looking at the RegisterClientScriptBlock object which runs some JavaScript code and I have been trying to use it. I currently have ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", " ", false); I would expect the alert to pop up when the code is hit but it never does, is the parameters correct or am I going down the wrong road? Thanks Chris
has comment: http://stackoverflow.com/comment/45521253
accepted answer: http://stackoverflow.com/a/28608886
tagged with: registerclientscriptblock
type: AnsweredQuestion
tagged with: c#
has title: RegisterClientScriptBlock - not firing
tagged with: javascript
has answer: http://stackoverflow.com/a/28608886
type: Question

http://stackoverflow.com/comment/46145371
has text: Blex already answer that in the comments, and I've modified his solution to be even better. you solution is much worse..so I don't see any reason to post it if it's not improving the quality of the answers already exists in this thread
type: Comment
comment on: http://stackoverflow.com/a/28941420
score: 0
type: AnswerComment

http://stackoverflow.com/q/28653651
has body: I have html button Save and controller for this view myApp.controller('myController', ['$scope', function ($scope) { var changes = { available : false } $scope.postChanges = function () { console.log('changes before: ' + changes.available); if (changes.available) { changes.available = false; } else { changes.available = true; } console.log('changes after: ' + changes.available); } }]); I want to make button visible if changes.available are true and hide it when it is false but it doesn't work. I also tried with just boolean value changes = true / changes = false, data-ng-show instead of ng-show '!' before value (ng-show="!changes.available" or ng-show="!changes") but none of this solutions worked. I'm logging changes value in console and it seems it is ok so I suppose it is a problem with button attribute but I have no clue why :(
tagged with: angularjs
has answer: http://stackoverflow.com/a/28653662
type: AnsweredQuestion
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/28653662
has answer: http://stackoverflow.com/a/28653660
accepted answer: http://stackoverflow.com/a/28653660
tagged with: javascript
score: 0
has title: angularjs show doesn't work
upvote count: 1
downvote count: 1
favorite count: 0

http://stackoverflow.com/comment/45680305
type: QuestionComment
has text: How do you know the loaded page isn't triggering the click?
comment on: http://stackoverflow.com/q/28693771
score: 0
type: Comment

http://stackoverflow.com/q/28632321
answer count: 0
has comment: http://stackoverflow.com/comment/45564762
type: UnansweredQuestion
score: 0
has body: When the page starts the users is asked to selected a category. Once a category is selected with Ajax some checkboxes are loaded. I need to do something when these checkboxes are ticked however the problem is i cannot detect change on them since i just added them. *** options variable contains the input checkbox $("#subcat").append(options) I then try to check weither the it is checked or not with the code below &lt;script&gt; $(":checkbox").change(function(){ if($(this).attr("checked")) { alert("abc"); } else { alert("CBA"); } }); &lt;/script&gt; If i add a input check box directly onto the html file then it detects change however when i load checkboxes with ajax it does not.
tagged with: checkbox
has comment: http://stackoverflow.com/comment/45564747
type: Question
linked to: http://stackoverflow.com/q/203198
has comment: http://stackoverflow.com/comment/45564818
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/45564905
duplicate of: http://stackoverflow.com/q/203198
has comment: http://stackoverflow.com/comment/45564714
tagged with: http://stackoverflow.com/tag/html
has title: Checking if checkboxs is ticked after adding it with jquery
linked to: http://stackoverflow.com/q/8343991

http://stackoverflow.com/comment/45731104
score: 0
type: AnswerComment
type: Comment
has text: @CasimiretHippolyte What do you eman exactly? In the lookahead?
comment on: http://stackoverflow.com/a/28721726

http://stackoverflow.com/a/28646160
answers question: http://stackoverflow.com/q/28646143
score: 1
has comment: http://stackoverflow.com/comment/45590457
has body: There where some issues. JavaScript is zero-index based. You ran a loop with i <= r.length, this means that your loop will go outside the node list's boundary. It iterates three times, where it should iterate only two times. The if statement is in the for loop, it should be outside, since it should only be executed once. function validate() { var r = document.getElementsByName("sex") var sex= -1; for(var i=0; i < r.length; i++) { if(r[i].checked) { sex = i; break; } } if (sex < 0) { alert("please select gender"); return false; } } document.querySelector("button").addEventListener("click", validate, false); Female Male Validate
has comment: http://stackoverflow.com/comment/45590280
downvote count: 0
has comment: http://stackoverflow.com/comment/45590145
type: Answer
has comment: http://stackoverflow.com/comment/45590341
upvote count: 1

http://stackoverflow.com/q/28734841
has title: unexplained undefined string displayed on my website. not sure how to get rid of it
tagged with: mustache
has comment: http://stackoverflow.com/comment/45754896
has answer: http://stackoverflow.com/a/28735273
accepted answer: http://stackoverflow.com/a/28735273
possible better answer: http://stackoverflow.com/a/28735112
has comment: http://stackoverflow.com/comment/45754916
type: AnsweredQuestion
has body: I have a undefined string being displayed on my page and i have no idea why it is their besides the function that is probably causing it, i only know this from displaying allot of console errors to locate the problem. I believe that Mustache is doing this somehow when i call on templates. " undefined " The question is how do i get rid of this undefined string being injected in my page. Any help would be much appreciated. Code:Function that is being called that is somehow or reason displaying a undefined string in my div getProjects: function(){ portfolio.topOfPage(); var request1 = $.ajax({ url: "js/projects.js", dataType:'json', cache: true, }).then(function(response){ var data = response.projects; var template = $('#projects_tmp').html(); var projects; $.each(data, function(key,val){ console.log("Key: "+key+", Value: "+val); projects += Mustache.to_html(template, val); }); return projects; }); My mustache template:
has answer: http://stackoverflow.com/a/28735112
has comment: http://stackoverflow.com/comment/45754762
type: Question
answer count: 2
tagged with: javascript
score: 0

http://stackoverflow.com/q/28630233
has body: I'm looking for a very simple chart library that can do that sort of graph : https://i.sstatic.net/fy3hY.png If possible, in JS. I've tried Angular-Charts but it doesn't really seems to be good for this project... Thanks
score: -1
type: Question
has title: Simple library for charting JS
upvote count: 0
accepted answer: http://stackoverflow.com/a/28630273
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28630273
downvote count: 1
type: AnsweredQuestion
tagged with: charts

http://stackoverflow.com/comment/46069230
type: QuestionComment
has text: Regarding the bounty. I have updated the JSfiddle. You can see that on the first 'section' the animated text slide in second and as you slide into it, it all works. But on the second 'section' if you scroll down the animated text slide is first and thus doesn't trigger. I know I need to use the onLeave and afterLoad functions but getting stuck. Thanks.
comment on: http://stackoverflow.com/q/28664645
score: 0
type: Comment

http://stackoverflow.com/comment/45625544
score: 0
type: Comment
has text: Then you need session_destroy(); then activate other session to start again
type: AnswerComment
comment on: http://stackoverflow.com/a/28665283

http://stackoverflow.com/comment/45732442
score: 4
type: Comment
type: QuestionComment
has text: Nop, `{ id, name, email }` is a set-literal in Python.
comment on: http://stackoverflow.com/q/28722869

http://stackoverflow.com/a/28694676
has body: You should need to call serialize() on the form, not serializeArray() on the list of inputs. Try this: $.post( $("#loginForm").attr("action"), $("#loginForm").serialize(), function(data){ $("div#msg").html(data); } ); The difference between the functions is the format the output. serializeArray() returns an object, which may not be in the correct format for your receiving endpoint, and serialize() turns the values of the form in to a querystring.
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28694443
answers question: http://stackoverflow.com/q/28694443

http://stackoverflow.com/q/28677871
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28703798
type: Question
has answer: http://stackoverflow.com/a/28703798
tagged with: javascript
score: 0
has body: I would like a tool in the sidebar's "Tools" section that takes readers to Special:PrefixIndex/FULLPAGENAME where FULLPAGENAME is replaced with the current page's full name. For example, say I was on the page Module:Citation/CS1 then I would like a tool in the sidebar called Subpages that takes me to Special:PrefixIndex/Module:Citation/CS1. I have seen (the mediawiki sidebar manual) and I added: function CustomizeModificationsOfSidebar() { // Adds PrefixIndex var page = mw.config.get( 'wgPageName' ); ModifySidebar( 'add', 'toolbox', 'Subpages', "http://127.0.0.1/mediawiki/index.php/Special:PrefixIndex/"'page' ); } jQuery( CustomizeModificationsOfSidebar ); to the page MediaWiki:Common.js. This gave the JavaScript error: Error: Expected ')' and instead saw 'page'. that prevented me from saving the page.
answer count: 1
has title: How do I add Special:PrefixIndex/FULLPAGENAME to the toolbox in my local MediaWIki installation?
tagged with: mediawiki

http://stackoverflow.com/comment/45613944
score: 0
type: Comment
has text: Well. Set a few break points and inspect variable values as you step through your code. I can't do that for you because with all those missing functions and variables your code does not run on any computer but your own. For next time: http://stackoverflow.com/help/mcve
comment on: http://stackoverflow.com/a/28658655
type: AnswerComment

http://stackoverflow.com/comment/45591746
comment on: http://stackoverflow.com/q/28646946
has text: @charlietfl then never mind the second part.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45750907
type: AnswerComment
score: 0
type: Comment
has text: I would like to avoid polling, as my question states.
comment on: http://stackoverflow.com/a/28731697

http://stackoverflow.com/q/28603765
has answer: http://stackoverflow.com/a/28603868
has answer: http://stackoverflow.com/a/28603879
answer count: 5
possible better answer: http://stackoverflow.com/a/28603986
has title: How print values in arrays in array, inside multiple objects
has answer: http://stackoverflow.com/a/28603893
has answer: http://stackoverflow.com/a/28603986
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/73492898
type: Question
accepted answer: http://stackoverflow.com/a/28603893
tagged with: javascript
has body: var data = [ { infoType: [ [1], [2], [3], ] }, { infoType: [ [4], [5], [6], ] }, { infoType: [ [7], [7], [8], ] }, { infoType: [ [9], [10], [11], ] } ] Guys, i have this data with several objects inside, and inside this objects i have a field 'infoType', and i'm trying to print all the values, but i am not getting. How can i do that? I was trying like this: for(var i = 0; i &lt; data.length; i++) { data[i].infoType.forEach(function(item) { console.log(item); }) } for(var i = 0; i &lt; data.length; i++) { for(var j = 0; i &lt; data[i].infoType.length; i++) { console.log(data[i].infoType[j]); } } I can'T use jquery for this.
score: 0

http://stackoverflow.com/q/28736840
type: AnsweredQuestion
has body: I want to implement custom event with this functionality: create custom event after callback of ajax dispatch event any object in document (div, grid, ...) can register listener of this custom event when event is fired, all objects which have registered listener event call any methods I tried created custom event (no problem): var eventFilterRefresh = document.createEvent("CustomEvent"); eventFilterRefresh.initEvent("onFilterCancel", true, true); Register event: var dv = document.getElementById('myDiv'); dv.addEventListener('onFilterCancel', function (e) { alert(); }, false); Dispatch event - here is problem. I don't wont call dispatchEvent on conrete object. I want call generaly dispatchEvent and all objects which have registered event makes methods: var myDiv= document.getElementById('myDiv'); myDiv.dispatchEvent(eventFilterCancel); Thanks.
type: Question
upvote count: 2
has title: How to implement event listener for any objects in JavaScript
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: events
has answer: http://stackoverflow.com/a/28737040
accepted answer: http://stackoverflow.com/a/28737040
downvote count: 0
has comment: http://stackoverflow.com/comment/45758243
score: 2

http://stackoverflow.com/comment/46145290
has text: Answer does not actually provide an 'on_click' declaration.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28672919

http://stackoverflow.com/comment/45531022
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28613542
type: Comment
has text: If you pass the string appended, note the original "url_api" also has "=" there, so the parameter passes malformed...

http://stackoverflow.com/comment/48979191
type: Comment
comment on: http://stackoverflow.com/a/29362569
score: 0
has text: This worked for me on Windows 8.1 with Visual Studio Community Edition 2013 using `npm install --msvs_version=2012`
type: AnswerComment

http://stackoverflow.com/a/28733803
has comment: http://stackoverflow.com/comment/45753066
has comment: http://stackoverflow.com/comment/45753146
type: AcceptedAnswer
score: 4
answers question: http://stackoverflow.com/q/28733773
type: Answer
has body: In your code snippet, $(this) referred to the window object. You could iterate over the .details-group elements using the .each() method. In doing so, $(this) will refer to the current .details-group element. Also, the element .details-display doesn't have any children elements. If you want to check to see if it has any text, you could use the .text() method. Example Here $('.details-group').each(function () { if ($(this).find('.details-display').text().trim().length) { $(this).remove(); } });
upvote count: 4
accepted answer of: http://stackoverflow.com/q/28733773
downvote count: 0

http://stackoverflow.com/q/28727942
has comment: http://stackoverflow.com/comment/45742396
has answer: http://stackoverflow.com/a/28863362
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45742278
has comment: http://stackoverflow.com/comment/45742510
has title: Don't scroll webpage when reached bottom of iFrame
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: 4
has comment: http://stackoverflow.com/comment/45743091
favorite count: 0
has comment: http://stackoverflow.com/comment/45742235
possible better answer: http://stackoverflow.com/a/28728376
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
accepted answer: http://stackoverflow.com/a/28863362
has answer: http://stackoverflow.com/a/28728376
tagged with: css
linked to: http://stackoverflow.com/q/4770025
upvote count: 5
tagged with: iframe
has body: When I reached the bottom of an iFrame / div with scrollbar, and keep scrolling down, the whole page will scroll down. I made a quick JSFiddle to demonstrate the problem: http://jsfiddle.net/fbgxf771/1/ Keep scrolling down on either the div or the iframe, when you reached the bottom, the whole page will scroll down. How can I disable that?

http://stackoverflow.com/a/28621141
type: Answer
accepted answer of: http://stackoverflow.com/q/28621123
answers question: http://stackoverflow.com/q/28621123
has body: First you need to sent the parameter to the resource load_xml.php. function get_value() { if ($("#dropdwn").val() == "0") { //load nothing } else { var val = $("#dropdown").val(); $('#txtval').val(val); $('#load_page').html('&lt;p align="center"&gt;&lt;br/&gt;&lt;img src="images/popuploader.gif" /&gt;&lt;br/&gt;&lt;br/&gt;&lt;/p&gt;'); $('#load_page').load('load_xml.php?txtval=' + val); } } The the load method uses a GET request, not a POST method. $txtval=$_GET['txtval'] If you want to sent a POST method, then use the syntax function get_value() { if ($("#dropdwn").val() == "0") { //load nothing } else { var val = $("#dropdown").val(); $('#txtval').val(val); $('#load_page').html('&lt;p align="center"&gt;&lt;br/&gt;&lt;img src="images/popuploader.gif" /&gt;&lt;br/&gt;&lt;br/&gt;&lt;/p&gt;'); $('#load_page').load('load_xml.php?', { txtval: val }); } } then $txtval=$_POST['txtval']
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/45588622
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28645360
has text: you're fiddle is working fine , so what is the problem?

http://stackoverflow.com/comment/45610110
score: 0
has text: @CarterăVeaceslav this code tells that, you can inject your `calender` directive by using the lines inside the directive link fucntion..
type: AnswerComment
comment on: http://stackoverflow.com/a/28656831
type: Comment

http://stackoverflow.com/a/28619670
has comment: http://stackoverflow.com/comment/45542019
has body: Try this: In index.html.erb, move the search_form_for's &lt;% end %&gt;so it is after the &lt;/table&gt; tag.
type: Answer
accepted answer of: http://stackoverflow.com/q/28617332
answers question: http://stackoverflow.com/q/28617332
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28633654
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: json string is not converting into object
has comment: http://stackoverflow.com/comment/45567500
favorite count: 0
has comment: http://stackoverflow.com/comment/45567632
accepted answer: http://stackoverflow.com/a/28633708
score: 1
upvote count: 1
tagged with: php
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45567364
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45567295
has answer: http://stackoverflow.com/a/28633708
has body: Here is the server side code I am trying to send json $x = array(); $timestamp = strtotime('22-09-2008'); $x["x"] = $timestamp; $x["y"] = 22; $val = '[{ "name": "weight", "dataPoints": ['.json_encode($x).'] }]'; echo json_encode($val); So output for above code looks like "[{ \"name\": \"weight\", \"dataPoints\": [{\"x\":1222041600,\"y\":22}] }]" Below is the client side code I get the data via Jquery getJSON var jqxhr = $.getJSON( "https://domain/gettracker.php?id="+id, function(data) { console.log(data); }) I suppose getJson converts json to object automatically , but it logs the raw json like below "[ { name: "weight", dataPoints: [{"x":1222041600,"y":22}] } ]" I tried to do json parse , but i get error. I guess I am not sending the data properly via php.Can some one guide me ?

http://stackoverflow.com/a/28656657
downvote count: 0
answers question: http://stackoverflow.com/q/28656621
upvote count: 2
type: Answer
score: 2
has body: Try console.log($('#post').text()); Updated fiddle. Textarea content shown in console: http://jsfiddle.net/64x1wrfx/2/

http://stackoverflow.com/comment/45701379
type: Comment
type: QuestionComment
has text: @Shekhar, he's posting with JS, not with the form
comment on: http://stackoverflow.com/q/28705851
score: 0

http://stackoverflow.com/comment/45728789
type: Comment
has text: But how does imageObj look like? Is it an an Object with just property .nativeUrl. Console.log(data) results in []
comment on: http://stackoverflow.com/a/28720318
score: 0
type: AnswerComment

http://stackoverflow.com/q/28707265
accepted answer: http://stackoverflow.com/a/28707759
answer count: 1
has body: I'm trying to display a php page using javascript with express functions. An example code: var express = require('express') var app = express() app.get('/', function (req, res) { res.send('Hello World!') }) var server = app.listen(3000, function () { var host = server.address().address var port = server.address().port console.log('Example app listening at http://%s:%s', host, port) }) I have a php page with html and javascript functions that displays different data from database and I'm not sure how to call the page from the javascript file. I tried putting it in script tags on the php page but how do I then execute the output of the php page in the res.send();
has title: How to call a PHP page from a javascript page using express functions
tagged with: http://stackoverflow.com/tag/html
tagged with: php
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28707759
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/9930434
tagged with: express
score: 0

http://stackoverflow.com/q/28648907
possible better answer: http://stackoverflow.com/a/49183760
has title: export "saved for later" from (evil) feedly
answer count: 4
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45595683
tagged with: feedly
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: i'm trying to migrate from feedly as it is unacceptable (at least to me) that a search query is (fully) enabled only by a pro version. Anyhow, to export my lengthy list of "saved for later" i found some lovely scripts: Simple script that exports a users "Saved For Later" list out of Feedly as a JSON string and feedly-to-pocket. where i am instructed to: You must switch off SSL (http rather than https) or jQuery won't load! so i though i did by adding (ubuntu 14.04/chrome 40 x64) --ssl-version-min=tls1 to my /usr/share/applications/google-chrome.desktop file (all lines starting with Exec=). However when i try to run it in the browser console i get This request has been blocked; the content must be served over HTTPS. So, any suggestions? (also, excuse me for noobness)
has answer: http://stackoverflow.com/a/28664555
type: Question
has comment: http://stackoverflow.com/comment/45595567
linked to: http://stackoverflow.com/q/3622598
downvote count: 3
has answer: http://stackoverflow.com/a/30607972
tagged with: https
accepted answer: http://stackoverflow.com/a/28664555
has answer: http://stackoverflow.com/a/49183760
has answer: http://stackoverflow.com/a/42466327
upvote count: 5
tagged with: ssl

http://stackoverflow.com/q/28748483
type: Question
has answer: http://stackoverflow.com/a/28748779
has comment: http://stackoverflow.com/comment/45779281
tagged with: javascript
answer count: 3
has comment: http://stackoverflow.com/comment/45779452
upvote count: 1
has answer: http://stackoverflow.com/a/28748719
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/28748779
linked to: http://stackoverflow.com/q/23803743
has comment: http://stackoverflow.com/comment/45779325
tagged with: angularjs-http
tagged with: angular-promise
has comment: http://stackoverflow.com/comment/45779347
has comment: http://stackoverflow.com/comment/45779510
type: AnsweredQuestion
has body: I frequently see tutorials and snippets online about Angular services to make $http calls that return both the $http promise and some data. If the promise is returned to the controller, what is the point of returning the data in the service? I don't even understand to where it is returned. Here's an example of what I mean: // Function of MyStuffService: function getStuff() { return $http.get('/api/stuff') .success(function(data) { // Why return data here? How could I even get this returned value? return data; }) .error(function(data) { console.error(data); }); } // Controller: function getStuff() { MyStuffService.getStuff() .success(function(data) { $scope.stuff = data; }) } Can't I just rewrite my service function as: // Function of MyStuffService: function getStuff() { return $http.get('/api/stuff') .error(function(data) { console.error(data); }); } And let the controller get the data from the returned promise? I feel like I'm not understanding something here. Any help is greatly appreciated.
downvote count: 0
has comment: http://stackoverflow.com/comment/45779101
score: 1
linked to: http://stackoverflow.com/q/17646034
has title: Why return the promise and the data when using $http in an Angular service?
has answer: http://stackoverflow.com/a/28748690
accepted answer: http://stackoverflow.com/a/28748690

http://stackoverflow.com/a/28743837
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28735016
score: 7
has comment: http://stackoverflow.com/comment/45770539
upvote count: 7
accepted answer of: http://stackoverflow.com/q/28735016
type: AcceptedAnswer
has body: This is not a ZF problem, as CSS/JS requests shouldn't even touch PHP. Because you are using relative paths in your layout, the browser is loading the CSS and JS files relative to the current URL. E.g. when you're on /my-dashboard/ideas page, it's trying to load /my-dashboard/skin/default_skin/css/theme.css (which is not the correct URL). To fix this, always use absolute paths in your layout, such as: &lt;link rel="stylesheet" type="text/css" href="/skin/default_skin/css/theme.css"&gt; (note the initial slash at the start of the href path). This ensures your assets will always load from the document root.

http://stackoverflow.com/a/28690150
score: 2
has body: You can use :nth-child(): sum=0; $('.somting td:nth-child(3)').each(function(){ sum += parseInt($(this).text()); }) //log sum Working Demo
accepted answer of: http://stackoverflow.com/q/28690032
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45672334
answers question: http://stackoverflow.com/q/28690032
has comment: http://stackoverflow.com/comment/45672129
upvote count: 2
type: Answer

http://stackoverflow.com/a/29789330
accepted answer of: http://stackoverflow.com/q/28599638
upvote count: 20
answers question: http://stackoverflow.com/q/28599638
type: Answer
has body: Laravel 5 uses csrf token validation for security reasons....try this... In routes.php route post('form-data', 'FormController@postform'); In master layout file &lt;meta name="csrf-token" content="{{ csrf_token() }}" /&gt; var CSRF_TOKEN = $('meta[name="csrf-token"]').attr('content'); $.ajax({ url: '/form-data/', type: 'POST', data: {_token: CSRF_TOKEN}, dataType: 'JSON', success: function (data) { console.log(data); } });
score: 20
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28695155
has body: Encoding The first step is to extract the exponent and normalized fraction of the number. In C, this is done using the frexp function which isn't available in JavaScript. Googling for frexp javascript yields a couple of implementations. For example, here's a straight-forward implementation that extracts the bits directly from the IEEE representation using typed arrays. Here's a quick-and-dirty, inexact version using only Math functions. Here's an exact (?) version. The second step is to create your 16-bit FP number from the obtained exponent and mantissa using bit operations. Make sure to check the exponent range and to round the lower-precision mantissa for better accuracy. Decoding Extract exponent and mantissa from your 16-bit FP number. Convert them to a JavaScript number either with // The value of 'adjust' depends on the size of the mantissa. Math.pow(2, exponent - adjust) * mantissa or by directly creating an IEEE bit pattern with typed arrays. Subnormal numbers, infinity, NaN Subnormal JavaScript numbers can be simply rounded to zero. You'll have to decide whether you want to support subnormal numbers in your 16-bit format. This will complicate the conversion process in exchange for better accuracy of numbers near zero. You'll also have to decide whether to support infinity and NaN in your format. These values could be handled similarly to the IEEE format.
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/58752805
accepted answer of: http://stackoverflow.com/q/28688838
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28688838
has comment: http://stackoverflow.com/comment/45687483
type: Answer
score: 2

http://stackoverflow.com/q/28692947
score: 2
has comment: http://stackoverflow.com/comment/45677110
accepted answer: http://stackoverflow.com/a/28693335
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/28694593
has answer: http://stackoverflow.com/a/28694593
has body: Can anyone help me pinpoint the issue with my script please? $(function () { var top = $('#sidebar').offset().top - parseFloat($('#sidebar').css('marginTop').replace(/auto/, 0)); var footTop = $('#footer').offset().top - parseFloat($('#footer').css('marginTop').replace(/auto/, 0)); var maxY = footTop - $('#sidebar').outerHeight(); $(window).scroll(function (evt) { var y = $(this).scrollTop(); if (y &gt; 100) { if (y &lt; maxY) { $('#sidebar').addClass('stickyside').removeAttr('style'); } else { $('#sidebar').removeClass('stickyside').css({ position: 'absolute', top: (maxY - top) + 'px' }); } } else { $('#sidebar').removeClass('stickyside'); } }); }); Live site here - https://tregothnan.co.uk/tea-herbal-infusions/ Sticky sidenav is spilling over the footer div and no matter what I try I can't get it to work. It works fine in my jsfiddle prototype.
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/45677241
upvote count: 2
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28693335
answer count: 2
has title: Jquery sticky menu not being caught by footer

http://stackoverflow.com/comment/45527577
has text: There is some info here you might find useful https://github.com/spoike/refluxjs/issues/194 && http://spoike.ghost.io/refluxjs-0-1-8/ Some talk about using preEmit `ProductActions.load.preEmit = function () { // Perform the API call };`
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28610207

http://stackoverflow.com/comment/45691799
has text: Looks nice but I don't understand how JQ makes the Relationship between "data-xx" and $(this).data(lang) ???Is it a standard JQ function that links data-xx to data(lang)?
comment on: http://stackoverflow.com/a/28700476
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28623797
has body: I have a javascript program that utilizes a canvas to display some rectangles on the screen. When I run this on my ChromeBook (saving the file to Google Drive and downloading it) I get a space between some of the squares: However, when I run this on fiddle: Here is the javascript section: var canvas = document.getElementById("canvas"), ctx = canvas.getContext("2d"); canvas.width = window.innerWidth; canvas.height = window.innerHeight-50; var charh = charw = 80; function drawRect(x, y, height, width, color){ ctx.fillStyle = color; ctx.beginPath(); ctx.fillRect(x, y, width, height); ctx.fill(); } function Archer(x, y){ this.x = x; this.y = y; this.draw = function (){ updatePlayer(this.x+10, this.y, '#3B1000'); updatePlayer(this.x+15, this.y, '#3B1000'); updatePlayer(this.x+20, this.y, '#3B1000'); updatePlayer(this.x+5, this.y+5, '#A56122'); updatePlayer(this.x+10, this.y+5, '#A56122'); updatePlayer(this.x+15, this.y+5, '#A56122'); updatePlayer(this.x+20, this.y+5, '#A56122'); updatePlayer(this.x+25, this.y+5, '#A56122'); updatePlayer(this.x+5, this.y+10, '#A56122'); updatePlayer(this.x+15, this.y+10, '#A56122'); updatePlayer(this.x+25, this.y+10, '#A56122'); updatePlayer(this.x+5, this.y+15, '#A56122'); updatePlayer(this.x+10, this.y+15, '#A56122'); updatePlayer(this.x+15, this.y+15, '#A56122'); updatePlayer(this.x+20, this.y+15, '#A56122'); updatePlayer(this.x+25, this.y+15, '#A56122'); updatePlayer(this.x+15, this.y+20, '#A56122'); updatePlayer(this.x+10, this.y+10, '#FFFFFF'); updatePlayer(this.x+20, this.y+10, '#FFFFFF'); } } var myarcher = new Archer(canvas.width/2-charw/2, canvas.height/2-charh/2); function update() { ctx.clearRect(0, 0, canvas.width, canvas.height); myarcher.draw(); setTimeout(update, 10); } function updatePlayer(x, y, color){ ctx.fillStyle = color; ctx.beginPath(); ctx.fillRect(x, y, 5, 5); ctx.fill(); } update();
type: Question
accepted answer: http://stackoverflow.com/a/28623998
tagged with: javascript
score: 0
tagged with: canvas
answer count: 1
has title: Canvas displaying weird
favorite count: 0
upvote count: 2
has answer: http://stackoverflow.com/a/28623998
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
downvote count: 2

http://stackoverflow.com/q/28660868
answer count: 2
downvote count: 0
has title: Javascript animation does not behave in intended way
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28661307
score: 2
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28662235
has body: I want create a simple animation where length of a rectangle changes smoothly to half its value when 'mouseover' event occurs and doubles up again when 'mouseout' event occurs. the following code works if mouse is moved slowly but doesn't if mouse is moved rapidly. The rectangle just gets stuck if mouse is moved rapidly. Please suggest how to overcome this. &lt;body&gt; &lt;svg id="svg" width="600" height="100"&gt; &lt;rect id="myrect" width="600" height="100" fill="green"&gt; &lt;/svg&gt; &lt;script&gt; svg = document.getElementById("svg"); var w = 600; var step = 10; svg.addEventListener("mouseover", function(){ function anim () { w -= step; if( w &gt;= 300) { myrect = document.getElementById("myrect"); myrect.setAttribute("width", w); requestAnimationFrame(anim); } } anim(); }); svg.addEventListener("mouseout", function(){ function anim () { w += step; if( w &lt;= 600) { myrect = document.getElementById("myrect"); myrect.setAttribute("width", w); requestAnimationFrame(anim); } } anim(); }); &lt;/script&gt; &lt;/body&gt;
upvote count: 2

http://stackoverflow.com/a/28697046
has body: Include your main app file (in which you create the module) above the controller and factory files. For retrieving pre-existing module: var ipCharts = angular.module('ipCharts'); For controller file: var ipCharts = angular.module('ipCharts'); ipCharts.controller('securityController', function ($scope,securityFactory) { $scope.securities = securityFactory.getSecurities(); }); For Factory file: var ipCharts = angular.module('ipCharts'); ipCharts.factory('securityFactory', function ($http) { var securities = {}; $http.get('api/Securities'). success(function (data, status, headers, config) { securities = data; }). error(function (data, status, headers, config) { // log error }); var factory = {}; factory.getSecurities = function () { return securities; } return factory; });
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45685370
answers question: http://stackoverflow.com/q/28696960
has comment: http://stackoverflow.com/comment/45685511
accepted answer of: http://stackoverflow.com/q/28696960
upvote count: 17
score: 17

http://stackoverflow.com/comment/45752131
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28733123
has text: @ChrisPietschmann Added above
score: 0

http://stackoverflow.com/comment/45714463
has text: So the above code can be embedded within the HTML body? Do I need to have dependencies for AJAX?.
comment on: http://stackoverflow.com/a/28713127
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45579897
score: 0
type: AnswerComment
has text: @Dottsie more or less like this? http://jsfiddle.net/xw3sas7d/1/ in this case you will need adjust the inner elements position
comment on: http://stackoverflow.com/a/28597246
type: Comment

http://stackoverflow.com/q/28599195
score: 1
has title: JQWidgets Tree. Dropping to an empty tree — cannot get the dropped item
has body: below is a min working example of the issue I have. I need to drag items from one tree and drop to another. E.g. from a "toolbox" to the actual tree. This issue is present if only if the target tree is initially empty. After dropping to the target tree, I cannot get the corresponing tree item in the on ‘select’ handler, which is triggered on drop. The item does not get the selected (highlighted, colored) state and is not actually selectable. There is no issue if the target tree contains any single item at the beginning. Can someone please advise if I’m missing smth? $('#jqxTree').jqxTree({ height: '300px', width: '300px', allowDrop: true }); $('#btnTree').jqxTree({ height: '50px', width: '100px', allowDrag: true }); $('#jqxTree').on('select', function (event) { var args = event.args; console.log(args.element); var item = $('#jqxTree').jqxTree('getItem', args.element); console.log(item); // null item = $('#btnTree').jqxTree('getItem', args.element); console.log(item); // null }); Drag Me
upvote count: 1
tagged with: javascript
tagged with: jquery
tagged with: jqwidget
favorite count: 0
tagged with: drag-and-drop
type: UnansweredQuestion
downvote count: 0
answer count: 0
type: Question
tagged with: tree

http://stackoverflow.com/a/28833358
score: 1
accepted answer of: http://stackoverflow.com/q/28713710
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28713710
type: Answer
has body: I don't think that's the right use case for browserify-shim. Here are a few ideas: You might be able to accomplish what you want using the browser field in package.json. E.g.: "browser": { "masonry": "masonry-layout" } If you don't care about being able to install the masonry package as a dependency of the same project and you have symlinks you could symlink node_modules/masonry to node_modules/masonry-layout. You could try my pathmodify browserify plugin.
upvote count: 1

http://stackoverflow.com/comment/136795989
type: Comment
comment on: http://stackoverflow.com/a/28639524
has text: Even more concise in newer JS: `data.forEach(record => record.parent ||= '"#"')`
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45776929
type: QuestionComment
type: Comment
has text: @ErikLucio: Actually the new property is appending to the `data.data.cart_items_list` but its not having the desired value
comment on: http://stackoverflow.com/q/28745080
score: 0

http://stackoverflow.com/a/28731887
accepted answer of: http://stackoverflow.com/q/28731715
answers question: http://stackoverflow.com/q/28731715
type: AcceptedAnswer
score: 0
type: Answer
has body: You can do this: //question results $('.checkanswer').on('click', function (event) { if ( $(".targetbox .ans1").length &gt; 0 &amp;&amp; $(".targetbox .ans2").length &gt; 0 &amp;&amp; $(".targetbox").children().length == 2) { document.getElementById('showme').style.display = "block"; } else { alert("Hello! Boxes 1 &amp; 2 are not in the correct place."); } Updated fiddle

http://stackoverflow.com/q/28613120
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28635657
tagged with: css
has title: Transform thumbnail caption with CSS3
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/28635657
tagged with: hover
type: AnsweredQuestion
type: Question
score: 0
has body: I know how to create simple caption and hover captions individually on thumbnail but how to do it together like there is a simple caption on thumbnail and when it get hovered then detail caption is displayed HTML Simple Caption detail caption Shop Now CSS .caption { position:absolute; top:0; right:0; left:0; bottom:0; background:rgba( 235,235,235, 0.91) ; color:#5B5E5E !important; text-align:center; width:350px; height:600px; padding:150px; display:none; } h2 should be visible as a thumbnail caption before hovering. But when hovered then it should show h2 along with h3 and p. Here is the link which shows NICE LILY. I want to transform caption like that. How i can achieve this. Any help will be appreciated.
has comment: http://stackoverflow.com/comment/45570959
answer count: 1
has comment: http://stackoverflow.com/comment/45530876
has comment: http://stackoverflow.com/comment/45531004
tagged with: javascript

http://stackoverflow.com/comment/45527652
score: 0
comment on: http://stackoverflow.com/q/28611502
type: Comment
type: QuestionComment
has text: You could try to do something with fancy CSS3 selectors, but that would only work in the latest browsers, I think. Therefore I would use Javascript for it. To add a checkbox is unnecessary for this. Check my answer for the fiddle.

http://stackoverflow.com/a/28712569
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28712148
has body: Try Margin-top: -50px for the container1 and top:130px http://jsfiddle.net/30owkpv7/ Css #container { position:relative; margin-top:50px; margin-left:50px; width:200px; height:300px; border: 2px solid red; } #container1 { position:absolute; margin-top:-50px; /*you need 130 from body (-50) of container */ top:130px; /*top from body*/ margin-left:30px; width:50px; height:50px; border: 2px solid #a1a1a1;" } HTML &lt;div id="container"&gt; &lt;div id="container1"&gt; &lt;/div&gt; &lt;/div&gt;

http://stackoverflow.com/q/28721072
upvote count: 3
has body: I'm writing a regular expression to validate euro currency strings. It allows several different formats, since some locales use decimal points for thousands separators, some use spaces, some put the € at the beginning and some put the € at the end. Here's what I've come up with: /^(€ ?)?\-?([1-9]{1,3}( \d{3})*|[1-9]{1,3}(\.\d{3})*|(0|([1-9]\d*)?))(,[0-9]{2})?( ?€)?$/ This is working for the following tests: valid: 123 456,78 123.456,78 €6.954.231 € 896.954.231 16.954.231 € 12 346 954 231€ €10,03 10,03 1,39 ,03 0,10 €10567,01 € 0,01 €1 234 567,89 €1.234.567,89 invalid 1,234 € 1,1 50#,50 123,@€ €€500 0001 € ,001 €0,001 12.34,56 123456.123.123456 One problem with this is it validates a string with the euro symbol on both ends, e.g. €123€. This is probably acceptable for my purposes, but is there a way to make a compact RegEx that only allows that character at one end and not both, or do I just have to write one that's twice as long, checking first for a valid string with optional € at the beginning and then a valid string with optional € at the end? UPDATE The one in the accepted answer still has a few false positives. I ended up writing a function that takes several options to customize the validator. It's the isCurrency function in this library. Still uses the lookahead to avoid certain edge cases, which was the key to answering this question.
answer count: 5
possible better answer: http://stackoverflow.com/a/28721528
tagged with: regex
has answer: http://stackoverflow.com/a/28721528
downvote count: 0
has comment: http://stackoverflow.com/comment/45729889
type: Question
has comment: http://stackoverflow.com/comment/45729780
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28721567
score: 3
has answer: http://stackoverflow.com/a/28722061
has title: Can a regular expression match a character at the beginning OR end of the string (but not both)?
has answer: http://stackoverflow.com/a/28722028
tagged with: javascript
has comment: http://stackoverflow.com/comment/45729896
has answer: http://stackoverflow.com/a/28721726
accepted answer: http://stackoverflow.com/a/28721726
favorite count: 0

http://stackoverflow.com/comment/45630629
score: 0
has text: I can't do that, the unix timestamp used by jQuery flot. that jQuery flot display different time (hour) as i stated above.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28668141

http://stackoverflow.com/comment/45731419
type: AnswerComment
has text: ok, dom manipulation causes poor performance. but why should we avoid string based creation? if we generate the full table on the server, it is a huge string and network is a issue. what do you think about option1, where we append to string and finally set to the container?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28721851

http://stackoverflow.com/q/28634771
possible better answer: http://stackoverflow.com/a/28634870
has comment: http://stackoverflow.com/comment/45569522
has comment: http://stackoverflow.com/comment/45569530
has answer: http://stackoverflow.com/a/28634870
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has title: Javascript if/else statements not working
upvote count: 2
has answer: http://stackoverflow.com/a/28634925
has comment: http://stackoverflow.com/comment/45570844
type: Question
linked to: http://stackoverflow.com/q/12051769
score: -2
has comment: http://stackoverflow.com/comment/45569513
has body: I am pretty new to Javascript, and it seems like i didnt understand the if else statements correctly. I have a script which will make the visitor go to 1 of 4 websites, but the 2 last sites in my code does not work. &lt;script&gt; setTimeout(function() { var r = Math.random(); if(r &gt; 0.49) { window.location.replace("1.html"); } else if(r &lt; 0.48) { window.location.replace("2.html"); } if (r == 0.48){ window.location.replace("maybe.html"); } else if (r == 0.49){ window.location.replace("4.html"); } }, 1); &lt;/script&gt; Is how my code looks like right now. How would it need to look to make it work?
has comment: http://stackoverflow.com/comment/45570689
downvote count: 4
answer count: 2
accepted answer: http://stackoverflow.com/a/28634925
tagged with: javascript
has comment: http://stackoverflow.com/comment/45569493
favorite count: 0
has comment: http://stackoverflow.com/comment/45570671

http://stackoverflow.com/q/28685513
upvote count: 1
has answer: http://stackoverflow.com/a/28685566
has answer: http://stackoverflow.com/a/28686038
has answer: http://stackoverflow.com/a/28685687
score: -1
type: Question
tagged with: javascript
favorite count: 0
answer count: 3
tagged with: regex
type: UnansweredQuestion
has body: I need a regex for comma delimited strings. ex: "Test1, Test2, Test3, Test1" Basically: rgx.test("Test1, Test2, Test3, Test1") should return false since there is a duplicate. Any help?
downvote count: 2
has title: Javascript Regex to match comma delimited duplicate strings

http://stackoverflow.com/comment/45676766
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28692241
has text: Thank you @tasseKATT. Keep up the good work! cheers :)
score: 0

http://stackoverflow.com/a/28613078
upvote count: 2
has comment: http://stackoverflow.com/comment/45552585
answers question: http://stackoverflow.com/q/28612767
has body: ["New Day","2","One Song","John","2014-12-08 13:04:56","1843","22"] - is invalid JSON, http://www.w3schools.com/json/json_syntax.asp. Wrap your array to object of array)
downvote count: 0
type: Answer
score: 2

http://stackoverflow.com/a/28636840
type: AcceptedAnswer
has body: Some tips: {} parentheses are objects, you access properties like object.property. [] parentheses are arrays, you access elements by indexes array[index]. In your particular case, this should do it: var objects_array = JSON.parse(data); // This is an array of objects. var total = objects_array.length; for (var i = 0; i &lt; total; i++) { var obj = objects_array[i]; // This is one object from the array. console.log( obj.latitude + ',' + obj.longitude ); // We access object properties using a dot. }
answers question: http://stackoverflow.com/q/28636774
has comment: http://stackoverflow.com/comment/45573795
type: Answer
has comment: http://stackoverflow.com/comment/45573475
has comment: http://stackoverflow.com/comment/45573428
score: 2
accepted answer of: http://stackoverflow.com/q/28636774
upvote count: 3
downvote count: 1

http://stackoverflow.com/a/28614288
has comment: http://stackoverflow.com/comment/45531879
score: 0
has comment: http://stackoverflow.com/comment/45531779
type: Answer
answers question: http://stackoverflow.com/q/28612231
has body: If the destination has to be in the href, you can do this with Anchor tags : See Jsfiddle Here The line lines are just to get it to scroll so it's bigger than the window. The #a #b #c etc in the href anchor links at the top make the browser scroll to the relevant anchor within the page. If you wanted to open a div for display as well, you can use window.location.search to get the part after the #, and ise that as an id to open the relevant div. It's probably easiest to do this using JQuery. Code: <!-- these links could be on another page so the href would be like Go to One | Go to Two | Go to Three One Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line TWO Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line THREE Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line Line

http://stackoverflow.com/comment/45639810
score: 0
comment on: http://stackoverflow.com/a/28673124
type: AnswerComment
type: Comment
has text: Thanks, I tried this and it just returns "Error: Incorrect choice." Regardless of the choice i make.

http://stackoverflow.com/q/28700385
has answer: http://stackoverflow.com/a/28701129
type: Question
answer count: 2
tagged with: google-maps
accepted answer: http://stackoverflow.com/a/28701135
possible better answer: http://stackoverflow.com/a/28701129
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Open div instead of infowindow by clicking marker on Google Maps
favorite count: 0
upvote count: 2
has answer: http://stackoverflow.com/a/28701135
score: 2
type: AnsweredQuestion
has body: I have a full screen Google Map that has a small div at the bottom to hold images that turn markers on and off. I also have a hidden div that holds information for each marker (that would normally appear in the infowindow). I want to be able to show() or fadein() the hidden div when the marker is clicked on the map. This is how I am adding markers. for (i = 0; i &lt; locations.length; i++) { var myLatLng = new google.maps.LatLng(locations[i][1], locations[i][2]); marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][2], locations[i][2]), icon: icons[locations[i][4]].icon, map: map, id: locations[i][3], type: locations[i][4] }); markerGroups[locations[i][4]].push(marker); google.maps.event.addListener(marker, 'click', (function(marker, i) { toggleWindow(marker.id); })(marker, i)); bounds.extend(myLatLng); } if (locations.length &gt; 0){ map.fitBounds(bounds); } Each location in the array looks like this: ["1.50 inches", 37.5, -77.33, 0, "hail150"] The toggle window function is: function toggleWindow(id){ var godiv = '#sr'+id; if ($(godiv).css('display') == 'block') { $(godiv).css('display', 'none'); } else { $("#reportframe").children().hide(); $(godiv).css('display', 'block'); }; }; When you click on a marker I get an error: Uncaught TypeError: Cannot read property 'apply' of undefined (main.js:17) I have tried it several different ways but it appears that the IDs are not matching up or GMaps doesn't have access to the var. Fiddle

http://stackoverflow.com/comment/125644550
comment on: http://stackoverflow.com/q/28684592
score: 0
type: Comment
type: QuestionComment
has text: For newer versions of Tooltipster look at the docs here http://calebjacob.github.io/tooltipster/#triggers. You can have multiple triggers for open or close, i.e. mouseenter and tap.

http://stackoverflow.com/a/28742470
score: 3
has body: You get the HTML since you're JSP sends it back in the response. To fix that, you need to set the contentType of the page to text/plain and remove all the HTML elements from the JSP (i.e. &lt;!DOCTYPE...&gt;, &lt;html&gt; and everything. Just write D1&amp;&amp;&amp;D2&amp;&amp;&amp;D3&amp;&amp;&amp;D4 to the output. A cleaner solution would be to write a simple Servlet. That way, you can avoid all the JSP overhead.
type: AcceptedAnswer
upvote count: 3
type: Answer
answers question: http://stackoverflow.com/q/28742388
has comment: http://stackoverflow.com/comment/45768491
accepted answer of: http://stackoverflow.com/q/28742388
downvote count: 0

http://stackoverflow.com/a/28722621
accepted answer of: http://stackoverflow.com/q/28722399
type: Answer
has body: You're not passing a function to EventTarget.addEventListener(). You're immediately executing and passing the result of this: function (col) { console.log(col); }(localStorage.key(i)) ... which is undefined. You can ammend that by using the following syntax: categoryButton.addEventListener('click', (function(col) { // return a function to addEventListener return function(){ console.log(col); } })(localStorage.key(i)),true); Here's a demo: var input; for (var i = 0; i &lt;= 5; i++) { input = document.createElement('input'); input.type = "button" input.value = i; input.addEventListener('click', function(i) { // return a function to addEventListener return function() { console.log(i); } }(i), true); document.body.appendChild(input); }
answers question: http://stackoverflow.com/q/28722399
has comment: http://stackoverflow.com/comment/45732467
has comment: http://stackoverflow.com/comment/45732540
upvote count: 1
has comment: http://stackoverflow.com/comment/45732261
score: 1
has comment: http://stackoverflow.com/comment/45732243
type: AcceptedAnswer
downvote count: 0

relative-path
type: Tag
tag name: relative-path
tags question: http://stackoverflow.com/q/28690228

http://stackoverflow.com/q/28609205
has body: I'm working on angularJs and typescript project. I have to make synchronous http call and get some data from server before I launch my client app and load UI. I search on internet and see everybody speak about promise, huumm okay why not. So I use promise (make $http call and use $q to return promise) in my app.run(). Maybe I'm missing nothing because this is not working at all. Angular launch app.config(), then app.run(), ... But Angular does not wait app.config() finish before launch app.run(). So my first promise is launch in app.run() and before it resolve Angular try to instantiate controller... I don't want to create new service call httpSynchronous but I haven't any other ideas.
has answer: http://stackoverflow.com/a/28609571
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
score: 8
tagged with: promise
upvote count: 8
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45522401
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/16286605
has title: AngularJS promise in app.run()
tagged with: synchronous
has comment: http://stackoverflow.com/comment/45522409
duplicate of: http://stackoverflow.com/q/16286605
type: Question

http://stackoverflow.com/q/28721069
type: Question
accepted answer: http://stackoverflow.com/a/28721349
tagged with: javascript
has title: removeChild and then add again previously removedChild to reload and clean it?
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28721349
upvote count: 1
type: AnsweredQuestion
score: 1
has body: I try to do something like this var refresh = function(){ var elem = document.getElementById(scope.id); elem.parentNode.removeChild(elem); console.log('Canvas Destroyed'); //Here I would like to add removedChild again so i am sure that is clean// }; scope.$watch('data', function (newVal, oldVal) { if (newVal) { refresh(); //I Use Function Here So i am sure that canvas are empty var newChart = document.getElementById(scope.id).getContext("2d"); console.log('Charts0'); var PieChart = new Chart(newChart).Pie(scope.data, scope.options); console.log('Charts1'); } }, true); Question: It is possible to first remove element and then put the same element back in one function? Or reload canvas or reboot so it will be without any data when creating charts in it. My application is dynamic and if i will not do it, some highlighting layers from my charts will overlapping each other.

http://stackoverflow.com/comment/45609769
has text: the id name is really just a category within a mysql table eg: input1 would select red, input2 would select white from the colour column. jquery ui already has a default way of passing the search term via a get field called 'term', I just need a second parameter passed down the url.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28656478
score: 0

http://stackoverflow.com/comment/45533553
type: Comment
type: QuestionComment
has text: this might help you https://github.com/apache/cordova-plugin-console check if this plugin show your console logs in the terminal
score: 0
comment on: http://stackoverflow.com/q/28611375

http://stackoverflow.com/q/28698357
has comment: http://stackoverflow.com/comment/45723648
has title: Defer loading of javascript
tagged with: pagespeed
score: 0
has comment: http://stackoverflow.com/comment/45704604
has comment: http://stackoverflow.com/comment/45689046
has comment: http://stackoverflow.com/comment/45704531
has comment: http://stackoverflow.com/comment/45846196
tagged with: jquery-deferred
answer count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45688805
has comment: http://stackoverflow.com/comment/45688378
type: Question
has comment: http://stackoverflow.com/comment/45704574
has comment: http://stackoverflow.com/comment/45899298
has comment: http://stackoverflow.com/comment/45846205
has body: To defer Javascript, I use the following code. It works. &lt;script type="text/javascript"&gt; function downloadJSAtOnload() { var element2 = document.createElement("script"); element.src = "http://s7.addthis.com/js/300/addthis_widget.js"; document.body.appendChild(element); var element3 = document.createElement("script"); element.src = "js/jquery.idTabs.min.js"; document.body.appendChild(element); var element4 = document.createElement("script"); element.src = "js/mobilemelody.jq.js"; document.body.appendChild(element); var element5 = document.createElement("script"); element.src = "js/swipe.min.js"; document.body.appendChild(element); var element6 = document.createElement("script"); element.src = "js/swipe.js"; document.body.appendChild(element); var element7 = document.createElement("script"); element.src = "js/mobilemelody.js"; document.body.appendChild(element); var element8 = document.createElement("script"); element.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"; document.body.appendChild(element); } if (window.addEventListener) window.addEventListener("load", downloadJSAtOnload, false); else if (window.attachEvent) window.attachEvent("onload", downloadJSAtOnload); else window.onload = downloadJSAtOnload; &lt;/script&gt; Now i have start to use cloudfront cdn, and server the js files from subdomain content.exemple.com. The subdomain content.exemple.com point to cloudfront cdn. Exemple js/bootstrap.min.js have become http://content.exemple.com/js/bootstrap.min.js i have used the following code without any result : &lt;script type="text/javascript"&gt; function downloadJSAtOnload() { var element2 = document.createElement("script"); element.src = "//s7.addthis.com/js/300/addthis_widget.js#pubid=xa-515d67835fedfa10#"; document.body.appendChild(element); var element3 = document.createElement("script"); element.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"; document.body.appendChild(element); var element4 = document…

http://stackoverflow.com/comment/63002737
has text: @mrdunk: i wasn't talking about trip times, i was talking about how long it takes from when the server closes the connection to when the client parses the response, which takes nowhere near as long as half a round-trip... ex: CHI-SF takes about 70ms to ping, but the response usually arrives within 10-20ms after it's shipped once the connection is up and running... it's a question of how stale the server data is when it hits the client, and the answer is "not very" (relative to ping times)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28684406

http://stackoverflow.com/comment/45826458
comment on: http://stackoverflow.com/a/28678607
score: 0
type: Comment
has text: It's difficult to read your page in the browser source code window. But I can't see that you've loaded requirejs in your page or have I missed it.
type: AnswerComment

http://stackoverflow.com/q/28660281
has title: Regular expressions in python to javascript
has answer: http://stackoverflow.com/a/28660447
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28660358
downvote count: 2
has answer: http://stackoverflow.com/a/28660358
type: Question
score: -2
accepted answer: http://stackoverflow.com/a/28660447
tagged with: javascript
answer count: 2
upvote count: 0
has body: How to convert the regular expression in the function below which I have done in python to javascript? def data_validation(str): r=re.compile('[0-9]{3}/[0-9]{2,3}') if len(str)==7 or len(str)==6: if r.match(str): return True else: return False
favorite count: 0

http://stackoverflow.com/a/28618083
upvote count: 4
has comment: http://stackoverflow.com/comment/45552917
type: Answer
has comment: http://stackoverflow.com/comment/45539179
downvote count: 0
has comment: http://stackoverflow.com/comment/45541756
score: 4
has body: Yes, you can call a method without declaring a variable. Because initialization with the new operator will return a new instance of an object. function Foo(){ this.bar = function() { alert('hi'); } } new Foo().bar(); // alerts hi You can also make the method daisy-chainable. function Foo(){ this.bar = function() { alert('hi'); return this; } } new Foo().bar().bar(); // alerts hi twice
answers question: http://stackoverflow.com/q/28617985

http://stackoverflow.com/comment/45764062
score: 0
type: QuestionComment
has text: Try this one. `$(document).load().scrollTop(0);`
type: Comment
comment on: http://stackoverflow.com/q/28740012

http://stackoverflow.com/comment/45513405
type: QuestionComment
comment on: http://stackoverflow.com/q/28603945
has text: oh no, I have both functions ValidateId and Validate.
score: 0
type: Comment

http://stackoverflow.com/comment/45671354
score: 0
comment on: http://stackoverflow.com/a/28689720
type: Comment
has text: " how do i call a javascript function without making changes to my HTML file." this is his question,read
type: AnswerComment

http://stackoverflow.com/q/28710524
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28710555
has answer: http://stackoverflow.com/a/28710571
accepted answer: http://stackoverflow.com/a/28710571
linked to: http://stackoverflow.com/q/750486
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28710555
duplicate of: http://stackoverflow.com/q/750486
has body: Is there a way to be able to get the literal value passed into the click() function? &lt;script&gt; var texts = ['t1', 't2', 't3', 't4', 't5']; $(document).ready(function () { for (var i = 0; i &lt; texts.length; i++) { var div = $("&lt;div&gt;"); div.click(function () { div.text(texts[i]); // &lt;---- problem here console.log(texts[i]); // with texts[i] }); $("#container").append(div); } }); &lt;/script&gt; &lt;div id="container"&gt;&lt;/div&gt; Intended result: 5 div elements each respectively containing the text "t1", "t2", etc. 5 div elements each, when clicked on, output the text "t1", "t2", etc. to the console. Alternate Solution 1: $(document).ready(function () { for (var i = 0; i &lt; texts.length; i++) { var div = $("&lt;div&gt;"); div.click({index: i}, function (e) { div.text(e.data.index); console.log(e.data.index); }); $("#container").append(div); } }); Alternate Solution 2: A function can be added to set the text in the onclick event handler : function setClick(elem, text) { elem.click(function () { console.log(text); }); } So that div.click( ... ); is replaced by: setClick(div, i);
type: AnsweredQuestion
type: Question
has title: How to get a variable's literal value when setting an element's onclick handler via jQuery?
tagged with: javascript

http://stackoverflow.com/comment/45888071
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28751334
type: AnswerComment
has text: Sorry for the bad formatting, I try to post the code here again: ` ... ... `

http://stackoverflow.com/q/28608058
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28608282
has body: My issue: ngIncluding a video source doesn't replace the video. My page has a feed and a preview, each time I click on a post in the the feed, its preview gets injected (ngInclude) to the preview area. It works fine for youtube video, for images and for text but when it gets to html5 videos, the same video keeps showing and it seems the source doesn't get replaced in the page. Weirdest thing is when I enter chrome debugger and inspect the element, I see its source gets replaced with a different url, but the video in the preview doesn't change. I even tried enabling autoplay and when I move through posts the video continues to play on smoothly. Here are the relevant code bits: The preview that gets ngIncluded: &lt;div ng-if="postInfo.Media.type == 'video'"&gt; &lt;video name="media" width="582" height="582" controls autoplay&gt; &lt;source src="{{postInfo.Media.videoStandardResolution}}" type="video/mp4"&gt; &lt;/video&gt; &lt;/div&gt; The main page including bit: &lt;div id="preview-panel"&gt; &lt;ng-include src="htmlInclude" onload="responsiveCalc()"/&gt; &lt;/div&gt; And in my javascript when I get an event of post changed in the feed, I just re-initialize the $scope.htmlInclude Anyone came across anything like it? Should I somehow refresh the video source? And if so how. Thanks!
type: Question
has comment: http://stackoverflow.com/comment/45520662
has comment: http://stackoverflow.com/comment/45523031
tagged with: angularjs-ng-include
score: 0
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/28608282
has title: AngularJS ngInclude Html5 Video doesn't get replaced
tagged with: angularjs
has answer: http://stackoverflow.com/a/28656426
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28656426
tagged with: video

http://stackoverflow.com/q/28622845
accepted answer: http://stackoverflow.com/a/28622886
tagged with: javascript
score: 0
has body: I'm trying to get a pretty simple ng-repeat working with directives within the repeat that have attribute values based on the repeated items. I've tried the suggestion in calling an angularjs attribute directive from inside an ng-repeat: {{tagName}} RE? {{tagValuesMatchCount(tagName)}} But this just puts the literal "tagName" in every row. I tried writing my own directive (including some custom changes to MassAutocomplete), such that I could write: {{tagName}} Directive is: .directive('tagSelection', function() { return { scope: { tagk: '@' }, template: ' RE? \ \ {{tagk}} ' } }) But the ng-model part messes up whilst using the {{tagk}} (it's fine if I use a literal). I also haven't got the method binding at the end working. I'm pretty certain I can get this working using some clever variable scoping, but I find the doco quite confusing on this. Can I do this using a pure ng-repeat without a custom directive or are there changes I can make to my custom directive to get this to work? The output I'm aiming for from this (given tagNames = ["host","user","method"]) is: host RE? {{tagValuesMatchCount("host")}} user RE? {{tagValuesMatchCount("user")}} method RE? {{tagValuesMatchCount("method")}} Plunker available here
answer count: 1
tagged with: angularjs
has comment: http://stackoverflow.com/comment/50168034
linked to: http://stackoverflow.com/q/16502559
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/25190951
type: Question
has title: Using directives inside an ng-repeat
has answer: http://stackoverflow.com/a/28622886

http://stackoverflow.com/q/28697489
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28705555
has body: Tablesorter sortList Malfunction? why cannot i set an initial column sort order with sortList? $(function(){ $("#myTable").tablesorter({ sortList : [[4,1]], // initial sort columns (2nd and 3rd) cssInfoBlock : "tablesorter-no-sort" }); }); Can anyone tell me why please?
type: AnsweredQuestion
favorite count: 0
type: Question
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/28705555
tagged with: tablesorter
score: 0
downvote count: 1
has title: Tablesorter sortList Malfunction?

jquery-ui
tags question: http://stackoverflow.com/q/28657084
tags question: http://stackoverflow.com/q/28744275
tags question: http://stackoverflow.com/q/28676872
tags question: http://stackoverflow.com/q/28745653
tags question: http://stackoverflow.com/q/28613266
tags question: http://stackoverflow.com/q/28624762
tags question: http://stackoverflow.com/q/28703184
tags question: http://stackoverflow.com/q/28652726
tags question: http://stackoverflow.com/q/28656478
tags question: http://stackoverflow.com/q/28725467
tags question: http://stackoverflow.com/q/28727926
tags question: http://stackoverflow.com/q/28600790
tags question: http://stackoverflow.com/q/28686331
tags question: http://stackoverflow.com/q/28645242
tags question: http://stackoverflow.com/q/28744681
tags question: http://stackoverflow.com/q/28721043
tags question: http://stackoverflow.com/q/28656684
tags question: http://stackoverflow.com/q/28635144
tags question: http://stackoverflow.com/q/28601048
tags question: http://stackoverflow.com/q/28627780
tags question: http://stackoverflow.com/q/28660080
tags question: http://stackoverflow.com/q/28641740
tags question: http://stackoverflow.com/q/28741143
tags question: http://stackoverflow.com/q/28738993
tags question: http://stackoverflow.com/q/28643574
tags question: http://stackoverflow.com/q/28677149
tags question: http://stackoverflow.com/q/28600401
tags question: http://stackoverflow.com/q/28689043
tags question: http://stackoverflow.com/q/28707161
tags question: http://stackoverflow.com/q/28626395
tags question: http://stackoverflow.com/q/28745024
tags question: http://stackoverflow.com/q/28630622
type: Tag
tags question: http://stackoverflow.com/q/28637443
tags question: http://stackoverflow.com/q/28644174
tags question: http://stackoverflow.com/q/28669947
tags question: http://stackoverflow.com/q/28658423
tags question: http://stackoverflow.com/q/28675914
tag name: jquery-ui
tags question: http://stackoverflow.com/q/28734144
tags question: http://stackoverflow.com/q/28630913
tags question: http://stackoverflow.com/q/28670260
tags question: http://stackoverflow.com/q/28744648

http://stackoverflow.com/q/28642598
tagged with: blob
has title: How to generate blob from http response in java script?
linked to: http://stackoverflow.com/q/21628378
answer count: 1
linked to: http://stackoverflow.com/q/28093736
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29666897
tagged with: http://stackoverflow.com/tag/pdf
has comment: http://stackoverflow.com/comment/45604981
tagged with: angularjs
type: UnansweredQuestion
type: Question
has body: I am a beginner in javascript and web programming I am using node to create a pdf file and pipe it as an http response On the client-side I am using angularjs to create blob from the response. Instead of getting a correct pdf file, i am getting a pdf page with a blank page. Did I created blob the wrong way? Is there something I missed? I did try researching the internet, the closest thing I found is this: AngularJS: Display blob (.pdf) in an angular app but it still does not work after i followed the instructions my code: $http.get('pdf-page', null, { responseType: 'arraybuffer' }) .success(function (res) { console.log(res); var file = new Blob([data], {type: 'application/pdf'}); var fileURL = URL.createObjectURL(file); window.open(fileURL); }); result of console.log(res): %PDF-1.3 %���� 5 0 obj &lt;&lt; /Type /Page /Parent 1 0 R /MediaBox [0 0 612 792] /Contents 3 0 R /Resources 4 0 R endobj 4 0 obj &lt;&lt; /ProcSet [/PDF /Text /ImageB /ImageC /ImageI] /Font &lt;&lt; /F1 6 0 R endobj 7 0 obj &lt;&lt; /Producer (��PDFKit) /Creator (��PDFKit) /CreationDate (D:20150121171417Z) endobj 6 0 obj &lt;&lt; /Type /Font /BaseFont /Helvetica /Subtype /Type1 /Encoding /WinAnsiEncoding endobj 2 0 obj &lt;&lt; /Type /Catalog /Pages 1 0 R endobj 1 0 obj &lt;&lt; /Type /Pages /Count 1 /Kids [5 0 R] endobj 3 0 obj &lt;&lt; /Length 110 /Filter /FlateDecode stream x�e�A QC�=E/�����`p!�^� ������o�^�$$�F���%�����_w+q3�l�6��&amp;�����!�h8�a�e�ș�.�0�08vrpd�H6�k�֯Zo��&lt;���� endstream endobj xref 0 8 0000000000 65535 f 0000000462 00000 n 0000000413 00000 n 0000000519 00000 n 0000000119 00000 n 0000000015 00000 n 0000000316 00000 n 0000000208 00000 n trailer &lt;&lt; /Size 7 /Root 2 0 R /Info 7 0 R startxref 701 %%EOF

http://stackoverflow.com/comment/45575454
score: 0
has text: " // Why do you need a return? Is it part of the testing? return true;" The reason there is a return statement in this line and again above is because for some reason the method comes up with an error if i don't have a return statement... also, is the 'void' the issue in my .copy and .scale and .doubleIt methods? because i cant pull anything in my tester...
type: AnswerComment
comment on: http://stackoverflow.com/a/28637429
type: Comment

http://stackoverflow.com/comment/45740280
comment on: http://stackoverflow.com/a/28705288
has text: @BrentConnor to fix your problem with the code only working if placed after, see my updated answer
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45545773
comment on: http://stackoverflow.com/a/28621318
type: AnswerComment
has text: What you mean i use the same code?
score: 0
type: Comment

http://stackoverflow.com/comment/45609707
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28656528
score: 0
has text: likeButConAct is when the user have set it to liked(when like is true) and likeCount explains how many likes there is.

http://stackoverflow.com/comment/45714801
type: Comment
type: QuestionComment
has text: You are on to something, however in your fiddle. if you type a single letter like A and hit enter, it will load quick up to 15 times, then go slow. If you type 'AAAAAAAAAAAAAAA' after the forth or fifth line it will load slow again, even if the next line is 'A'. once it goes slow, it wont come back :-(
comment on: http://stackoverflow.com/q/28709913
score: 0

http://stackoverflow.com/comment/45778840
score: 0
type: AnswerComment
has text: The rest of the code is missing. For example you'll also need a function handleAdd() {alert(1)} for example, for the callback. Otherwise, you might want to post a full example in http://jsfiddle.net/
comment on: http://stackoverflow.com/a/28724860
type: Comment

http://stackoverflow.com/a/28611416
answers question: http://stackoverflow.com/q/28611284
type: AcceptedAnswer
upvote count: 9
type: Answer
downvote count: 0
score: 9
accepted answer of: http://stackoverflow.com/q/28611284
has body: Use a group and build the regular expression var str = "test"; var text = "Test this"; var re = new RegExp("(" + str + ")","gi"); console.log(text.replace(re, "$1")) //"Test this"

http://stackoverflow.com/a/28722061
answers question: http://stackoverflow.com/q/28721072
score: 0
type: Answer
has body: This is the closest I've been able to come. It uses negative lookahead to make sure that the string doesn't begin and end with the euro symbol €: ^(?!€.*€$)€?\s*(0|[1-9][0-9]{0,2})?([. ]?[0-9]{3})*(,[0-9]{2})?\s*€?$ See Regex 101 Demo here for full explanation and examples. As you can see it passes all of your tests, but it lets a couple of bad ones through. I'm sure the digit portion can be tweaked so that it works for you. The part that makes sure there are not two euro symbols is just this: ^(?!€.*€$)€?\s*&lt;digit validation goes here&gt;\s*€?$ Negative lookahead makes sure the string doesn't start and end with the euro symbol, then it checks for optional euro symbol at start followed by an arbitrary # of spaces, validates the digits, then checks for an arbitrary # of spaces and a euro symbol at the end.

http://stackoverflow.com/q/28728302
type: Question
has title: Apply A Function to All Links on Page
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28728323
upvote count: 2
has answer: http://stackoverflow.com/a/28728323
answer count: 3
tagged with: css
favorite count: 0
accepted answer: http://stackoverflow.com/a/28728392
type: AnsweredQuestion
score: 2
downvote count: 0
has body: i have my all links on page like this : Example But Now I Want All Links With Following OnClick Function like this: Example can any one tell me jquery or javascript code to add above function to all links on body, thanks
has answer: http://stackoverflow.com/a/28728375
has answer: http://stackoverflow.com/a/28728392

http://stackoverflow.com/q/28683919
has comment: http://stackoverflow.com/comment/45660746
type: AnsweredQuestion
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45660837
has body: I'm currently trying to style a dropdown menu, but I'm running into some issues. The biggest one is that the dropdown elements don't seem to be exceed the size of their parent object when the css for the dropdown is set to relative. (Had to block out the search results, sorry). It seems to work on fixed, but only in Firefox, Chrome's dropdowns are all off. So I think I need one of two solutions: Fixing the width issue and keeping the position: relative Fixing the offset issue that occurs ONLY in chrome, and setting the position: fixed attribute. HTML: Truncated search results.. CSS #searchresults, #noderesults, #roadmapresults, #intersectnoderesults { max-width: 1000px; background: #2E3C3F; width:auto; height: 0px; padding: 0; border: none; position: relative; z-index: 3; /*So that the dropdown stays infront of the forms*/ } Would anyone know how I could go about fixing this?
has answer: http://stackoverflow.com/a/28684379
tagged with: javascript
score: -1
accepted answer: http://stackoverflow.com/a/28684379
has comment: http://stackoverflow.com/comment/45660966
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: width: auto property not being respected with position: relative
tagged with: css
has comment: http://stackoverflow.com/comment/45660705

http://stackoverflow.com/comment/45981582
score: 0
type: AnswerComment
has text: Also, we are using javascript to handle the file download `window.location = current.ExportToFileUrl;`
type: Comment
comment on: http://stackoverflow.com/a/28824837

http://stackoverflow.com/comment/45586549
type: QuestionComment
has text: I think you need open developer tools first. Press F12
comment on: http://stackoverflow.com/q/28644251
score: 4
type: Comment

http://stackoverflow.com/q/28650399
type: UnansweredQuestion
has body: I have a script that follows the mouse, and I was wondering if, and how, I could fire a 'bullet' and have it disappear when its off screen. Here is my following code: var box=$(".box"); var boxCenter=[box.offset().left+box.width()/2, box.offset().top+box.height()/2]; $(document).mousemove(function(e){ var angle = Math.atan2(e.pageX- boxCenter[0],- (e.pageY- boxCenter[1]) )*(180/Math.PI); box.css({ "-webkit-transform": 'translate(-50%,-50%) rotate(' + angle + 'deg)'}); box.css({ '-moz-transform': 'translate(-50%,-50%) rotate(' + angle + 'deg)'}); box.css({ 'transform': 'translate(-50%,-50%) rotate(' + angle + 'deg)'}); });
downvote count: 3
score: -3
type: Question
has title: Firing a Bullet to off-screen
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28653160

http://stackoverflow.com/comment/45769813
score: 0
comment on: http://stackoverflow.com/q/28743442
type: Comment
type: QuestionComment
has text: Your fiddle does nothing (besides displaying the code..)

http://stackoverflow.com/q/28657432
has comment: http://stackoverflow.com/comment/45612561
has comment: http://stackoverflow.com/comment/45612379
has comment: http://stackoverflow.com/comment/45612909
has comment: http://stackoverflow.com/comment/45611036
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45610993
linked to: http://stackoverflow.com/q/18504139
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45612599
answer count: 1
has body: I have a form and want to verify it with javascript/jquery. One of the fields in the form is the Gender with has two radio buttons (Male and Female) Male Female I want to verify the gender by leaving them (using onblur). function verifyGender() { if(document.getElementById("genderMale").checked==true || document.getElementById("genderFemale").checked==true) { // success } else { // display error message } } I got a little bug if the user uses his/her keyboard to access the fields. When the user is female, she could press tab key to go to the gender. While the user keeps on pressing tab until it reaches to gender, the Male radio button is focused first. Since she is not male, she presses tab again and press space or just pressing the right arrow key to select "Female" but the error is already displayed. So, I decided to execute only the function after the user leaves the gender field but I don't know how. How should I do it? The error message must not displayed when the user is still on the gender radio buttons and he/she doesn't select one yet.
has answer: http://stackoverflow.com/a/28660001
linked to: http://stackoverflow.com/q/1525718
has title: Blur Multiple Radio Buttons
type: UnansweredQuestion

http://stackoverflow.com/a/28687326
downvote count: 0
score: 1
upvote count: 1
has body: ok here is the code i came up with, its not the best but it will help you understand how we can do "Resize" Jsfiddle is here http://jsfiddle.net/sv66bxee/ My html code is:- &lt;div style="border: 2px solid;width: 800px;"&gt; &lt;svg id="mycanvas" width="800px" height="500px" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" &gt; &lt;rect id="myrect" fill="black" x="100" y="70" width="100" height="100" /&gt; &lt;rect id="resize" fill="red" x="190" y="160" width="20" height="20" /&gt; &lt;/svg&gt; &lt;/div&gt; and some Javascript:- document.addEventListener('mousedown', mousedown, false); var mousedown_points; function mousedown(e) { var target = e.target; if (target.id === 'resize') { mousedown_points = { x: e.clientX, y: e.clientY } document.addEventListener('mouseup', mouseup, false); document.addEventListener('mousemove', mousemove, false); } } function mousemove(e) { var current_points = { x: e.clientX, y: e.clientY } var rect= document.getElementById('myrect'); var w=parseFloat(rect.getAttribute('width')); var h=parseFloat(rect.getAttribute('height')); var dx=current_points.x-mousedown_points.x; var dy=current_points.y-mousedown_points.y; w+=dx; h+=dy; rect.setAttribute('width',w); rect.setAttribute('height',h); mousedown_points=current_points; updateResizeIcon(dx,dy); } function updateResizeIcon(dx,dy){ var resize= document.getElementById('resize'); var x=parseFloat(resize.getAttribute('x')); var y=parseFloat(resize.getAttribute('y')); x+=dx; y+=dy; resize.setAttribute('x',x); resize.setAttribute('y',y); } function mouseup(e) { document.removeEventListener('mouseup', mouseup, false); document.removeEventListener('mousemove', mousemove, false); }
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28676181
type: Answer
answers question: http://stackoverflow.com/q/28676181

http://stackoverflow.com/q/28599686
has comment: http://stackoverflow.com/comment/45505309
tagged with: tableofcontents
downvote count: 3
has comment: http://stackoverflow.com/comment/45505384
has comment: http://stackoverflow.com/comment/45505755
type: Question
has body: I want to create an TOC in html using JS and Jquery. My HTML headings will look like this: .... .... ... Now I want to create toc only for the sections without any class value and it may have nested inside another one.
score: -2
tagged with: javascript
tagged with: jquery
has title: Creating a Table of Contents in HTML using Js, jQuery
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45505792
has answer: http://stackoverflow.com/a/28600383
upvote count: 1

http://stackoverflow.com/q/28735615
possible better answer: http://stackoverflow.com/a/28735703
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28735703
tagged with: checkbox
has body: I have gone through the stackoverflow regarding enable/disable button conditionally and was able to find some help but NOT EXACT what I was looking for. Instead of 1 checkbox condition, I have 2 checkbox conditions. So unless if the two checkboxes have been accepted, the button should not be enabled. Following is my html: Continue Following is javascript: function checked(element1, element2) { var myLayer = document.getElementById('acceptbtn'); if (element1.checked == true && element2.checked == true) { myLayer.class = "submit"; myLayer.disabled = ""; } else { myLayer.class = "button:disabled"; myLayer.disabled = "disabled"; }; } I have tried like above, but it is not working. I don't know where I am going wrong.
answer count: 6
has answer: http://stackoverflow.com/a/28735828
upvote count: 3
has answer: http://stackoverflow.com/a/28735670
has answer: http://stackoverflow.com/a/28735956
linked to: http://stackoverflow.com/q/4471401
has answer: http://stackoverflow.com/a/28735860
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28735947
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Enable/disable button based on accepting the 2 checkbox conditions
favorite count: 0
accepted answer: http://stackoverflow.com/a/28735670
type: Question
score: 3

http://stackoverflow.com/comment/45591912
score: 0
type: AnswerComment
has text: I thought about that, but I'm assuming the OP just made a mistake when typing the question here. He would have *much* bigger errors if `ds` was undefined.
type: Comment
comment on: http://stackoverflow.com/a/28646904

http://stackoverflow.com/q/28722737
type: Question
accepted answer: http://stackoverflow.com/a/28723037
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45732170
score: 0
has title: Angular.js - Socket.io event updates model, not view
possible better answer: http://stackoverflow.com/a/38459651
tagged with: angularjs
has answer: http://stackoverflow.com/a/38459651
has answer: http://stackoverflow.com/a/28723037
type: AnsweredQuestion
has body: I have sockets working, in that each client seems to be running the proper code block that console.logs the event. The client that sends the message updates the view, but the other connected clients don't. But when another client sends a message, its view updates with all the backlogged messages that it's been pushing to the model, so I know that part is working. It's just the view that's not updating. I've done some reading, and it looks like I need to refactor my code to use $scope and $scope.$apply, but I'm not sure how. app.controller('StoryController', ['$http', '$scope', function($http, $scope){ var story = this; socket.on('new storyPoint', function(msg){ //console.log('new storyPoint!', msg); story.points.push(msg); $('.story').scrollTop($('.story')[0].scrollHeight); console.log('last story point:', story.points[story.points.length - 1]); }); }]); As you can see, I'm not actually using $scope yet, and I'm pretty sure I need to, but trying to mimic other solutions to this problem has failed. Edit: And here's the view: Players {{storyCtrl.username}} {{player}} {{game.settings.title}} {{storyPoint.body}} {{storyCtrl.point.body}}
tagged with: socket.io

http://stackoverflow.com/comment/45640941
comment on: http://stackoverflow.com/q/28643612
type: Comment
type: QuestionComment
has text: I'm not understading. What format that you need to export? SVG format?
score: 0

http://stackoverflow.com/comment/45537365
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28616585
score: 0
has text: @entiendoNull — Removing the quotes will make no difference. Strings are fine as property names in object literals. Manually constructing the string could break things since the data might include special characters.

http://stackoverflow.com/q/28730389
type: Question
possible better answer: http://stackoverflow.com/a/28730551
has comment: http://stackoverflow.com/comment/45747178
has answer: http://stackoverflow.com/a/28730551
accepted answer: http://stackoverflow.com/a/28730448
tagged with: javascript
has comment: http://stackoverflow.com/comment/45747121
has comment: http://stackoverflow.com/comment/45747134
tagged with: scope
answer count: 2
tagged with: for-loop
linked to: http://stackoverflow.com/q/518000
has comment: http://stackoverflow.com/comment/45747049
downvote count: 0
has body: I hit a subtle bug which has been distilled as follows: function huh() { for (var i = 0; i &lt; 10; i++) { if ( i % 2 == 1 ) { var x = i; console.log(i + ' ' + x); } else { console.log(i + ' ' + x); } } } huh(); Firstly, I would challenge even experienced JavaScript programmers to correctly predict the exact output of this program on paper only. But mainly, JavaScript seems to be mixing dynamic and lexical scoping. And it seems there is no block scope, only function scope, which is basically blowing away my whole concept of scoping in JavaScript. Can someone explain in reference to the standard, and maybe a bit of rationale? This seems highly counter-intuitive.
favorite count: 0
has comment: http://stackoverflow.com/comment/45747296
has answer: http://stackoverflow.com/a/28730448
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/45747108
linked to: http://stackoverflow.com/q/23392111
has title: Dynamic vs. lexical scoping in JavaScript / loop confusion
upvote count: 1

http://stackoverflow.com/comment/45773256
score: 0
has text: So if I am passing reference as a value it is call by sharing .
type: QuestionComment
comment on: http://stackoverflow.com/q/28745273
type: Comment

http://stackoverflow.com/q/28712270
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28746690
tagged with: css
type: Question
has body: I coded a website in HTML5 recently. Its slider have some cool intro animations (used slider revolution plugin for slider intro animations). Then I installed a preloading animation on the website (this one - ihatetomatoes[dot]net/demos/css3-preloader-transition). All works perfectly. But the cool and awesome animations of the slider are already over when the preloader finishes and takes us the to website. Code to slider animations: http://pastebin.com/HTVGxpCz Code to the preloader: http://pastebin.com/14JPCX1n Please help me so that site loads perfectly -- preloader loads, then when it ends, only then do the slider intro animations start.
tagged with: javascript
tagged with: jquery
score: 0
has title: Preloading Animation hides all the cool slider intro animations

http://stackoverflow.com/q/28614955
has body: I need to access (call and/or modify) the scope of a controller from outside of it. Following this answer I managed to access the scope, but the data binding doesn't kick in... Take this as example (JSFiddle). angular.module("App", []).controller("Test", function($scope) { $scope.list = ["added on initialization"]; $scope.add = function(item) { $scope.list.push(item); }; }); var addFromOutside = function() { angular .element(document.getElementById("TestController")) .scope() .add('added from outside'); }; {{item}} Add from inside Add from outside If you click in the "Add from inside" button it works like expected. But if you click in the "Add from outside" button nothing happens until you click in the "Add from inside" button... Is there anyway to do this and the have data binding working?
has answer: http://stackoverflow.com/a/28615070
has comment: http://stackoverflow.com/comment/45533476
accepted answer: http://stackoverflow.com/a/28615070
favorite count: 0
tagged with: angularjs
has title: Call controller function from outside
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45534674
score: 1
linked to: http://stackoverflow.com/q/16709373
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/45533126
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/28689680
tagged with: stream
type: Question
score: 0
has comment: http://stackoverflow.com/comment/45671449
has body: How to get stream traffic size in WebRTC. I want to traffic information in client javascript. Wait for your answer.
tagged with: webrtc
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45671041
tagged with: traffic
tagged with: http://stackoverflow.com/tag/html
has title: How to get stream traffic size in WebRTC
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28719809

http://stackoverflow.com/q/28619445
accepted answer: http://stackoverflow.com/a/28619914
has body: I'm trying to count common field of 2 polygons using containsLocation option to make huge amount of the same small fields placed only in common field. I think something is wrong with containsLocation(this, pole1). I tried many other ways, still not working. If you have got an idea how to count complex polygons common field you might write it down here also. Problem var x,y,countmarkers;countmarkers=0; for(x=52.8;x&lt;=54;x=x+0.15){ for(y=12.6;y&lt;=19;y=y+0.25) { var point = { lat: x, lng: y}; if (google.maps.geometry.poly.containsLocation(point, pole1)) { if (google.maps.geometry.poly.containsLocation(point, pole2)){ var marker = new google.maps.Marker({ position: new google.maps.LatLng(x, y), map: map }); countmarkers++; } } } } Full code var map; function initialize() { var mapOptions = { mapTypeId: google.maps.MapTypeId.TERRAIN, center: {lat: 52.597060, lng: 18.516048}, zoom: 6 }; var map = new google.maps.Map(document.getElementById('map-canvas'),mapOptions); var pole0; pole0 = [ [ new google.maps.LatLng(54, 14), new google.maps.LatLng(53, 14), new google.maps.LatLng(53, 15), new google.maps.LatLng(54, 15)], [ new google.maps.LatLng(54, 15), new google.maps.LatLng(53, 13), new google.maps.LatLng(53, 17), new google.maps.LatLng(54, 17)] ]; var pole2,pole1; pole1 = new google.maps.Polygon({ //map: map, paths: pole0[0], strokeColor: '#000000', strokeWeight: 4, strokeOpacity: 1, fillColor: '#ff0000', fillOpacity: 0.5 }); pole2 = new google.maps.Polygon({ //map: map, paths: pole0[1], strokeColor: '#ffffff', strokeWeight: 4, strokeOpacity: 1, fillColor: '#ff0000', fillOpacity: 0.5 }); var x,y,countmarkers;countmarkers=0; for(x=52.8;x&lt;=54;x=x+0.15){ for(y=12.6;y&lt;=19;y=y+0.25) { var point = { lat: x, lng: y}; if (google.maps.geometry.poly.containsLocation(point, pole1)) { if (google.maps.geometry.poly.containsLocation(point, pole2)){ var marker = new google.maps.Marker({ position: new google.maps.LatLng(x, y), map: map }); countmarkers++; } } } } //if you comment…
has comment: http://stackoverflow.com/comment/45541874
tagged with: google-maps
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45541800
upvote count: 0
has comment: http://stackoverflow.com/comment/45588761
has comment: http://stackoverflow.com/comment/45542188
tagged with: javascript
favorite count: 0
tagged with: google-maps-api-3
has title: containsLocation cooperation with loop & common fields
type: Question
has answer: http://stackoverflow.com/a/28619914
has comment: http://stackoverflow.com/comment/45542325
has comment: http://stackoverflow.com/comment/45542685
score: -1
answer count: 1
downvote count: 1

http://stackoverflow.com/comment/45557616
type: Comment
has text: It is a bit unclear to me what you want to do there. If you want to create different objects with the same constructor, you can pass all the values (e.g. table, module_name) as parameters. Or you can create new constructors which inherit from Delegate and change their prototypes.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28628115

http://stackoverflow.com/q/28594631
has comment: http://stackoverflow.com/comment/45507155
downvote count: 0
answer count: 0
score: 1
has body: I used ajax for the search function. However, it failed to search unicode characters. Here is the code causing a problem success: function(data){ var url = base_url + "/?s=ryhmät"; location.href=url; } The url passed correctly, but location.href has the value of encoded characters. like base_url/?s=ryhm%E4t I tried to use decodeURI/encodeURI functions, seems not working. I would appreciate if anyone could suggest me a solution.
has title: windows.location not working with UTF characters
type: Question
has comment: http://stackoverflow.com/comment/45539539
tagged with: javascript
tagged with: decodeuricomponent
has comment: http://stackoverflow.com/comment/45496101
has comment: http://stackoverflow.com/comment/65990026
upvote count: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/45507486
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45506972
tagged with: utf-8
has comment: http://stackoverflow.com/comment/45496513

http://stackoverflow.com/comment/45498399
score: 0
has text: @AkosBannerth "If I do not float the menu, it's proportions change drastically in IE8." - sounds like there is something that's not working properly to me
comment on: http://stackoverflow.com/q/28594143
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28656379
has body: You can simply use Array.prototype.join here. It would be more efficient than reduce for this case. console.log(['x','y','z'].join("")); // xyz But if you want to use _.reduce, you can do it like this _.reduce(['x', 'y', 'z'], function(accumulator, currentItem) { return accumulator + currentItem; }); // xyz _.reduce is just a wrapper over the native Array.prototype.reduce in environments which support it. You can understand how reduce would handle the input, from this answer, in detail. Here is a short explanation. Since there is no initial value passed to _.reduce, the first value in collection will be used as the accumulator value and the function is called with accumulator value and the second value. So, the function is called like this accumulator : 'x' currentItem : 'y' ----------------- accumulator : 'xy' (because returned value will be passed again as accumulator) and in the next call, accumulator : 'xy' currentItem : 'z' ----------------- accumulator : 'xyz' (since no elements left, accumulator will be returned)
downvote count: 0
has comment: http://stackoverflow.com/comment/45609190
score: 6
type: Answer
upvote count: 6
has comment: http://stackoverflow.com/comment/45609169
answers question: http://stackoverflow.com/q/28656366

http://stackoverflow.com/q/28626307
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45554167
has body: I have a list of items, and need dynamically search that list by text, like: I click the list and it opens, I can start typing the name of the item and the list will adjust the results. items = [ {"id":1,"name":"AAA"}, {"id":2,"name":"BBB"}, {"id":3,"name":"CCC"}, {"id":4,"name":"DDD"} ] So in that case starting typing "a" will show only the first row. How can I achieve that? I tried to add an input type - text as a first row, but it did not help for me. Here is my select &lt;select type="text" ng-model="item" ng-options="item as item.name for item in items&gt;&lt;/select&gt; I have also so methods and filter added, but it is not relevant for the problem.
has comment: http://stackoverflow.com/comment/45555295
type: Question
score: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28631176
has title: angular search by typing by select ng-option
has comment: http://stackoverflow.com/comment/45553786

http://stackoverflow.com/comment/45726676
type: Comment
type: QuestionComment
has text: Your code looks fine, apart from using strings instead of the variable names when pushing the new item to the array. What exactly are you trying to improve?
score: 0
comment on: http://stackoverflow.com/q/28719797

http://stackoverflow.com/comment/45555227
has text: possibly you need [input event](https://developer.mozilla.org/en-US/docs/Web/Events/input)
score: 0
comment on: http://stackoverflow.com/q/28627351
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45724596
type: AnswerComment
has text: @Lock yeah, pass the data in as an optional param :)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28718830

http://stackoverflow.com/comment/45627910
has text: A related / duplicate question http://stackoverflow.com/questions/27496052/jsp-variable-as-javasript-function-parameters?rq=1 (it is not exact because of a different context though!) - with a barely passable / adaptable solution. Ideally there would be a "somewhat elegant" way to do this.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28666534
score: 0

http://stackoverflow.com/a/28629208
has comment: http://stackoverflow.com/comment/45558714
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45558607
has body: Based on @Bergi's answer, I wrote this function: function nodeLift(fn){ return function(){ var args = Array.prototype.slice.call(arguments, 0, fn.length - 1), lifted = nodefn.lift(fn); return lifted.apply(null, args); }; }
answers question: http://stackoverflow.com/q/28628627

http://stackoverflow.com/a/28653767
has body: you must use the attribute name of the html tag input to get the value of the input on your servlet
has comment: http://stackoverflow.com/comment/45619440
answers question: http://stackoverflow.com/q/28653378
type: Answer
has comment: http://stackoverflow.com/comment/45665874
has comment: http://stackoverflow.com/comment/45604499
score: 0

http://stackoverflow.com/q/28671993
has body: I want to use the filtertoolbar, but with a server that accept different filter parameters. I'm trying to find the filter parameters in order to manipulate the postData. on beforeSearch, I'm trying to extract the filter using: var postData = $("#jqGrid").jqGrid('getGridParam','postData'); alert(postData.filters); The postData.filter returns undefined all the the time. Once more thing to note is that the server don't have in it's json request scheme any "filters" notion, so the json request is populated by me. Here is the functions: $(document).ready(function () { var pageOffset = (sessionPage - 1) * pageLength; var totalList = 0; var pageNumber = 0; var totalPages = 0; $("#jqGrid").jqGrid({ url: 'https://vlnx277:7000/vmgr/vapi/rest/sessions/list', mtype: "POST", postData: sessionListData(pageOffset), datatype: "json", onPaging: function(pgButton) { var requestedPage = $(".ui-pg-input").val(); if (pgButton == "user") { // find out the requested and last page var lastPage = $("#jqGrid").getGridParam("lastpage"); // if the requested page is higher than the last page value if (requestedPage &gt; lastPage) { // set the requested page to the last page value - then reload $("#jqGrid").setGridParam({page:lastPage}); sessionPage = lastPage; } else { sessionPage = $(".ui-pg-input").val(); } } else if (pgButton == "next_jqGridPager") { sessionPage = +$(".ui-pg-input").val() + +1; } else if (pgButton == "prev_jqGridPager") { sessionPage = $(".ui-pg-input").val() - 1; } else if (pgButton == "last_jqGridPager") { sessionPage = $("#jqGrid").getGridParam("lastpage"); } else if (pgButton == "first_jqGridPager") { sessionPage = 1; } else if (pgButton == "records"){ sessionPage = 1; pageLength = $(".ui-pg-selbox", this.p.pager).val(); } pageOffset = (sessionPage - 1) * pageLength; sessionList(pageOffset); }, onSortCol: function (index, iCol, sortorder){ //alert (index + " " + sortorder); var field_name = "id"; var sort_direction = "ASCENDING"; var sortDirectionFields = []; //In case n…
accepted answer: http://stackoverflow.com/a/28677569
possible better answer: http://stackoverflow.com/a/28672614
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
tagged with: jqgrid
has title: jqGrid postData.filter returns undefined
type: Question
has answer: http://stackoverflow.com/a/28677569
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28672614

http://stackoverflow.com/comment/45727465
has text: i don't understand your code. In HTML you put all .html files and then you append .php with that href why ?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28720310
score: 0

http://stackoverflow.com/a/28685556
downvote count: 0
has comment: http://stackoverflow.com/comment/45665731
answers question: http://stackoverflow.com/q/28685388
score: 6
type: Answer
upvote count: 6
has body: As said in comments, the easiest solution I can think is to make a list of free coordinates and then just choose randomly from them. And you can calculate free coordinates only if needed(when you need to add an apple).
accepted answer of: http://stackoverflow.com/q/28685388
has comment: http://stackoverflow.com/comment/45664329
type: AcceptedAnswer

http://stackoverflow.com/q/28749776
tagged with: busboy
linked to: http://stackoverflow.com/q/12906694
tagged with: crc32
has body: I'm writing a node.js server where I accept a file along with a CRC32 checksum in a multipart request. I am using busboy and crc node modules to handle multipart requests and CRC operations in node. In the busboy's finish event, I am attempting to calculate the CRC32 checksum of the saved file and validating it against the received checksum. My problem is that in the finish event, the checksum is always calculated as 0. If I manually run the CRC32 checksum against the same file, the checksum gets calculated properly. Here's the code snippet I use to handle the multipart request with crc32 calculation: var busboy = new Busboy({ headers : request.headers}); var saveTo; var crc32; busboy.on('file', function (fieldname, file, filename, encoding, mimetype) { saveTo = path.join('files', '/', filename); file.pipe(fs.createWriteStream(saveTo)); }); busboy.on('field', function(fieldname, val, fieldnameTruncated, valTruncated) { if(fieldname == 'checksum') { crc32 = val; } }); busboy.on('finish', function() { var savedFileCrc32 = crc.crc32(fs.readFileSync(saveTo)).toString(16); console.log("CRC32 of saved file: " + savedFileCrc32 + " file: " + saveTo); }); request.pipe(busboy); My console always prints CRC32 of saved file: 0 file: files/image.jpg However, if I run a node program to calculate the CRC32 checksum of the file that was just created, it works perfectly and prints the checksum. The image is also getting saved properly. In the finish event, if I open a read stream onsaveTo and read out the bytes, the image is getting read, so the file already exists. Any idea what the problem could be?
tagged with: node.js
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28750013
has comment: http://stackoverflow.com/comment/45782310
has comment: http://stackoverflow.com/comment/45782762
tagged with: javascript
has title: CRC32 checksum is not getting calculated in node.js
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/28750013

http://stackoverflow.com/comment/45594472
has text: Totally did the trick. I was declaring globalForm as a simple array. Changing its definition to {} worked like a charm. Thanks!
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28648383

http://stackoverflow.com/q/28713028
tagged with: jquery
linked to: http://stackoverflow.com/q/1566595
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28719875
type: Question
has comment: http://stackoverflow.com/comment/45714000
tagged with: javascript
has comment: http://stackoverflow.com/comment/45714174
has comment: http://stackoverflow.com/comment/45714160
has title: jQuery conflict using magnific popup gallery
has comment: http://stackoverflow.com/comment/45714102
score: 0
has comment: http://stackoverflow.com/comment/45714700
has comment: http://stackoverflow.com/comment/45714266
has body: I am using two versions of jQuery on the same page. Here they are: jQuery 1.4.2 is required for scrolling horizontally on website. jQuery 1.9.1 is required for magnific popup gallery. Here is the javascript code for magnific popup: Withe the all code above the horizontal scroll works but not the magnific popup. How can I fix this?
answer count: 1

http://stackoverflow.com/comment/45668409
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28687940
has text: what does "console.log(data);" print??

http://stackoverflow.com/a/28650296
answers question: http://stackoverflow.com/q/28642510
type: Answer
score: 2
upvote count: 2
has body: data-role="none" is working http://jsfiddle.net/jEADR/1033/ Alabama Amalapuram Anakapalli Akkayapalem Wyoming
downvote count: 0

http://stackoverflow.com/comment/45702284
comment on: http://stackoverflow.com/q/28706153
score: 0
has text: @PaulRoub - which one should I go for then minified or full version?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28664823
type: AnsweredQuestion
has body: How can you created an event emitter that is only triggered once and self-destructs after that. An equivalent to jQuery's .one() function?
has answer: http://stackoverflow.com/a/28664929
score: 3
downvote count: 1
type: Question
upvote count: 4
has comment: http://stackoverflow.com/comment/45624533
has comment: http://stackoverflow.com/comment/45687708
tagged with: javascript
has comment: http://stackoverflow.com/comment/45624863
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28664929
answer count: 1
has comment: http://stackoverflow.com/comment/45624573
has comment: http://stackoverflow.com/comment/45624668
favorite count: 0
has title: What's is the equivalent of to jQuery .one() in AngularJS?
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45624649
has comment: http://stackoverflow.com/comment/45695054

http://stackoverflow.com/q/28699773
has body: Hey guys am really a noob in php...I just want to make a redirect after the session ends..So i have came to know that without js this cant be implemented..So i have modified the code with the help of my friends &lt;html&gt; &lt;body&gt; &lt;?php session_start(); $_SESSION['logintime'] = time(); echo 'this page needs to be redirected in a minute' ?&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"&gt; $(function(){ var loginTime = &lt;?php echo $_SESSION['logintime']; ?&gt; var testSession = setInterval(function(){ var currentTime = Date.now() * 1000; if((currentTime - loginTime) &gt; 60) { //here 60 denotes a minute &lt;?php session_start(); session_unset(); unset($_SESSION); session_destroy(); ?&gt; window.location.href = 'www.google.com'; // redirecting process } }, 1000); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; The code runs without errors ..but it isnt redirecting after 60 seconds.. Any guides to make this code work correct would be really appreciated..Thanx
favorite count: 0
has comment: http://stackoverflow.com/comment/45690021
has title: Redirect after the session finishes in php
tagged with: php
accepted answer: http://stackoverflow.com/a/28700055
has comment: http://stackoverflow.com/comment/45689918
has comment: http://stackoverflow.com/comment/45689892
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45689774
linked to: http://stackoverflow.com/q/15537874
downvote count: 1
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45691988
upvote count: 0
has comment: http://stackoverflow.com/comment/45689686
tagged with: javascript
tagged with: jquery
score: -1
possible better answer: http://stackoverflow.com/a/28700156
has answer: http://stackoverflow.com/a/28700055
has answer: http://stackoverflow.com/a/28700156
has comment: http://stackoverflow.com/comment/45690184

http://stackoverflow.com/a/28738193
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
upvote count: 2
has body: In your example addressData is an array in the global scope, not a property of the jquery element $(this). Try this: $('#addressName').html(addressData[value].addressName); $('#addressStreet').html(addressData[value].addressStreet); $('#addressCity').html(addressData[value].addressCity); $('#addressCountry').html(addressData[value].addressCountry);
accepted answer of: http://stackoverflow.com/q/28738102
has comment: http://stackoverflow.com/comment/45760336
answers question: http://stackoverflow.com/q/28738102

http://stackoverflow.com/comment/45793439
type: Comment
comment on: http://stackoverflow.com/a/28755597
score: 0
type: AnswerComment
has text: Ugh! Seems like there's still a race condition here. Maybe 1 out of 10 tries, I get the stack exceeded message.

http://stackoverflow.com/q/28666532
type: Question
score: 20
answer count: 1
has answer: http://stackoverflow.com/a/45598327
has comment: http://stackoverflow.com/comment/45970007
tagged with: javascript
has comment: http://stackoverflow.com/comment/45655776
has comment: http://stackoverflow.com/comment/53607630
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/45659434
has comment: http://stackoverflow.com/comment/45662168
tagged with: http://stackoverflow.com/tag/html
tagged with: web-audio-api
favorite count: 0
upvote count: 20
downvote count: 0
tagged with: html5-audio
type: UnansweredQuestion
has title: Chrome Extension tabCapture API Audio Stream to Play in HTML Page
has body: I am creating a chrome extension which captures audio from a tab using the chrome tabCapture API. I would like to play this audio stream in another html page in hopes of eventually creating a visualizer for it. I capture the audio in a background script like so chrome.browserAction.onClicked.addListener(function(activeTab) { var constraints = { audio: true, video: false, }; var visualizerPage = chrome.extension.getURL("/views/visualizer.html"); chrome.tabCapture.capture(constraints, function(stream) { console.log("\ngot stream"); console.log(stream); chrome.tabs.create({ url: visualizerPage }, function(tab) { chrome.tabs.sendMessage(tabID, { "message": "stream", "stream": stream }); }); }); the audio stream is captured from whatever page the extension was clicked on. Another tab is opened, and the audio stream is sent to it as a message. The javascript for the visualizer.html page is function loadStream(stream) { // what do I have to put here to play the stream? } chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { if (request.message === "stream") { var stream = request.stream; if (!stream) { console.log("stream is null"); return; } console.log(stream); loadStream(stream); } else if (request.message === "statusChanged") { console.log("statusChanged"); } }); What I have so far is to load the audio stream into the web audio api using an audio context var context = new AudioContext(); var source = context.createMediaStreamSource(stream); but the script just hangs when trying to create the source. The problem is I am not really sure what type the stream is (tabCapture api says its a LocalMediaStream). How can I get the page to play the audio stream?

http://stackoverflow.com/a/28624098
has body: From Bower's api documentation, there doesn't seem to be anything to say "Install just the dist folder". As you are using Grunt already, you could probably create a task to run after your bower install using grunt-contrib-clean to remove unwanted files and folders from the bower_components folder. Something like this should remove everything from the bower_components folder except dist folders: clean : { dist : ['bower_components/*/*', '!bower_components/*/dist'] } While looking into this I also found grunt-bower-task which seems to do exactly that. The only drawback I see to this method is that you have to create the bower.json by hand first and then run the grunt task.
downvote count: 0
type: Answer
upvote count: 6
answers question: http://stackoverflow.com/q/28619210
score: 6
has comment: http://stackoverflow.com/comment/63800742

http://stackoverflow.com/a/46659404
score: 18
has body: Every id must be converted to integer. Example var Malfunctions = parseInt(document.getElementById("Malfunctions").value); then your ready to go
has comment: http://stackoverflow.com/comment/118466912
answers question: http://stackoverflow.com/q/28695617
type: Answer
upvote count: 20
has comment: http://stackoverflow.com/comment/104929423
downvote count: 2

http://stackoverflow.com/q/28612231
has answer: http://stackoverflow.com/a/28614288
upvote count: 1
type: Question
tagged with: href
answer count: 2
tagged with: hyperlink
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28614059
has comment: http://stackoverflow.com/comment/45536184
has title: to (reach) unhide a particular div using 'href' from other page
linked to: http://stackoverflow.com/q/9652944
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45531137
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45530290
type: UnansweredQuestion
has body: There is a pageA with 3 div(consider). also i'm having a link in another page. when users clicks the link they have to reach the 3rd div in pageA. How to do this? Demo HTML:(PageA.html) A B C aaaa bbbb cccc page B.html: vvv// this link will be in other page(to reach C) // what i have to give in herf="" to reach that particular div JQuery: $(function() { $('#link li').removeClass('actif'); $(this).find('li').addClass('actif'); $('.tab').hide(); $('#a').show(); document.getElementById('a1').className='active'; $('#link li').click(function(e){ $('#link li').removeClass('actif'); $(this).find('li').addClass('actif'); $('.tab').hide(); $('#'+$(this).attr('data-related')).show(); e.preventDefault(); }); }); In my code all div are hidden except the one which is selected at that time. so there is no need for scrolling. Need help.

http://stackoverflow.com/q/28727148
has comment: http://stackoverflow.com/comment/45741155
has title: Appending javascript value to gridview hyperlink. Any ideas why my code doesn't work?
has comment: http://stackoverflow.com/comment/45748164
has comment: http://stackoverflow.com/comment/45747040
has body: We have a javascript that takes start date and end date, calculates the difference between them and stores the value in a variable called hourDiff. Here is relevant part of the js. To avoid a scope issue, a gobal variable called hourDiff is defined at top of the javascript outside any function" var hourDiff = 0; //Calulate the time difference and store the value in hourDiff hourDiff = endDate - startDate; The idea is to eventually appendd hourDiff to the gridview hyperlink control below and pass the name-value pairs as querystring to another page called Reseve.aspx <asp:HyperLink ID="siteId" class="js_siteid" style="color:#111" runat="server" navigateurl='<%# String.Format("Reserve.aspx?id={0}&groupsize={1}&facilityFees={2}&extrahour={3}&depoitAmt={4}&cancelAmt={5}&keydeptAmt={6}", Eval("siteId"), Eval("capacity"),Eval("RentalFeeAmount"),Eval("ExtraHourAmount"),Eval("DepositAmount"),Eval("CancellationAmount"),Eval("KeyDepositAmount")) %>' Text='Select' /> Since the hyperlink is not exposed to the javascript until after search button is clicked, I have another javascript below that is used to apend hourdiff to the hyperlink and passed to another page. This javascript is placed at the bottom of the html page: Each time I compile my code and clic the Select link, hourDiff always displays the value of 0 rather than the difference between start date and end date. Any ideas what I am doing wrong? Protected Sub ValidateDuration(ByVal sender As Object, ByVal args As ServerValidateEventArgs) Dim validator As Control = DirectCast(sender, Control) Dim row As Control = validator.NamingContainer Dim startHour As Integer = Integer.Parse(DirectCast(row.FindControl("startHour"), DropDownList).SelectedValue) Dim startMinutes As Integer = Integer.Parse(DirectCast(row.FindControl("startMinutes"), DropDownList).SelectedValue) Dim startAmPm As String = DirectCast(row.FindControl("startAmPm"), DropDownList).SelectedValue Select Case startAmPm Case "AM" If startHour = 12 Then startHour = …
type: AnsweredQuestion
tagged with: gridview
has answer: http://stackoverflow.com/a/28731064
type: Question
has comment: http://stackoverflow.com/comment/45747626
accepted answer: http://stackoverflow.com/a/28731064
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
tagged with: asp.net

http://stackoverflow.com/a/28692612
answers question: http://stackoverflow.com/q/28691591
has body: Name work payment Jill Smith 50 Eve Jackson 94 John Doe 80 Jill Smith 50 Eve Jackson 94 John Doe 80 Jill Smith 50 Eve Jackson 94 John Doe 80 Jill Smith 50 Eve Jackson 94 John Doe 80 Jill Smith 50 Eve Jackson 94 John Doe 80 I think what you wanted to do is above html code. If you are using table,th element(elements you want to show as header) should be inside thead and everything others inside tbody element. And to select th element of table, below is the code: $('.tblinfo thead tr th').addClass('tablehead');
type: Answer
score: 0

http://stackoverflow.com/q/28601736
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45549173
has title: Calling function in parent from iframe, about iframe resize function
answer count: 0
has comment: http://stackoverflow.com/comment/45510101
type: UnansweredQuestion
tagged with: iframe
has comment: http://stackoverflow.com/comment/45627751
tagged with: php
has comment: http://stackoverflow.com/comment/45510459
has body: Let's have fun with resizing an iframe from within the iframe! So I have an html page which has some code that resizes an iframe when it loads. The javascript is in the head portion, and it looks like this: +++ And the code for the iframe looks like this: +++ The code on the inside of the iframe is all php, and there is a function within that php code that resizes a textarea box (form). That code looks like this: print " "; +++ So then, this snippit of javascript is called by the following function within the textarea like this: Write a comment... +++ So...within the onKeyUp event handler, when a user adds comments that exceed 1 row, the textarea resizes! Yay: fun times! BUT - the iframe eats the rest of the displayed content that was showing when the iframe loaded. Ahhh, bummer man! :( +++ So I added the following code to the end of onKeyUp, it looks like this: parent.resizeIframe(id) +++ But, it didn't work. I tried every combination I could think of, but I'm not as intelligent as the wizards hereinuponStackOverflow... How? Do? I? make the iframe resize when the textarea resizes from user input? Many thanks and much karmic blessings upon you in advance! (This is for the site: sitempty.org)
type: Question
has comment: http://stackoverflow.com/comment/45628572
tagged with: javascript
tagged with: resize
has comment: http://stackoverflow.com/comment/45509909
has comment: http://stackoverflow.com/comment/45510416
score: 0
has comment: http://stackoverflow.com/comment/45508983

http://stackoverflow.com/comment/45627266
has text: This is probably it, right? with the PHP file local there is no middle man to actually provide the data. Sorry, I am a beginner with this. Do I need to run a webserver to be able to develop this or is there another way to do it locally?
score: 0
comment on: http://stackoverflow.com/q/28665335
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28644413
has comment: http://stackoverflow.com/comment/45586857
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/28644452
tagged with: javascript
has title: javascript events, onfocus
has body: Now I'm changing default behavior of onfocus(onclick etc) events like this: &lt;div onfocus="my(this);"&gt; &lt;/div&gt; function my(e){ e.style.backgroundColor = "red";//here we do not use getElementById } This works good until I need to attach events from javascript. Of course we can use addEventListener("focus", my) but in this case we do not send this value and I need to find to by getElementById, but this is not good for me. How can I solve this problem? Thanks
score: 0
has comment: http://stackoverflow.com/comment/45586884
answer count: 3
tagged with: events
possible better answer: http://stackoverflow.com/a/28644491
has comment: http://stackoverflow.com/comment/45587098
has answer: http://stackoverflow.com/a/28644491
has comment: http://stackoverflow.com/comment/45586991
has answer: http://stackoverflow.com/a/28644530
has comment: http://stackoverflow.com/comment/45586852
has comment: http://stackoverflow.com/comment/45586916
has answer: http://stackoverflow.com/a/28644452

http://stackoverflow.com/comment/45511761
type: QuestionComment
comment on: http://stackoverflow.com/q/28603292
score: 1
has text: Tryed many things but failed, the code doesn;t work
type: Comment

http://stackoverflow.com/a/28645952
has comment: http://stackoverflow.com/comment/45589899
has body: http://jsfiddle.net/fswe4azh/2/ Something like this? $(document).ready(function(){ $('.pictures').first().addClass('current').css({left: 0}); $('.panels &gt; .caption').html($('.pictures').first().find("img")[0].src); $('#next').click(function(){ var old = $('.current').removeClass('current'); if ( old.is(':last-child')) { old.animate({left: "-100%"}); $('.pictures').first().css({left: "100%"}).addClass('current').animate({left: 0}); $('.panels &gt; .caption').html($('.pictures').first().find("img")[0].src); }else{ old.animate({left: "-100%"}); old.next().css({left: "100%"}).addClass('current').animate({left: 0}); $('.panels &gt; .caption').html(old.next().find("img")[0].src); } }); $('#previous').click(function(){ var old = $('.current').removeClass('current'); if ( old.is(':first-child')) { old.animate({left: "100%"}); $('.pictures').last().css({left: "-100%"}).addClass('current').animate({left: 0}); $('.panels &gt; .caption').html($('.pictures').last().find("img")[0].src); }else{ old.animate({left: "100%"}); old.prev().css({left: "-100%"}).addClass('current').animate({left: 0}); $('.panels &gt; .caption').html(old.prev().find("img")[0].src); } }); }); .panels { position: absolute; } #panel8 { width: 360px; height: 180px; } .panels &gt; .caption{ margin-top: -28px; position: absolute; padding: 4px 20px 4px 20px; background-color: rgba(255, 255, 255, 0.6); } .pictures { width: 100%; height: 100%; position: absolute; left: 100%; } .slider { width: 100%; height: 100%; position: relative; overflow: hidden; } .nav { width: 100%; height: 20px; color: #000; font-family: Monospace; font-size: 9px; text-align: right; line-height: 20px; position: absolute; bottom: 0; } #previous { vertical-align: middle; display: inline-block; line-height: normal; } #next { vertical-align: middle; display: inline-block; line-height: normal; } span { vertical-align: middle; display: inline-block; line-height: normal; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery…
score: 1
has comment: http://stackoverflow.com/comment/45589754
has comment: http://stackoverflow.com/comment/45589736
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28645848
has comment: http://stackoverflow.com/comment/45589993
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28645848
upvote count: 1

gridview
tags question: http://stackoverflow.com/q/28699887
tags question: http://stackoverflow.com/q/28622806
tag name: gridview
tags question: http://stackoverflow.com/q/28724960
type: Tag
tags question: http://stackoverflow.com/q/28688115
tags question: http://stackoverflow.com/q/28636309
tags question: http://stackoverflow.com/q/28727148
tags question: http://stackoverflow.com/q/28629999

http://stackoverflow.com/comment/45603603
type: Comment
has text: Sorry for making you pop pills! This is insanely useful, far more than I had hoped for. Thanks for actually coding it in your example. Combining alexcavalli's answer with yours is exactly what I need to move forward with my little project. Your code actually has a few pieces I'll need to spend time researching. I got a little lost but that's due to my junior learnings. Thank you so much!!!
type: AnswerComment
comment on: http://stackoverflow.com/a/28643927
score: 0

http://stackoverflow.com/q/28671967
answer count: 1
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28672320
has body: For fetching labels i used get request 'https://www.googleapis.com/gmail/v1/users/UserId/labels'. However, I am unable to fetch mails for specific labels. I want to fetch particular labels mails (such as Inbox, Sent-mails) using the Google mail REST API.
type: AnsweredQuestion
has title: Google REST API : Unable to fetch mails for a particular label
tagged with: google-api
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28672320
score: -1
upvote count: 0

http://stackoverflow.com/a/28641156
answers question: http://stackoverflow.com/q/28641052
type: AcceptedAnswer
has body: In the addbid function, you call updatebid() and then process date time info and put it into the bidtime array. When updatebid() runs for the first time, bidtime[0] has not yet been created and assigned.
accepted answer of: http://stackoverflow.com/q/28641052
type: Answer
has comment: http://stackoverflow.com/comment/45582017
score: 0

http://stackoverflow.com/comment/45516502
type: Comment
comment on: http://stackoverflow.com/a/28605909
has text: Agreed, but the attribute `TarifNameRus` does not exist in the JSON OP provided. I was referring to the first statement within the `each` loop.
type: AnswerComment
score: 0

blocking
tags question: http://stackoverflow.com/q/28594502
tags question: http://stackoverflow.com/q/28615178
type: Tag
tag name: blocking

http://stackoverflow.com/comment/45954945
comment on: http://stackoverflow.com/a/28824837
has text: To prevent file download from from triggering beforeunload event I've found this solution : http://stackoverflow.com/questions/14391531/distinguish-onbeforeunload-for-file-download-vs-page-change/26919572#26919572
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45651310
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28670105
has text: Alright =) Here we go: http://stackoverflow.com/questions/28679156/removing-fixed-classes-does-not-properly-remove-them-from-the-presetation
score: 0

http://stackoverflow.com/q/28750477
has answer: http://stackoverflow.com/a/28750515
type: Question
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
has body: I have a function within my project that loops through a team of people and adds them to an object: var trainingTeam = {}; ... $(data).find('trainingTeam&gt;member').each(function() { trainingTeam = {first: tFirst, last: tLast, ntid: tNTID, empID: tEmp, role: tRole}; } I am now trying to loop over that object and get specific values from it. $.each(trainingTeam, function(x, y) { alert('Team Member : ' y.first + ' ' + y.last) }); This returns undefined with both X and Y so I am obviously doing something wrong. Am I close? UPDATE Solved by changing the var to var trainingTeam = [] I then pushed the object to the array in the loop : trainingTeam.push({first: tFirst, last: tLast, ntid: tNTID, empID: tEmp, role: tRole});
type: UnansweredQuestion
has title: Loop through javascript object and get specific value from given key

http://stackoverflow.com/comment/45667571
has text: Just to pick a nit, the op was binding `value` to `this` which is what was causing the unexpected result. The scope for `this` had not changed. Using your generator function breaks the scope creating separate references for the `value`.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28687194
type: AnswerComment

http://stackoverflow.com/a/28727940
answers question: http://stackoverflow.com/q/28727562
score: 2
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28727562
has body: I believe you were messing with $scope.cache.put(myArray, $scope.myArray); this line of code in which myArray is undefined and code was throwing error instead of that give some key will solve your issue. $cacheFactory.put(key, value) method always stored value in key value format like dictionary &amp; then you can access those value giving its key to get method like $cacheFactory.get(key) CODE angular.module('cacheExampleApp', []). controller('CacheController', ['$scope', '$cacheFactory', function($scope, $cacheFactory) { $scope.myArray = [ "one", "two", "three" ]; $scope.keys = []; $scope.cache = $cacheFactory('cacheId'); $scope.put = function(key, value) { $scope.cache.put(key, value); $scope.keys.push(key); }; $scope.put("myArray", $scope.myArray); $scope.put("myArray1", $scope.myArray); $scope.put("myArray2", $scope.myArray); angular.forEach($scope.keys,function(value, index){ console.log(value + " is:"); console.log($scope.cache.get(value)); }); } ]); Working Plunkr Hope this could help you, Thanks.

http://stackoverflow.com/q/28638565
has title: MVC authentication kendoUI SPA
tagged with: requirejs
type: Question
has comment: http://stackoverflow.com/comment/45699440
has comment: http://stackoverflow.com/comment/45693536
tagged with: javascript
has body: I have a single page app built with KendoUI javascript framework from Telerik. The pages are loaded from a client router (samples and docs here) and javascript modules are added with RequireJS. I added some authentication mechanism based on the WIF Session Authentication Module (SAM) based on this article from Dominick Baier : http://leastprivilege.com/2012/02/09/replacing-asp-net-forms-authentication-with-wif-session-authentication-for-the-better/ It works very similar to the Forms authentication since I am just adding a authentication tag with a form url like this : &lt;authentication mode="None"&gt; &lt;forms loginUrl="~/#/Public/Accueil" timeout="90" slidingExpiration="true" requireSSL="true" /&gt; &lt;/authentication&gt; It works fine under a normal .NET MVC4 scenario, but doesn't quite work as well when in a SPA with javascript routing. The view is displayed when the user is not logged, but the corresponding script is not because nothing happens when I click on "Log in" button. Does anyone have a clue about what I should do to keep the sync between server and client whenever a redirection on the login page occurs on the server ? UPDATE : When you use a authentication tag and specify a form url, a 302 response is sent to the client every time a page that needs authorization is called without the auth cookie. The URL to wich the browser is redirected then is the one specified in the web.config under the authentication tag (like in my question it is "base_url/#/Public/Acceuil") and the url requested originaly requested is appended as parameter like this : "base_url/#/Public/Acceuil?RETURNURL=Private/Profile". The browser then make a GET request to this new url and gets a 200 with the login view. That works just fine. The problem is that the client methods are in a separate js file that is normally loaded via the client Kendo Router using RequireJS : router-config.js : define([ 'jquery', 'lib/pubsub' ], function ($, pubsub) { // Index var publicAccueil = { url: "/…
has comment: http://stackoverflow.com/comment/45683963
upvote count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45660101
tagged with: kendo-ui
has comment: http://stackoverflow.com/comment/45658484
tagged with: single-page-application
has comment: http://stackoverflow.com/comment/45699888
has comment: http://stackoverflow.com/comment/45683915
tagged with: asp.net-mvc-4
answer count: 0
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/45674795

http://stackoverflow.com/comment/45780697
type: QuestionComment
has text: @JonathanAMcCann yes and you can use it to format your string after each character input.
score: 0
comment on: http://stackoverflow.com/q/28749301
type: Comment

http://stackoverflow.com/q/28679271
has answer: http://stackoverflow.com/a/28679641
tagged with: stoppropagation
has comment: http://stackoverflow.com/comment/45651567
type: Question
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45651548
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45651633
accepted answer: http://stackoverflow.com/a/28679734
has comment: http://stackoverflow.com/comment/45651584
has comment: http://stackoverflow.com/comment/45651746
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45653254
has body: Is it possible to stop event propagation without preventing the default event behaviour? This should let the input increment/decrement when scrolled but stop it from bubbling to any other elements and scrolling the outer div. (The following is Chrome-only, I think) $("input[type=number]").on("mousewheel",function(e){ // only works with chrome I think e.stopPropagation(); console.log("scrolled"); }); div{ height:50px; overflow:auto; border: 1px solid black; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div&gt; &lt;input type='number'&gt; &lt;div class='filler'&gt;&lt;/div&gt; &lt;/div&gt; But the stopPropagation call seemingly does nothing. The outer div still scrolls. Now, this particular issue (scrolling a number input) can be solved by preventingDefault and manually incrementing and decrementing the input (JSFiddle). I'm looking for a general solution that doesn't involve re-creating the default behaviour.
tagged with: javascript
tagged with: jquery
tagged with: dom-events
has comment: http://stackoverflow.com/comment/45651716
possible better answer: http://stackoverflow.com/a/28679641
has title: stopPropagation without preventing default
has answer: http://stackoverflow.com/a/28679734

http://stackoverflow.com/comment/45569541
score: 0
type: QuestionComment
has text: Could also just be an issue of timing; adding a brief delay to destination.popover() in createPopover() would test if that's the case.
comment on: http://stackoverflow.com/q/28603496
type: Comment

http://stackoverflow.com/comment/45727457
type: AnswerComment
score: 0
has text: and when the pveapi DOES contain a semicolon somewhere? :p
type: Comment
comment on: http://stackoverflow.com/a/28719952

http://stackoverflow.com/q/28726360
type: Question
accepted answer: http://stackoverflow.com/a/28726543
duplicate of: http://stackoverflow.com/q/17651207
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28726487
has answer: http://stackoverflow.com/a/28726543
has title: Mask a input in HTML using javascript
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: masking
linked to: http://stackoverflow.com/q/17651207
favorite count: 0
has answer: http://stackoverflow.com/a/28726686
possible better answer: http://stackoverflow.com/a/28726487
type: AnsweredQuestion
score: 1
upvote count: 1
has body: How can I mask a HTML input text with a mask for phone number? Here in Brazil, in some states, the number format can change. For example: (dd)xxxx-xxxx this is the default number format, where dd is the state code, and the x's are the numbers. BUT, in some states, the number nine is added to the phone number, like this: (dd)9xxxx-xxxx. (let's call it "new format") the var dd isn't important, what I want to do is when the user type the new format, the hyphen automatically appears after the 4th X.

http://stackoverflow.com/a/28608406
accepted answer of: http://stackoverflow.com/q/28607423
answers question: http://stackoverflow.com/q/28607423
has body: Like this? &lt;a class="fancybox" caption="This is 1st title" href="http://fancyapps.com/fancybox/demo/1_b.jpg"&gt; &lt;img src="http://fancyapps.com/fancybox/demo/1_s.jpg" data-page="1" alt=""/&gt; &lt;/a&gt; beforeLoad: function () { console.log(this.element.find('img').data('page')); console.log(this.element.attr('caption')); // etc... } The element is already a jQuery object, so no need to pass it in to the jQuery function. Also, I suggest that you use either html5 data attributes or valid property names i.e. not "caption". http://jsfiddle.net/9GwUu/27/
upvote count: 2
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/comment/45568116
score: 0
type: AnswerComment
type: Comment
has text: Awsome. This solution works for Firefox so I will throw in an if condition when loading on firefox. Thanks
comment on: http://stackoverflow.com/a/28633515

http://stackoverflow.com/comment/45683388
comment on: http://stackoverflow.com/q/28696540
score: 0
has text: I already tried that that I mention above .....It did not worked for me...
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/92627656
score: 0
comment on: http://stackoverflow.com/a/28702898
has text: try this var a = new Blob([""],{type: "text/plain;charset=utf-16"});a,size
type: Comment
type: AnswerComment

http://stackoverflow.com/a/28643815
type: Answer
has body: $(window).one('click touchstart', function () { $( "#openModal" ).toggleClass("target"); });
answers question: http://stackoverflow.com/q/28635398
score: 0

universal-analytics
tags question: http://stackoverflow.com/q/28707784
tag name: universal-analytics
type: Tag
tags question: http://stackoverflow.com/q/28663696
tags question: http://stackoverflow.com/q/28685402

http://stackoverflow.com/q/28651913
has title: alignment of elements inside a caption
has body: Hi I have an image review system that has a slide down caption and a slide up caption on hovering over the image. Inside the top caption I've been trying to align a review widget to the left of the caption and a few share buttons to the right of the caption. I have the elements in the caption but can't seem to get them to align. Here's the fiddle: http://jsfiddle.net/dottsie/nj0mgwdr/ review system Caption Hover Effects Settings Jacob Cummings Take a look vote data Settings Jacob Cummings Take a look Settings Jacob Cummings Take a look Settings Jacob Cummings Take a look Settings Jacob Cummings Take a look Settings Jacob Cummings Take a look Settings Jacob Cummings Take a look Settings Jacob Cummings Take a look Settings Jacob Cummings Take a look Settings Jacob Cummings Take a look Settings Jacob Cummings Take a look
has comment: http://stackoverflow.com/comment/45602237
type: Question
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45602070
has comment: http://stackoverflow.com/comment/45601840
answer count: 0
type: UnansweredQuestion
tagged with: css

http://stackoverflow.com/comment/45619851
has text: `var formData = new FormData(document.getElementById('userfile'));` this should have the id of form... `var formData = new FormData(document.getElementById('Form'));`...Or you can also get rid of this statement by `data: new FormData(this)`
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28662056

http://stackoverflow.com/comment/45846515
has text: I updated my post because I"m still unsure on how to handle the above.
comment on: http://stackoverflow.com/q/28679534
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/28746358
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/45776779
accepted answer of: http://stackoverflow.com/q/28745024
has comment: http://stackoverflow.com/comment/45775865
has comment: http://stackoverflow.com/comment/45777333
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45775780
has body: You're making it more complicated than it needs to be. Rather than trying to do a deep clone (.clone(true)), just call the sortableInit() on the cloned item. JSFiddle Example $('.wrapper').on('click', '.add-button', function (e) { e.preventDefault(); e.stopPropagation(); var hidden = $(e.target).siblings('.hidden').clone().removeClass('hidden'); //Removed 'true' from clone hidden.insertBefore($(e.target)); sortableInit(hidden); //This added. });
answers question: http://stackoverflow.com/q/28745024

http://stackoverflow.com/q/28594833
has title: javascript or ajax to update database with asp.net mvc?
tagged with: ajax
has comment: http://stackoverflow.com/comment/45496548
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28595056
has answer: http://stackoverflow.com/a/40427319
has comment: http://stackoverflow.com/comment/45496425
has comment: http://stackoverflow.com/comment/45496511
type: Question
score: 0
possible better answer: http://stackoverflow.com/a/28595049
has answer: http://stackoverflow.com/a/28595056
has body: I have a function here from a change event on a dropdownlist. When the selection gets changed I want to update a row in my database. Should I use javascript or ajax. I don't want the page to be refreshed. I think it should be ajax, but not sure? If ajax, can anyone point me to a tutorial/video/etc? Here is where I want to update my db row. var statusdropdown = document.getElementById("enumstatus"); statusdropdown.addEventListener("change", function(event) { // call db and update row }, false);
has answer: http://stackoverflow.com/a/28595049
answer count: 4
has answer: http://stackoverflow.com/a/75295691
tagged with: asp.net-mvc
linked to: http://stackoverflow.com/q/16186083
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28717889
has comment: http://stackoverflow.com/comment/45724114
has comment: http://stackoverflow.com/comment/45723955
has comment: http://stackoverflow.com/comment/45723606
has body: Your data is a full html page right? I mean with &lt;html&gt; and &lt;head&gt; tags? If so you could try to find the body in the returned data and get it's html. Then fill your current body with the new html content of the received body. This is not a good method though because you are receiving too much data. To do this more efficient you have to make changes server side so only the required data is send back (ie only the html content from the body). ps: I did not tested this but it should work. $.ajax({ url: "{{path('myPathOne',{'status' : 'ONE'})}}", type: 'POST', cache: false, data: {'status': status}, }) .done(function(data) { newbody=$(data).find('body').html(); $('body').html(newbody); }) .fail(function() { console.log("error"); }) .always(function() { console.log("complete"); });
has comment: http://stackoverflow.com/comment/45723216
has comment: http://stackoverflow.com/comment/45723667
type: Answer
answers question: http://stackoverflow.com/q/28717473
downvote count: 1
upvote count: 0
has comment: http://stackoverflow.com/comment/45723306
score: -1
has comment: http://stackoverflow.com/comment/45723342

http://stackoverflow.com/q/28720897
answer count: 2
has comment: http://stackoverflow.com/comment/45728715
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28721041
tagged with: ajax
has title: Jquery: ajax loop
has body: I am trying to make a page which tells me on which page of youtube search results my video is ranked. I am using AJAX. I have this is in my php page <?php $search_term = "Search Term"; $page_link = "rbdSxr9Vvw0"; //this is the youtube video id $search_term = str_replace(" ","+",$search_term); $youtube_search = "http://www.youtube.com/results?search_query=".$search_term."&"; $i = $_POST['i']; if(strpos(file_get_contents($youtube_search."page=$i"),$page_link) == false){ echo "not found"; }else{ echo "found"; } ?> I need to write jquery function which will send numbers starting from 1 to the php page. It needs to show the current page it's checking and the result. It needs to stop when the result says "found". Thanks in advance. EDIT: I ended up using this code: In my html page: In my ajax page: <?php $search_term = "search term"; $page_link = "ZXsdlk0_HuQ"; //this is the youtube video id $search_term = str_replace(" ","+",$search_term); $youtube_search = "http://www.youtube.com/results?search_query=".$search_term."&"; $result = "false"; $i = $_GET['page']; if(strpos(file_get_contents($youtube_search."page=$i"),$page_link) == false){ echo "not found"; }else{ echo "found"; } ?>
tagged with: php
has answer: http://stackoverflow.com/a/28721050
has comment: http://stackoverflow.com/comment/45728635
accepted answer: http://stackoverflow.com/a/28721050
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28721041
type: Question
tagged with: javascript
score: 0

http://stackoverflow.com/comment/45606397
type: Comment
type: QuestionComment
has text: What error do you get? Use the network tab in inspect element to see what the HTTP request is sending/receiving, it'll aid in debugging
score: 1
comment on: http://stackoverflow.com/q/28654784

http://stackoverflow.com/a/28963220
answers question: http://stackoverflow.com/q/28692865
accepted answer of: http://stackoverflow.com/q/28692865
has body: Ok, I found the reason for this problem. I forgot to call this to initialize PGExternalScreen.setupScreenConnectionNotificationHandlers(success, fail); RTFM, I guess :-(
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/45576767
type: Comment
has text: you should just pass it in.
score: 0
comment on: http://stackoverflow.com/q/28638566
type: QuestionComment

http://stackoverflow.com/comment/45630921
score: 0
type: AnswerComment
type: Comment
has text: Keep in mind this will most likely only work for english formatted date.
comment on: http://stackoverflow.com/a/28668155

http://stackoverflow.com/comment/60773826
type: Comment
comment on: http://stackoverflow.com/a/28669318
has text: hey I have a problem calling sub function inside function code look like this function foo(){ this.sam = function(){ alert('helllo') } } in my controller I try calling it using this.foz = foo.sam; but it doesnt work
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45698655
comment on: http://stackoverflow.com/q/28704104
type: QuestionComment
has text: This is how `$.proxy` works, hope this jsFiddle would help you better understand it: http://jsfiddle.net/Ldtd5qeo/1/
score: 0
type: Comment

http://stackoverflow.com/a/28704348
answers question: http://stackoverflow.com/q/28683815
has body: Figured it out! In this particular instance, there was a hidden input that was measuring the time in the future to set the follow up in seconds. Element below. So I just needed to change the value of THAT input to the number of seconds in the future I wanted to set the follow up. &lt;input type="hidden" autocomplete="off" class="hiddenInput" name="time" value="40680"&gt;
score: 0
type: Answer

http://stackoverflow.com/q/28627387
has body: I am trying to allow the user to edit names in an MVC application. The controller function has this signature: [Route("function/edit/{id:int}/{name}/{sortorder:int}")] public ActionResult Edit(int id, string name, int sortorder) {...} I am calling it in Javascript like this: window.location.href = "@Url.Action("Edit", "Function")" + "/" + id + "/" + name + "/" + order; It all works fine, until the name contains '/' or the name ends with a '.' then i get a "The resource cannot be found." from the server. This makes perfect sense, since the '/' and '.' characters rightly confuses the routing... But how should i do this?? I want to allow '/' and '.' in the names.
downvote count: 0
type: Question
tagged with: c#
tagged with: asp.net-mvc
has title: Passing special characters to an MVC 5 controller with javascript parameters
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/28627445
answer count: 1
has comment: http://stackoverflow.com/comment/45555491
favorite count: 0
type: UnansweredQuestion
upvote count: 4

http://stackoverflow.com/comment/45717836
has text: Yes, I had omitted the checking. The question has been edited. The question is more about the strict equality `===`
type: AnswerComment
comment on: http://stackoverflow.com/a/28715096
type: Comment
score: 0

http://stackoverflow.com/a/29178203
has body: My solution was to have the page run the script source date.js again, just before the date formatting was needed. This script is now included twice in the page. I do not know why this was needed just on this one VM server... This placed a band-aid(r) on the problem, but did not solve it.
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/28705762
type: Answer
answers question: http://stackoverflow.com/q/28705762

http://stackoverflow.com/comment/45508885
type: Comment
has text: When should I do this? I first create the iframe with `createElement`, add the to DOM, set the on load method, and then the `src` attribute. If I do has you say immediately after creation (before DOM insertion), I get an exception that parentWindow of null is not defined. If I do it later, the iframe still generates output
type: AnswerComment
comment on: http://stackoverflow.com/a/28601606
score: 0

http://stackoverflow.com/comment/61951728
type: Comment
score: 0
has text: @Raptor and how exactly have you proposed this.
comment on: http://stackoverflow.com/a/32069013
type: AnswerComment

http://stackoverflow.com/q/28744535
type: AnsweredQuestion
has title: How to get jquery not Javascript hint for autocompletion in CodeMirror?
has body: I am working on online JS IDE using CodeMirror in php. in CodeMirror JavaScript autocompletion hint is available. I want to show Jquery hint on Javascript mode. It is possible in CodeMirror?
accepted answer: http://stackoverflow.com/a/28770202
favorite count: 0
upvote count: 1
answer count: 1
tagged with: codemirror
score: 0
has answer: http://stackoverflow.com/a/28770202
downvote count: 1
tagged with: javascript
tagged with: jquery
type: Question

http://stackoverflow.com/a/28602028
has comment: http://stackoverflow.com/comment/45509494
score: 0
answers question: http://stackoverflow.com/q/28601879
has body: My suggestion: window.location.href = window.location.href; I haven't tested it, but I think it will do what you want.
type: Answer
has comment: http://stackoverflow.com/comment/45509613
upvote count: 1
downvote count: 1

http://stackoverflow.com/comment/45677768
type: AnswerComment
score: 0
type: Comment
has text: This is the working version, for reference: http://jsfiddle.net/zaphod013/mg3xcx5h
comment on: http://stackoverflow.com/a/28678162

http://stackoverflow.com/q/28605468
score: 0
has comment: http://stackoverflow.com/comment/45515706
has comment: http://stackoverflow.com/comment/45515913
has comment: http://stackoverflow.com/comment/45516225
has comment: http://stackoverflow.com/comment/45515892
has answer: http://stackoverflow.com/a/28606491
accepted answer: http://stackoverflow.com/a/28606491
possible better answer: http://stackoverflow.com/a/28606337
tagged with: php
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28606337
has body: My code exist some things like "&lt; i585 >". I wan to get string from "i" to ">". And replace "585" instead of "&lt; i585 >". I write some code in JavaScript. &lt;script type="text/javascript"&gt; var foo ="M &lt;i585&gt; &lt;i646&gt;"; while (foo.indexOf("&lt;i") != -1) { var indexBaş = foo.indexOf("&lt;i"); var indexSon = foo.indexOf("&gt;", indexBaş); var id = foo.substring(indexBaş + 2, indexSon); foo = foo.substring(0 , indexBaş) + id + foo.substring(indexSon + 1 , foo.lenght); } document.write(foo); &lt;/script&gt; But I have to convert this code to php. So I write this code $foo ="M &lt;i585&gt; &lt;i646&gt;"; $start = 0; $kacTane= 0; for($i = 0 ; $i &lt; strlen($foo) ; $i++ ) { if($foo[$i] == "&lt;") { if(($foo + 1 )&lt; strlen($foo)) { if($foo[$i+1] == "i") { $kacTane++; } } } } for($i = 0; $i &lt; $kacTane; $i++) { $ilkIndex = strpos($foo , "&lt;" , $start); $sonindex = strpos($foo , "&gt;" , $ilkIndex); $id = substr($foo , $ilkIndex + 2 ,( $sonIndex -3) - $ilkIndex ); $first = substr($foo , 0 , $ilkIndex +2); $second = substr($foo , $sonIndex + 1 , strlen($foo) - $sonIndex - 1 ); $foo = "$first$id$second"; $start = ($sonindex + 1); } echo $foo; But it isn't work. Sorry for bad English.
has comment: http://stackoverflow.com/comment/45516070
type: Question
answer count: 2
has title: Convert code from JavaScript to PHP
tagged with: javascript

http://stackoverflow.com/q/28676859
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28677211
tagged with: javascript
score: 0
answer count: 3
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45647371
has answer: http://stackoverflow.com/a/28677201
tagged with: jquery
has body: :) So I'm trying to create a user questionaire type form, it doesnt have to send to anyone just display a div once certain radio buttons are checked and if them certain radio buttons arent checked then display a different div, but also when the webpage opens/refreshes none of the div's I want to display to be displayed (if that makes sense?). I found some code on here to try but it didnt work for me, I'm a noob with JS & Jquery but was hoping anyone could shed some light on my problem. please find my code below. Jquery? if($('input[value=yes1]:checked, input[value=yes2]:checked, input[value=yes3]:checked, input[value=yes4]:checked').length == 4){ $("#correct").show(); }else{ $("#correct").hide(); HTML Yes No Yes No Yes No Yes No CSS #correct{width:100%; height:50px; background:green; display:none;} #incorrect{width:100%; height:50px; background:red; display:none;}
accepted answer: http://stackoverflow.com/a/28677201
favorite count: 0
has answer: http://stackoverflow.com/a/28677211
has title: If certain radio buttons checked, display div else display different div?
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: Question
has answer: http://stackoverflow.com/a/28677313

http://stackoverflow.com/comment/45498786
type: Comment
score: 1
has text: you are missing the jQuery, the one you had before from google libraries
type: AnswerComment
comment on: http://stackoverflow.com/a/28595568

http://stackoverflow.com/comment/45541912
type: AnswerComment
comment on: http://stackoverflow.com/a/28619585
type: Comment
has text: I think they were just trying to point out that it is just an if statement in the right place which is the same across most languages with minor syntactic differences.
score: 0

http://stackoverflow.com/a/28641259
upvote count: 1
answers question: http://stackoverflow.com/q/28641161
accepted answer of: http://stackoverflow.com/q/28641161
score: 1
type: AcceptedAnswer
downvote count: 0
has body: I think you just need to put the float:right div first. Net99 Hello. Here's some text. You like it? Good. Here's some more text. Nice, right?
type: Answer

http://stackoverflow.com/comment/45651570
type: Comment
has text: Instead of dropping in code, an explanation would be beneficial for the OP as well as anyone else visiting the question.
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28679303

http://stackoverflow.com/comment/45667458
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28687565
has text: please have a look on to search box of amazon.in , it shows the select option content, the width of select is not fixed.

http://stackoverflow.com/q/28680911
tagged with: javascript
score: 0
has body: I want to tests the results returned by an asynchronous function with nodeunit. I have the following test : module.exports = { createFail: function(assert) { var user = new CRUDUser({ firstName: 'Node' }); assert.equal(undefined, user.id); user.create(function(res) { // user.create() makes an async AJAX call and should call this function back assert.equal(false, res.success); assert.equal(undefined, user.id); // user not created cause 'lastName' can't be null console.log('#####'); assert.done(); }); } }; But when I run it I get the following error : FAILURES: Undone tests (or their setups/teardowns): - createFail To fix this, make sure all tests call test.done() If I move the assert.done(); call outside the callback function, the test ends up before the AJAX call has been made. I also tried to add assert.expect(3); at the very beginning of the test to make it "wait" until the callback function calls assert.done(); but I get the same error as above. In all cases, the expected ##### isn't outputed to the console obviously. What am I doing wrong ??
answer count: 1
tagged with: asynchronous
has answer: http://stackoverflow.com/a/28683367
tagged with: node.js
type: AnsweredQuestion
tagged with: unit-testing
type: Question
tagged with: nodeunit
has title: NodeUnit - Testing an asynchronous function
accepted answer: http://stackoverflow.com/a/28683367

http://stackoverflow.com/a/28600876
score: 0
answers question: http://stackoverflow.com/q/28599961
type: Answer
has body: Try This You should use two-dimensional-array for this and it will be easy for you to future changes. It means if you have a new grade in future you jus have to add it with range and Grade Name like (a,b,c, ETC.) View DEMO function testScores() { try { var fullNameArray = { 0: [90, 100, 0,"A"], 1: [80, 89, 0,"B"], 2: [70, 79, 0,"C"], 3: [60, 69, 0,"D"], 4: [0, 59, 0,"F"] } var scores = ["65", "75", "99", "82", "77", "100", "75", "88", "100", "75"]; var len = numProps(fullNameArray); for (var i = 0; i &lt;= scores.length; i = i + 1) { for ( var k = 0; k &lt;= len; k++) { if (scores[i] &gt;= fullNameArray[k][0] &amp;&amp; scores[i] &lt;= fullNameArray[k][1]) { fullNameArray[k][2] = fullNameArray[k][2] + 1; } } } for (var D = 0; D &lt;= len; D++) { document.getElementById('diVID').innerHTML = document.getElementById('diVID').innerHTML+"&lt;br/&gt;"+fullNameArray[D][3] +" : "+ fullNameArray[D][2]; } } catch (err) { alert(err); } } function numProps(obj) { var c = 0; for (var key in obj) { if (obj.hasOwnProperty(key)) ++c; } return c-1; } &lt;input type="button" value="Click OK" onclick="testScores()" /&gt; &lt;div id="diVID"&gt;&lt;/div&gt; JSFIDDLE Here
has comment: http://stackoverflow.com/comment/45507438

http://stackoverflow.com/comment/45577682
type: Comment
comment on: http://stackoverflow.com/q/28636009
score: 0
has text: It looks fine, have you tried to generate those dates in different variable so it would be easier to find the mistake. Also in the error it says "sethours" (not capital H) in your code it says setHours, is there any other place in your code where you are using this function?
type: QuestionComment

http://stackoverflow.com/q/28699159
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/45688641
has body: I'm developing a Chrome extension to add convenience to a website. I have access to the page's DOM, but I also need to interact with the "first-party" JS on that page, which I cannot do from my extension. I can inject arbitrary tags into the page (most notably also &lt;script&gt; tags), but since escaping strings like { html: '&lt;div onclick="doSomething(this, \'someName\')"&gt;&lt;/div&gt;' } is a real pain, I'd like to keep the injected code at an absolute minimum. I tried injecting event listeners into the page in order to fetch JS variables from the page, but ran into a problem. It seems that if a CustomEvent is passed from an extension to a website or back, and if CustomEvent.detail contains certain types of objects (at least functions and errors) somewhere, the entire CustomEvent.detail will be purged, i.e. set to null. Example Script (extension.js): (function() { var script = document.createElement('script'); script.innerHTML = [ "window.addEventListener('xyz', function(ev)", " { ", " console.log('after dispatch:'); ", " console.log(ev.detail); ", " }); ", ].join('\n'); document.head.appendChild(script); // JSON-serializable data var e = new CustomEvent('xyz', { detail: { x: 42, name: 'Schroedinger' } }); console.log('before dispatch:') console.log(e.detail); window.dispatchEvent(e); // non-JSON-serializable data var detail = { x: 42, name: 'Schroedinger' }; detail.detail = detail; // Create circular reference e = new CustomEvent('xyz', { detail: detail }); console.log('before dispatch:') console.log(e.detail); window.dispatchEvent(e); // data with function e = new CustomEvent('xyz', { detail: { x: 42, name: 'Schroedinger', func: function(){} } }); console.log('before dispatch:'); console.log(e.detail); window.dispatchEvent(e); // data with error object e = new CustomEvent('xyz', { detail: { x: 42, name: 'Schroedinger', err: new Error() } }); console.log('before dispatch:'); console.log(e.detail); window.dispatchEvent(e); })(); Output (paragraphed for readab…
has answer: http://stackoverflow.com/a/30933516
has comment: http://stackoverflow.com/comment/54746523
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45691090
upvote count: 3
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/54741745
favorite count: 0
has title: CustomEvent.detail "tainted"?
has comment: http://stackoverflow.com/comment/45689185
accepted answer: http://stackoverflow.com/a/30933516
tagged with: custom-event

http://stackoverflow.com/a/28702740
type: Answer
upvote count: 1
has body: Understanding how this behaves is not trivial and very important. I'd recommend taking a look at http://javascriptissexy.com/understand-javascripts-this-with-clarity-and-master-it/ when calling a method like a regular function, this is bound to the global object, so o.inc doesn't change. You can try this as well: var foo = o.inc; foo(); console.log(o.value); // still 3
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28702597

http://stackoverflow.com/comment/45743569
type: Comment
comment on: http://stackoverflow.com/q/28728424
has text: you have to wait until it loads - that works fine...in essence I dont need the tooltip
score: 0
type: QuestionComment

http://stackoverflow.com/a/28624865
downvote count: 0
has body: User Admin Add tags.
score: 1
has comment: http://stackoverflow.com/comment/45551867
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28624791

http://stackoverflow.com/comment/45556428
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28627250
has text: This makes no sense. Deeper answer is that you really cannot. Once you've marked it as an angular application, angular internally attaches to various events and registers javascript functions.

http://stackoverflow.com/q/28747864
has comment: http://stackoverflow.com/comment/45778023
has answer: http://stackoverflow.com/a/28748589
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45778414
tagged with: dynamic
score: 0
tagged with: forms
type: Question
linked to: http://stackoverflow.com/q/6515502
accepted answer: http://stackoverflow.com/a/28748589
has body: My PHP file echoes results from a data query as a form-table so the user can edit the records. The table will contain up to 30 records. When the form is submitted, if the VoidTag checkbox is selected, I need the user to confirm this action, otherwise the form can submit without the confirm box. I have very little JavaScript experience and have no idea how to do it.
tagged with: javascript
has comment: http://stackoverflow.com/comment/45778043
has title: JavaScript confirm when a dynamic HTML field is selected within a form
tagged with: confirm
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/comment/45708951
score: 0
type: AnswerComment
has text: I think the readdirSync method would be the right answer, here. I'm really just providing a file list straight back to in the REST reply. However, would this limit the ability of Express to handle multiple simultaneous requests to that url?
type: Comment
comment on: http://stackoverflow.com/a/28709583

http://stackoverflow.com/a/28717581
answers question: http://stackoverflow.com/q/28717473
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28717473
has comment: http://stackoverflow.com/comment/45725154
has comment: http://stackoverflow.com/comment/45722610
has comment: http://stackoverflow.com/comment/45726779
type: Answer
has comment: http://stackoverflow.com/comment/45723167
has comment: http://stackoverflow.com/comment/45722780
has comment: http://stackoverflow.com/comment/45724691
has comment: http://stackoverflow.com/comment/45725289
has comment: http://stackoverflow.com/comment/45722466
downvote count: 1
has comment: http://stackoverflow.com/comment/45723193
has comment: http://stackoverflow.com/comment/45725054
has comment: http://stackoverflow.com/comment/45722551
upvote count: 0
has comment: http://stackoverflow.com/comment/45724522
has comment: http://stackoverflow.com/comment/45722945
has comment: http://stackoverflow.com/comment/45725690
score: -1
has body: To replace the body, you can do what you're currently doing, but to replace the entire html, you should do: $("html").html(data); Edit Another approach: $("body").html($(data).find("body").html()); $("head").html($(data).find("head").html()); Edit2 You can also use document.write(data) as that will replace the old document with new html if called after the page has loaded. Details here: https://developer.mozilla.org/en-US/docs/Web/API/Document/write

http://stackoverflow.com/comment/45767285
has text: @Hacketo because form might be submitted from keyboard, too?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28741941
type: QuestionComment

http://stackoverflow.com/a/28593765
downvote count: 0
has comment: http://stackoverflow.com/comment/45494792
has comment: http://stackoverflow.com/comment/45494283
score: 1
has comment: http://stackoverflow.com/comment/45494773
has comment: http://stackoverflow.com/comment/45494498
has comment: http://stackoverflow.com/comment/45494365
type: AcceptedAnswer
has body: Update your .htaccess file like so: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.*)$ index.php?url=$1 [L,QSA] This will redirect all relevant server calls to index.php?url=&lt;rest of the url&gt;. Now, rename your index.html to index.php (we need to write a little php code). In your JavaScript write: var url = "&lt;?php echo $_GET['url']; ?&gt;"; And there you have it. You can now split the string by '/' delimiter to find all your needed components. As per your example, the following url: abc.net/somesubsite/someother will redirect to index.php and the url variable will hold somesubsite/someother. You can then use url.split('/') to get all "subfolders" in an array. You will also have to override all links' behavior in your site: Prevent the normal action Load the ajax content pushState to change the url like so: $('a').on('click', function(e){ e.preventDefault(); // 1 var $url = this.href; loadContent($url); // 2 window.history.pushState("object or string", "Title", $url); // 3 });
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28593650
has comment: http://stackoverflow.com/comment/45494662
has comment: http://stackoverflow.com/comment/45494457
answers question: http://stackoverflow.com/q/28593650
type: Answer

http://stackoverflow.com/comment/45625069
type: QuestionComment
comment on: http://stackoverflow.com/q/28665160
score: 6
has text: `var newStr = '';` `undefined + 'qwe'` === `'undefinedqwe'`
type: Comment

http://stackoverflow.com/a/28642127
accepted answer of: http://stackoverflow.com/q/28641689
score: 0
has comment: http://stackoverflow.com/comment/45583602
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28641689
has comment: http://stackoverflow.com/comment/45583480
has comment: http://stackoverflow.com/comment/45583634
type: Answer
has comment: http://stackoverflow.com/comment/45583391
has body: Use date like this : &lt;?php $current_day = date('Ymd'); echo $current_day; ?&gt; You can find more options in http://php.net/manual/en/function.date.php

http://stackoverflow.com/q/28678842
tagged with: javascript
favorite count: 0
has body: I tried the below code that does not work. Also i searched via google but find nothing. Backbone's official documentation does not have an entry about loadUrl. app_router.on('route:page', function(id, name) { ... }); app_router.on('route:file', function(id, name) { // first open the page Backbone.history.loadUrl("page", function() { // and open the file manager after page is loaded }); });
has comment: http://stackoverflow.com/comment/45651057
answer count: 1
tagged with: backbone.js
has answer: http://stackoverflow.com/a/28679086
upvote count: 1
has title: How can i run a callback function after Backbone.history.loadUrl?
type: AnsweredQuestion
score: 1
type: Question
has comment: http://stackoverflow.com/comment/45650927
tagged with: backbone-routing
accepted answer: http://stackoverflow.com/a/28679086
downvote count: 0

http://stackoverflow.com/q/28705304
has body: Let's say I have a string (like a fraction); var num = "1/2"; Why does this work: var y = num.split(' '); if (y.length &gt; 1) { var z = y[1].split('/'); var a = (+y[0] + (z[0] / z[1])); num = a; } else { z = y[0].split('/'); if (z.length &gt; 1) { a = (z[0] / z[1]); num = a; } } alert(num); //The alert box shows my variable now as a decimal. And this doesn't: function parseFractions(x) { var y = x.split(' '); if (y.length &gt; 1) { var z = y[1].split('/'); var a = (+y[0] + (z[0] / z[1])); x = a; } else { z = y[0].split('/'); if (z.length &gt; 1) { a = (z[0] / z[1]); x = a; } } } parseFractions(num); //Here I call my function. alert(num); //The alert box does not even show up. The fraction isn't converted into a decimal. It's basically the same thing, the only difference is that in the 2nd one I tried to make that into a function so I don't have to repeat those lines of code every time I try to convert fractions into decimals. So what am I doing wrong? Is what I am trying to accomplish possible with a function? Any light into this issue is appreciated!
tagged with: fractions
has comment: http://stackoverflow.com/comment/45700146
score: 0
has comment: http://stackoverflow.com/comment/45700396
has title: Javascript problems with a function not working (it converts fractions into decimals)
tagged with: decimal
tagged with: function
has answer: http://stackoverflow.com/a/28705351
tagged with: javascript
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28705356
has comment: http://stackoverflow.com/comment/45700498
has answer: http://stackoverflow.com/a/28705356
accepted answer: http://stackoverflow.com/a/28705351
type: Question
answer count: 2

http://stackoverflow.com/a/28636532
type: Answer
accepted answer of: http://stackoverflow.com/q/28636294
downvote count: 0
answers question: http://stackoverflow.com/q/28636294
has comment: http://stackoverflow.com/comment/45572831
score: 9
has comment: http://stackoverflow.com/comment/45572883
has body: Convert the base64 string to a blob. A file using a file uploader is a blob with extra properties, so uploading a blob works the same. var file = dataURItoBlob(canString, 'image/png'); function dataURItoBlob(dataURI, type) { // convert base64 to raw binary data held in a string var byteString = atob(dataURI.split(',')[1]); // separate out the mime component var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0] // write the bytes of the string to an ArrayBuffer var ab = new ArrayBuffer(byteString.length); var ia = new Uint8Array(ab); for (var i = 0; i &lt; byteString.length; i++) { ia[i] = byteString.charCodeAt(i); } // write the ArrayBuffer to a blob, and you're done var bb = new Blob([ab], { type: type }); return bb; } UPDATE To convert a base64 string to an image: var image = new Image(), containerWidth = null, containerHeight = null; image.onload=function(){ containerWidth = image.width; containerHeight = image.height; } image.src = base64string; Or to save the base64 string locally as a file (this one is off memory while I locate where I implemented it): function saveImage(base64string) { var imageData = base64string.split(',')[1]; var a = $("&lt;a&gt;").attr("href", "data:Application/base64," + imageData ) .attr("download","image.png") .appendTo("body"); a[0].click(); a.remove(); }
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45573640
upvote count: 9

http://stackoverflow.com/comment/45634445
score: 0
type: Comment
type: QuestionComment
has text: You asked 'What am I doing wrong'. Concerning the code excerpt above the answer has to be: nothing. But I assume that the error is in some other piece of your code, likely at that point where you are creating and opening the window.
comment on: http://stackoverflow.com/q/28661702

http://stackoverflow.com/comment/45518675
has text: And the value you want to grab from the list under it?
score: 0
comment on: http://stackoverflow.com/q/28607292
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28741528
upvote count: 7
type: Question
tagged with: internet-explorer-9
tagged with: javascript
has answer: http://stackoverflow.com/a/28741740
has body: I often use the following code to clear the content of an element : div.innerHTML = ""; But I found a stange behaviour on Internet Explorer. It seems that all children of the div get their own children removed too! If I keep a reference to a child of the div above, after doing div.innerHTML = "";, the child's text node is no longer in the child. The following code is the proof of this behaviour (http://jsfiddle.net/Laudp273/): function createText() { var e = document.createElement("div"); e.textContent = "Hello World!"; return e; } var mrk = document.createElement("div"); mrk.appendChild(createText()); mrk.style.border = "4px solid yellow"; var container = null; function addDiv() { if (container) { container.innerHTML = ""; } var e = document.createElement("div"); e.appendChild(mrk); container = e; document.body.appendChild(e); } var btn = document.createElement("button"); btn.textContent = "Add marker"; btn.addEventListener( "click", function() { addDiv(); }, false ); document.body.appendChild(btn); If you click on the "Add Marker" button twice, you will see an empty yellow rectangle instead of one with the texte "Hello wordl!". Is this a bug or a specification not used by Firefox nor Google Chrome?
linked to: http://stackoverflow.com/q/13798796
answer count: 1
downvote count: 0
score: 7
favorite count: 0
accepted answer: http://stackoverflow.com/a/28741740
has title: Is there a bug in Internet Explorer 9/10 with innerHTML=""?
type: AnsweredQuestion
tagged with: internet-explorer-10

http://stackoverflow.com/comment/45599083
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28650445
has text: Try $location.url('/detail/' + id) instead of path()

http://stackoverflow.com/a/28656765
has comment: http://stackoverflow.com/comment/45610209
type: Answer
has comment: http://stackoverflow.com/comment/45610467
has comment: http://stackoverflow.com/comment/45610123
has comment: http://stackoverflow.com/comment/45610315
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28655963
has body: store some kind of reference to this node in memory (outside javascript code) and later re-use that reference (maybe this reference is a node number in dom tree) for locating the same element again. In its simplest form: store a list of child positions, counting from the document iterate that list to retrieve the element in question i.e. function refElement(elem) { var positions = [], position; while (elem) { position = 0; while (elem.previousElementSibling) { position++; elem = elem.previousElementSibling; } positions.unshift(position); elem = elem.parentElement; } return positions.join(); } function getElement(ref) { var positions = ref.split(/,/), elem = document; while (elem &amp;&amp; positions.length) { elem = elem.children[positions.shift()]; } return elem; } Test: var e = document.getElementsByTagName("TEXTAREA")[0]; var ref = refElement(e); console.log(ref) // 0,4,6,1,0,2,1,4,6,0,0,1 console.log(e === getElement(ref)) // true Should be needless to say: This solution assumes an immutable document structure between calls of refElement() and getElement().
has comment: http://stackoverflow.com/comment/45610154
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28655963

http://stackoverflow.com/a/28732026
type: Answer
has body: Assign result to a scope property, eg $scope.result = result; and display it in your template &lt;p&gt;{{ result }}&lt;/p&gt; While I'm here, let me introduce you to the switch statement var result = 0; if(myUnit === "Kilometer"){ switch (myUnit2) { case 'Kilometer' : result = distance; break; case 'Meter' : result = distance * 1000; break; // you get the idea } } $scope.result = result;
downvote count: 0
score: 2
accepted answer of: http://stackoverflow.com/q/28731985
upvote count: 2
answers question: http://stackoverflow.com/q/28731985
type: AcceptedAnswer

http://stackoverflow.com/q/28742057
has answer: http://stackoverflow.com/a/28742161
type: Question
has answer: http://stackoverflow.com/a/28742334
accepted answer: http://stackoverflow.com/a/28742334
tagged with: javascript
has comment: http://stackoverflow.com/comment/45767268
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28742161
has comment: http://stackoverflow.com/comment/45767403
has body: I'm looking for AngularJS $location replacement which allows me to map url parameters more flexible. For example, I have two root pages map and blog and some parameters for map page. Now how it looks like in angular: example.com/#!/map?id=1234567&amp;view=12,43.5,55.5 I want to throw away ? and &amp; garbage and get url like this example.com/#!/map/1234567/view/12/43.5/55.5 example.com/#!/map/1234567 view is an optional parameter example.com/#!/map/1234567/details details is an optional flag But I still want to use $location.search(view, '12,43.5,55.5') or $location.search(id, '1234567') or something similar. Is it possible to change Angular $location to get such behavior or is there any usable alternatives?
tagged with: angularjs
has title: AngularJS $location parameters mapping
type: AnsweredQuestion

http://stackoverflow.com/comment/45759492
has text: I will advice you to change the name of your function like so random_fn(you,computer). Never use a variable name that is the same as one of your function name.
comment on: http://stackoverflow.com/q/28737679
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28661152
has answer: http://stackoverflow.com/a/46020310
answer count: 2
downvote count: 0
favorite count: 0
tagged with: ajax
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/32547577
has comment: http://stackoverflow.com/comment/45617785
has comment: http://stackoverflow.com/comment/45617699
score: 2
has comment: http://stackoverflow.com/comment/45617755
has body: around 10 - 15% of my ajax calls fail due to the following error: POST http://86.141.xxx.xx/page.php net::ERR_CONNECTION_TIMED_OUT I don't know if this is an issue with the server (apache 2.9.4) or with my router. I never get these errors when testing in localhost. Is there any way to prevent/reduce theses errors. The ajax calls I make using jquery. something like the example below. Any advice much appreciated. Thanks $.get('/check_session.php',function(data){ if(data == "lo"){ //do something }else{ //do something else } });
has comment: http://stackoverflow.com/comment/45617788
type: Question
has title: what is causing timeout errors in ajax calls
tagged with: apache
has comment: http://stackoverflow.com/comment/45617814
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45553453
comment on: http://stackoverflow.com/a/28622811
type: AnswerComment
has text: Since, I can have a container inside container any level deep, it doesn't work for nested container. I have updated my question, hopefully it does explain things better.
score: 0
type: Comment

http://stackoverflow.com/comment/45497127
type: Comment
type: QuestionComment
has text: What is expected result ?
score: 1
comment on: http://stackoverflow.com/q/28594889

data-structures
tags question: http://stackoverflow.com/q/28603030
tag name: data-structures
tags question: http://stackoverflow.com/q/28690708
type: Tag
tags question: http://stackoverflow.com/q/28610663

tinymce
tags question: http://stackoverflow.com/q/28683394
tag name: tinymce
tags question: http://stackoverflow.com/q/28673592
type: Tag
tags question: http://stackoverflow.com/q/28667461
tags question: http://stackoverflow.com/q/28625043
tags question: http://stackoverflow.com/q/28604672
tags question: http://stackoverflow.com/q/28692375
tags question: http://stackoverflow.com/q/28631932
tags question: http://stackoverflow.com/q/28613864

http://stackoverflow.com/a/51069674
type: Answer
has body: options: { scales: { yAxes: [{ gridLines: { display: true, color: 'rgba(219,219,219,0.3)', zeroLineColor: 'rgba(219,219,219,0.3)', drawBorder: false, // &lt;--- lineWidth: 27, zeroLineWidth: 1 }, ticks: { beginAtZero: true, display: true } }] } }
downvote count: 1
score: 10
upvote count: 11
answers question: http://stackoverflow.com/q/28716464

http://stackoverflow.com/a/28742080
has body: You can use this regex: /^\d+(?:,\d{1,3})*$/ RegEx Demo
score: 0
answers question: http://stackoverflow.com/q/28741869
type: Answer

http://stackoverflow.com/comment/45609468
has text: your example of a 2D array isn't a 2D array. It are just 2 arrays. Also your json example isn't a valid json string!
score: 1
comment on: http://stackoverflow.com/q/28656404
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45601727
type: Comment
type: QuestionComment
has text: @gibberish Jup I know. But as I said I've tried the load function, the result I got was that the current page had been loaded in the div instead of the 'screenshots.html'...
comment on: http://stackoverflow.com/q/28652107
score: 0

http://stackoverflow.com/comment/45592371
has text: No, you're not telling to slide down the ` ` with id "logo". That would be the code in phillip100's comment.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28647340
score: 0

http://stackoverflow.com/q/28675914
has answer: http://stackoverflow.com/a/28676245
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
answer count: 1
has comment: http://stackoverflow.com/comment/45645534
has comment: http://stackoverflow.com/comment/45645689
has body: I am using jQuery droppable and I am trying to redirect to another page once the draggable element is dropped. Here is my code: For some reason this doesn't do anything, anyone know why this is?
type: UnansweredQuestion
has title: jQuery droppable redirect
score: 0
type: Question

http://stackoverflow.com/q/28599279
type: AnsweredQuestion
tagged with: validation
has title: Javascript output an error message on each offending control
has comment: http://stackoverflow.com/comment/45504700
has answer: http://stackoverflow.com/a/28599446
has comment: http://stackoverflow.com/comment/45504768
type: Question
accepted answer: http://stackoverflow.com/a/28599446
score: 0
answer count: 1
has body: I have to validate these fields in various ways. What I'm really having trouble with is that I have to output an error message for each field if its blank. There should be an error message next to each control that is null. all error messages need to be presented at the same time. So if there are multiple fields blank, all error messages need to show up when the user clicks the validate button. Name: Email: Phone: - - Address: City: State: WI IL MI Zip: Male Female ASP.NET Advanced Java PHP I've tried adding my own output with appendChild but I couldn't get it to work. I cannot use innerHTML for this, and my overall javascript knowledge is a few years rusty. Even vague examples will help at this point.
tagged with: javascript

http://stackoverflow.com/q/28655967
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28656077
has title: Overlay is clickable through an element in front of it
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45627896
tagged with: javascript
has body: I am using an overlay for a login which appears in front of everything when the user hit "sign-in". The overlay consists of an opaque wrapper which contains a solid inner-div where the login form is held. Here is the html: &lt;div class="login_wrapper"&gt; &lt;div class="login_info"&gt; &lt;div class="login_form"&gt; // form &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; and the css: .login_wrapper{ position:absolute; position: fixed; margin: auto; left:0; right: 0; top: 0; bottom: 0; width: 100%; height:100%; background-color:rgba(0, 0, 0, 0.5); z-index:9998; display: none; } .login_info{ font-family: "NimbusCondensed"; position:absolute; margin: auto; left:0; right: 0; top: 0; bottom: 0; width: 350px; height:300px; background: #cacaca; border: solid #000000 1px; border-radius: 10px; z-index:99999; pointer-events: none; } .login_form{ margin-top: 40px; margin-left: 12.5%; padding: 10 20 0 20; width: 220px; border: 1px solid black; border-radius: 7px; background: white; box-shadow: 0px 5px 13px black; z-index: 100000; } I would like this overlay to be hidden when the user clicks anywhere outside of the login_info. I have the following JQuery handling this: $(document).ready(function(){ $(".login_wrapper").click(function(){ $(".login_wrapper").fadeToggle(300); }); }); But login_wrapper is hidden if the use clicks ANYWHERE on the overlay, including the form in the middle which prevent then form entering any info. Somehow the click events are getting "through" login_form &amp; login_info and the browser reacts like login_wrapper is clicked. How can I resolve this so that jQuery code applies ONLY when the overlay is clicked outside the inner divs. Thanks!
tagged with: jquery
has answer: http://stackoverflow.com/a/28656097
has comment: http://stackoverflow.com/comment/45608498
score: 0
has comment: http://stackoverflow.com/comment/45608365

http://stackoverflow.com/q/28712013
has answer: http://stackoverflow.com/a/28712055
type: UnansweredQuestion
has body: I have URLs like this http://domain.com/questions/ask/2 I want to find the trailing slash with page number from URLs and then remove the trailing slash with page number using jquery or javascript. I want the URLs like this http://domain.com/questions/ask Please help me to solve. Thanks in advance UPDATE The URLs are /1, /2 and so on... the page number is dynamic
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has title: how to remove trailing slash with page number from url using jquery or javascript
score: 0
has answer: http://stackoverflow.com/a/28712200

http://stackoverflow.com/a/28652670
has body: you must to create a simple object in your web site header,for example: after add your js files. and now you can use options: { enabled: false, arrowMarkup: ' '};
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28652385
downvote count: 0
has comment: http://stackoverflow.com/comment/45602956
type: Answer

http://stackoverflow.com/q/28732037
has comment: http://stackoverflow.com/comment/45750368
has comment: http://stackoverflow.com/comment/45750395
has comment: http://stackoverflow.com/comment/45750410
type: Question
tagged with: reactjs
has comment: http://stackoverflow.com/comment/45750314
has answer: http://stackoverflow.com/a/56816066
has comment: http://stackoverflow.com/comment/45750182
tagged with: javascript
has title: Using onClick and React AutoBind
tagged with: ajax
score: 0
has body: I am new to React, so please feel free to redirect me to documentation if I missed out on it. I'm trying to trigger an Ajax call using the onClick method as per the React tutorial. The related code is below. doSomething: function() { // make the ajax call }, render: function() { ... &lt;button onClick={this.doSomething}&gt; Button Title &lt;/button&gt; &lt;Table data={table_data} columns={this.props.columns} /&gt; When the render() method is called, React's auto-bind method kicks in, which calls return method.apply(component, arguments);, and hence the ajax call is made. The render method includes a table, and the button is also rendered for each cell (even though there is only once instance of the button for each table) and hence a network call is made for each cell as well. Is there a better way to do something like this whereI avoid the repeated ajax calls?
answer count: 1
has comment: http://stackoverflow.com/comment/45750505
type: UnansweredQuestion

http://stackoverflow.com/q/28637253
has body: Hi I am NewBee in Javascript. This is my second week. Below is the code that has a form with three input fields. The relationship of the fields is: the second field is twice the value of the first field the third field is the square of the first field I have managed to do the above but i am not able to do the below : If a user enters a value in the second or third field, the script should calculate the appropriate value in the other fields. Currently the code works well ONLY if I enter the value in the first field. I hope I explained well in other words : how do I enter say 144 in the last textbox and the other 2 textboxes show 12 and 24 respectively. Or If I enter 24 first and first and the third text boxes show 12 and 144. Thanks Vipul
score: 0
has title: 3 text box Math in Javascript
has answer: http://stackoverflow.com/a/28638527
has answer: http://stackoverflow.com/a/28637637
possible better answer: http://stackoverflow.com/a/28638527
has comment: http://stackoverflow.com/comment/45574261
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28637637
type: Question
answer count: 2
tagged with: javascript

http://stackoverflow.com/comment/45601286
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28651631
score: 1
has text: It's partly a question of what component actually "owns" the act of deleting the comment. Is it the base level `Comment` component? Or some container that does? Events are a very efficient and extremely clear way of transmitting state through a parent chain and establishes a clear owner. You might then use the Flux pattern ...

http://stackoverflow.com/a/28680997
answers question: http://stackoverflow.com/q/28680781
has body: http://jsfiddle.net/8ejbw8d5/ $( ".date-picker" ).datepicker({ defaultDate: +2 }); // Getter var defaultDate = $( ".selector" ).datepicker( "option", "defaultDate" ); // Setter $( ".selector" ).datepicker( "option", "defaultDate", +2 ); Read more here: http://api.jqueryui.com/datepicker/#option-defaultDate
score: 0
type: Answer

http://stackoverflow.com/comment/45927310
type: AnswerComment
score: 0
type: Comment
has text: thank you for answer but that doesn't work :/ Message Error : 'unable to get property 'refresh' of undefined or null reference'
comment on: http://stackoverflow.com/a/28824507

http://stackoverflow.com/q/28658217
has answer: http://stackoverflow.com/a/28681683
type: Question
has answer: http://stackoverflow.com/a/28658261
tagged with: javascript
answer count: 2
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has title: How to pass accented characters from JavaScript to HTML?
has comment: http://stackoverflow.com/comment/45612344
tagged with: http://stackoverflow.com/tag/html
upvote count: 6
has body: In JavaScript I create a string which has accented characters such as 'ò' or 'à', e.g. "ò à" I seem to be unable to create text nodes in html which show the accented characters: if i pass them directly, i get "white question mark in black rhombus"; if i replace the accented characters by the corresponding html entities, i get the entities printed verbatim. This function function showAccents() { s1="ò à"; s2 = s1.replace(/ò/, "&amp;ograve;").replace(/à/, "&amp;agrave");; var eD = document.getElementById("accent1"); var eHT1 = document.createTextNode(s1); var eHT2 = document.createTextNode(s2); eD.appendChild(eHT1); eD.appendChild(eHT2); } Produces the following text: � �&ograve; &amp;agrave How do I have to convert the string to get accented characters in HTML?
has comment: http://stackoverflow.com/comment/45612327
score: 6

http://stackoverflow.com/a/28657049
score: 0
has body: I think this answer is the right way to go: In javascript, how can I uniquely identify one browser window from another which are under the same cookiedbased sessionId Set a unique window id: window.windowIdClient = "{978d-478ahjff-3849-dfkd-38395434}"; //or another randomly generated id. Store that windowId in the database, along with the ip-address and the session-id. If those three do not match than the user is logged out. In addition, if didn't think of T.J. Crowder's option, I use it myself.
answers question: http://stackoverflow.com/q/28656982
type: Answer

http://stackoverflow.com/comment/45764935
comment on: http://stackoverflow.com/q/28740742
has text: `document.getElementById("32298")[0]` should be `$(this)`.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45782984
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28749764
type: Comment
has text: one more question. after i removed index: '2dsphere ' everything works just fine too?

http://stackoverflow.com/q/28681303
has comment: http://stackoverflow.com/comment/45655443
has comment: http://stackoverflow.com/comment/45655763
downvote count: 0
tagged with: javascript
tagged with: variables
tagged with: jquery
has answer: http://stackoverflow.com/a/28681391
tagged with: variable-variables
answer count: 1
has comment: http://stackoverflow.com/comment/45655531
favorite count: 0
has comment: http://stackoverflow.com/comment/45655824
has comment: http://stackoverflow.com/comment/45656142
tagged with: php
accepted answer: http://stackoverflow.com/a/28681391
linked to: http://stackoverflow.com/q/750486
has body: Say I have object: function obj() { this.prop1; this.prop2; this.prop3; } and an array of obj's objects = [new obj(),new obj(),new obj()]; I want to easily iterate through each using jquery where the class name is equivalent to the property of the object. var itemsIWantToBind = ["prop1","prop2","prop3"]; for(j=0;j&lt;itemsIWantToBind.length;j++) { $("."+itemsIWantToBind[j]).unbind().blur(function(){ var id = $(this).siblings(".objID").html(); if(id &gt;= 0) { objects[id].itemsIWantToBind[j] = $(this).text()); } }); } My issue is I want to be able use a variable variable to iterate through the items for this objects[id].itemsIWantToBind[j] = $(this).text()); ^^^^^^^^^^^^^^^^^ the indicated part does not correctly bind the value of the array item as it is trying to bind the property name of it instead. In php it would be the same as: foreach($itemsIwantToBind as $item) { $objects[$id]-&gt;$item = "Something"; } Is there a simple way to do this in JavaScript?
type: AnsweredQuestion
has title: JavaScript variable variables
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/comment/45533404
type: QuestionComment
score: 1
has text: This http://localhost/angularjs/public#/products will work
comment on: http://stackoverflow.com/q/28615081
type: Comment

http://stackoverflow.com/comment/45676934
comment on: http://stackoverflow.com/q/28691774
type: Comment
type: QuestionComment
score: 0
has text: Possible duplicate http://stackoverflow.com/questions/18576419/why-is-jquery-not-working-on-my-tumblr

http://stackoverflow.com/a/28727608
has body: By "without a postback", I take you to mean without reloading the page. Using AJAX very well may require a POST, but it would not cause the page to reload. Anyways, yes, if you want to change a portion of the page without reloading the whole page, you must use JavaScript. If you want to change that portion via something retrieved from the server, then specifically, you must use AJAX.
answers question: http://stackoverflow.com/q/28724884
score: 0
has comment: http://stackoverflow.com/comment/45773543
type: Answer

http://stackoverflow.com/comment/74052671
score: 2
has text: The value returned from this is unaltered by browser zoom level changes in Safari (10.1)
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/31445818

http://stackoverflow.com/a/28651387
has body: Very crazy idea to change ID. If it is not really needed (probably 100% of cases), I suggest to use another property to select current element. For example class, or even custom data- in html5. Take a look here: http://www.w3schools.com/tags/att_global_data.asp
has comment: http://stackoverflow.com/comment/45600563
answers question: http://stackoverflow.com/q/28651282
score: 0
type: Answer

http://stackoverflow.com/comment/52048049
score: 0
has text: http://caniuse.com/
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28620068

http://stackoverflow.com/comment/45780059
score: 0
has text: I load routes.js just after app.js load. So i just should remove the ".config(....)" part ?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28747632

http://stackoverflow.com/comment/45753965
has text: @WizKid I'm trying to get my head around this facebook share functionality, how it stands at the moment say ten people came on to the site all done a different combination which would result in ten different images to be shown in the dialog. When I do it the first time I see the correct combination image in the share dialog, if I go back and create a new combination as facebook has scrapped that page and caches it for 24 hours the meta data gets updated but it does not update the image in the share dialog, instead facebook takes it from the cache that's the problem I'm experiencing.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28733705
type: QuestionComment

http://stackoverflow.com/q/28612482
upvote count: 1
has answer: http://stackoverflow.com/a/28612611
type: Question
has comment: http://stackoverflow.com/comment/45529661
has comment: http://stackoverflow.com/comment/45528701
tagged with: javascript
has comment: http://stackoverflow.com/comment/45529628
answer count: 2
has answer: http://stackoverflow.com/a/28612712
has body: Somehow I can't find the right term to search for this problem, basically I want to do this with javascript: var demo = [{part1: 'a', part2: 'b', part3: this.part1 + this.part2}]; Now I think this is not possible, but since I can't determine why and what to call this construct, maybe somebody here can. is there a term or accurate description for this situation? can this be solved in js? thanks! EDIT: due to the comments, I need to be more specific: var demo = [ { text: 'long text', action: function(xy) { log(text);} }, { text: 'long text2', action: function(xy) { log(text);} }, ]; the goal is to let action log the text defined with it. EDIT2: as @EnigmaRM has cleared nearly everything up, this is a Bonus instead of demo[1].action() solve it while action is called this way: var someCaller = demo[1].action; someCaller();
tagged with: arrays
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45528616
has comment: http://stackoverflow.com/comment/45529694
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45528720
accepted answer: http://stackoverflow.com/a/28612712
score: 1
has title: Is it possible to refer to another element inside a JS array/object
possible better answer: http://stackoverflow.com/a/28612611

http://stackoverflow.com/q/28634712
answer count: 13
score: 27
has answer: http://stackoverflow.com/a/53669109
upvote count: 27
has answer: http://stackoverflow.com/a/77744201
has title: How can I return a view from an AJAX call in Laravel 5?
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/57484282
has body: I'm trying to get an html table to return on an ajax call. route: Route::post('job/userjobs', 'JobController@userjobs'); ajax on calling page: function getUserJobs(userid) { $_token = "{{ csrf_token() }}"; var userid = userid; $.ajax({ headers: { 'X-CSRF-Token' : $('meta[name=_token]').attr('content') }, url: "{{ url('/job/userjobs') }}", type: 'POST', cache: false, data: { 'userid': userid, '_token': $_token }, //see the $_token datatype: 'html', beforeSend: function() { //something before send }, success: function(data) { console.log('success'); console.log(data); //success //var data = $.parseJSON(data); if(data.success == true) { //user_jobs div defined on page $('#user_jobs').html(data.html); } else { $('#user_jobs').html(data.html + '{{ $user-&gt;username }}'); } }, error: function(xhr,textStatus,thrownError) { alert(xhr + "\n" + textStatus + "\n" + thrownError); } }); } //on page load getUserJobs("{{ $user-&gt;id }}"); controller: public function userjobs() { $input = Request::all(); if(Request::isMethod('post') &amp;&amp; Request::ajax()) { if($input['userid']) { $userjobs = Userjob::select('select * from user_jobs where user_id = ?', array($input['userid'])); if(! $userjobs) { return response()-&gt;json( array('success' =&gt; false, 'html'=&gt;'No Jobs assigned to ') ); } $returnHTML = view('job.userjobs')-&gt;with('userjobs', $userjobs); return response()-&gt;json( array('success' =&gt; true, 'html'=&gt;$returnHTML) ); } } } view: @section('content') &lt;table class="table table-striped"&gt; &lt;tbody&gt; @foreach ($userjobs as $userjob) &lt;tr&gt; &lt;td&gt;&lt;strong&gt;{{ $userjob-&gt;title }}&lt;/strong&gt;&lt;br /&gt; {{ $userjob-&gt;description }} &lt;/td&gt; &lt;/tr&gt; @endforeach &lt;/table&gt; @stop Im not getting anything in the json.html data. nothing. If in the controller I say: return response()-&gt;json( array('success' =&gt; true, 'html'=&gt;'&lt;span&gt;html here&lt;/html&gt;') ); This works just fine. How can I return a view from an ajax …
has answer: http://stackoverflow.com/a/28635193
tagged with: php
has answer: http://stackoverflow.com/a/51942168
tagged with: laravel
has answer: http://stackoverflow.com/a/28636800
has answer: http://stackoverflow.com/a/36804615
has answer: http://stackoverflow.com/a/28671303
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28638388
has answer: http://stackoverflow.com/a/28957961
has answer: http://stackoverflow.com/a/58288196
has answer: http://stackoverflow.com/a/51864354
has answer: http://stackoverflow.com/a/56999106
tagged with: javascript

http://stackoverflow.com/q/28632618
tagged with: date
has title: Jquery Datepicker dateformat not working in Asp.net
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28636661
tagged with: asp.net
favorite count: 0
linked to: http://stackoverflow.com/q/3341623
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45567033
has body: Jquery/Js: $("#startDate").datepicker( { onSelect: function (date) { // Onselect not working after postback var date1 = $('#startDate').datepicker('getDate'); var date = new Date(Date.parse(date1)); date.setDate(date.getDate() + 1); var newDate = date.toDateString(); newDate = new Date(Date.parse(newDate)); $('#endDate').datepicker("option", "minDate", newDate);}, }); $("#endDate").datepicker(); $.datepicker._gotoToday = function (id) { $(id).datepicker('setDate', new Date()).datepicker('hide').blur();}; $.datepicker.regional['tr'] = { closeText: 'Kapat', prevText: '&lt;geri', nextText: 'ileri&gt;', currentText: 'Bugün', dayNamesShort: ['Pz', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'], dayNamesMin: ['Pz', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'], weekHeader: 'Hf', dateFormat: 'dd.mm.yy', // Problem here firstDay: 1, isRTL: false, showMonthAfterYear: false, yearSuffix: '' }; $.datepicker.setDefaults($.datepicker.regional['tr']); } Html: &lt;asp:TextBox ID="startDate" runat="server" ReadOnly="true"&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="endDate" runat="server" ReadOnly="true"&gt;&lt;/asp:TextBox&gt; &lt;asp:Button ID="btnsearch" runat="server" Text="search OnClick="btnsearch_Click" /&gt; CodeBehind : protected void btnsearch_Click(object sender, EventArgs e) { startDate.Text = "10.02.2012"; endDate.Text = DateTime.Today.Date.ToShortDateString(); } Question: When I load page jquery onSelect function works without any problem. If I click to search button I set startDate.Text as "10.02.2012" and endDate.Text as DateTime.Today.Date.toShortDateString();. After that jquery onSelect function not working for dateformat dd.mm.yy .However if i change dateformat as dd/mm/yy it works. How can I run onselect function for dd.mm.yy after button click in asp.net for jquery datepicker ?
score: 1
upvote count: 1
type: Question
tagged with: c#
tagged with: javascript
has comment: http://stackoverflow.com/comment/45565676
tagged with: jquery

http://stackoverflow.com/q/28611410
tagged with: angularjs
type: UnansweredQuestion
upvote count: 1
type: Question
tagged with: internet-explorer
tagged with: javascript
has answer: http://stackoverflow.com/a/28611586
has body: I have an angularjs SPA that is running into problems in IE9. The app works great in Chrome and Firefox. There is quite a bit data to download on the initial load and many dependencies managed through requirejs. When I view the page in a fresh IE session I get a part of the webpage i.e. some parts just don't display on the screen. I check the network requests and they are short some items. If I reload at this point, the page will load fine because it already cached some of the files so it doesn't need to download them. However if I clear cache and retry the same thing will happen. Missing files are not consistent, meaning that it's not always the same files. Additionally, in console I can see the following error: $digest already in progress This app is an open source project that I am intimately familiar with, however I am not sure even where to start troubleshooting this. Any ideas? Thanks in advance
answer count: 1
downvote count: 0
score: 1
favorite count: 0
has title: Angular JS Page Load Issue in IE9

http://stackoverflow.com/comment/45749230
comment on: http://stackoverflow.com/q/28731256
score: 0
type: Comment
type: QuestionComment
has text: seems that a _data-requirecontext_ attrib can point to differently configured require context, so you could mix and match regular and custom types. i don't know requirejs deeply, but hopefully this gets you on the right track. if not, it's trivial to make your own script finder and feed your transpiler with it instead of requirejs.

http://stackoverflow.com/q/28664758
linked to: http://stackoverflow.com/q/14678447
tagged with: node.js
score: 2
has comment: http://stackoverflow.com/comment/45624418
has comment: http://stackoverflow.com/comment/45625156
answer count: 0
upvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/45624436
has comment: http://stackoverflow.com/comment/45624306
tagged with: javascript
has title: Sending emails from a node.js server
tagged with: email
downvote count: 0
favorite count: 0
has body: I know there are many node.js modules to send emails from SMTP/gmail/hotmail/outlook etc, but I am stuck one step behind. I am coming from PHP land where you just use the mail class. What I never needed to ask myself was, where is this email coming from (the apache/etc server?) and why does Node need to send it through a 'provider' or sorts? I think I have no idea how email works.. I kind of dont like the fact that I need to go through another route first (what if they are down, what if I am building a node_module that I want to share and I don't know what kind of service the user is going to use.. etc) Thanks for any clarification.
type: UnansweredQuestion

http://stackoverflow.com/a/28723996
answers question: http://stackoverflow.com/q/28720477
type: Answer
accepted answer of: http://stackoverflow.com/q/28720477
score: 3
upvote count: 3
has body: By default, for speed reasons the tasks will attempt to run in parallel. If you truly need something to run first to completion (like clean), then you need to use runSequence. I will make some example code here: var gulp = require('gulp'), runSequence = require('run-sequence'); function runAllTasks(cb) { runSequence('pretasks', 'posttask', cb); } gulp.task('pretasks', ['clean']); gulp.task('posttask', ['build', 'lint', 'test']); gulp.task('default', runAllTasks); The above will more or less express what you need to do. Use run sequence to run clean (or anything else that can run parallel to clean) first. Then, do everything after clean. Assign default to this sequential model. Of course, running in sequence should be avoided as much as possible for performance! Edit: I wanted to add, since I looked at your code.... You might build then serve/test. You don't want to start running the server or the test runner while you are still moving files around, concatenating scripts and so on....
downvote count: 0
type: AcceptedAnswer

http://stackoverflow.com/q/28686445
tagged with: constructor
type: UnansweredQuestion
has body: I want to clear up a concept. Please tell me if my understand is correct: Many javascript build-in objects, like Object, String, Array, Date, XMLHttpRequest, we keep saying they are objects, but they are actually constructor functions, am I right? or these two name are used interchangeably. Thanks
upvote count: 1
tagged with: object
score: 1
has answer: http://stackoverflow.com/a/28686734
has answer: http://stackoverflow.com/a/28686575
has title: Object vs function constructor in JavaScript
has comment: http://stackoverflow.com/comment/45665377
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45665332
has comment: http://stackoverflow.com/comment/45665415
favorite count: 0

http://stackoverflow.com/comment/45553087
type: Comment
has text: Rory your answer is work for only fix pattern but In my case it is not fixed it may be name >> lastname >> marks or may be marks>> name>> last name or anything sorting Fields order and sorting type is decided by webpage
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28625600

http://stackoverflow.com/comment/46057715
type: AnswerComment
score: 0
type: Comment
has text: Any thoughts? Bounty has expired now.
comment on: http://stackoverflow.com/a/28655944

http://stackoverflow.com/q/28651807
has title: Reusing Modified Three.js Geometry
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28653868
type: UnansweredQuestion
tagged with: three.js
has comment: http://stackoverflow.com/comment/45601367
has body: I'm using Three.js to display the line of a particle following a random walk. Since geometries cannot be enlarged dynamically, I'm removing the line from the scene, altering the geometry and adding a new line to the scene. Here's the relevant code: var step = .5; var material = new THREE.LineBasicMaterial({ color: 0x0077ff }); var geometry = new THREE.Geometry(); geometry.vertices.push( new THREE.Vector3(0,0,0) ); scene.add( new THREE.Line( geometry, material ) ); var render = function () { requestAnimationFrame( render ); renderer.render(scene, camera); controls.update(); } function addStep() { scene.remove( scene.children[1] ); last = geometry.vertices[ geometry.vertices.length - 1 ]; geometry.vertices.push( new THREE.Vector3( last.x + (2*Math.random()-1)*step, last.y + (2*Math.random()-1)*step, last.z + (2*Math.random()-1)*step )); scene.add( new THREE.Line( geometry.clone(), material ) ); } setInterval( addStep, 500); render(); This codes works, but only if the geometry is cloned at each step. If the last line of addStep() is changed to scene.add( new THREE.Line( geometry, material ) ); then it can be called as many times as desired before rendering starts to add line segments, but if called after rendering starts then nothing appears. Presumably I'm missing something simple about graphics buffers or variable assignments, but I would appreciate if someone could explain why the modified geometry cannot be reused without cloning.
has comment: http://stackoverflow.com/comment/45602631
type: Question

http://stackoverflow.com/a/28742099
answers question: http://stackoverflow.com/q/28740849
has body: You can also Try This:- function changeIn(ele,clr){ var elem = document.getElementById(ele.id); elem.style.transition = "background 1.0s linear 0s"; elem.style.background=clr; } function changeOut(ele){ var elem=document.getElementById(ele.id); elem.style.transition = "background 1.0s linear 0s"; elem.style.background="#9DCEFF"; } Some content
score: 0
type: Answer

http://stackoverflow.com/comment/45520307
comment on: http://stackoverflow.com/q/28605721
score: 0
has text: Try following the examples in the docs : `Polymer('test-input', ready: function() { this.hue = 5; } });`
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28602446
has comment: http://stackoverflow.com/comment/45512554
score: 0
has body: i would suggest to avoid making own modals when we have awesome libraries available out there like ngModal and many more. Here i am explaining how to use ngModal. you have to run following command to install this bower install ngModal or if you want to add this into your bower.json file as follows dependencies: { "ngModal": "~1.2.0" } and run following commands after adding into bower.json npm install bower install To use the library, add the JS file and CSS file, and then include the module in your app: app = angular.module("myApp", ["ngModal"]) and you are good to go like this Dialog content goes in here
answers question: http://stackoverflow.com/q/28601048
type: Answer
has comment: http://stackoverflow.com/comment/45511642

http://stackoverflow.com/comment/45637705
has text: It's definitely an issue with superfish, just don't know why it's doing this...
type: Comment
comment on: http://stackoverflow.com/q/28670087
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45692663
score: 0
has text: `($now < 100)` is **ALWAYS** going to be false, since 100 occurred back in 1970, and is rather unlikely to ever occur again...
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28701174

http://stackoverflow.com/q/28745785
has body: I am trying to upload a cropped image with the Cropit jQuery plugin which uses the canvas in the front end. Basically trying to recreate process described here: How to crop and upload photo using cropit jquery plugin with php My Node.js effort: var img = //DATA RECEIVED FROM THE POST REQUEST var decoded = decodeURIComponent(require('url').parse(img, true).path.replace(/\++/g, ' ')) var exp = decoded.replace('data:image/jpeg;base64','').split(','); var base64 = exp.shift(); var data = base64url.decode(base64); fs.writeFile('./public/woooo.jpg', data,function(err,done){ if (err){ console.log(err) } }) The result is an image file which cannot be opened. Why? What am I doing wrong? Anyone else has managed this?
tagged with: node.js
linked to: http://stackoverflow.com/q/28085848
has answer: http://stackoverflow.com/a/28746076
upvote count: 1
type: Question
score: 1
has title: Cropit upload canvas image to NodeJS
tagged with: canvas
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: php

http://stackoverflow.com/comment/45528910
has text: Why don't you just use `function i_am` instead of `var i_am = function`?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28612616
score: 1

http://stackoverflow.com/a/28598054
accepted answer of: http://stackoverflow.com/q/28598034
answers question: http://stackoverflow.com/q/28598034
type: Answer
downvote count: 0
score: 1
has body: Did you try Model.find({tof: true}).sort('date').limit(6)
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/100223493
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28703648
score: 8
has text: @AustinHemmelgarn That is just false, `Promise.all` fulfills [with an array](https://www.ecma-international.org/ecma-262/10.0/index.html#sec-performpromiseall). In `Promise.all([a,b]).then((a, b) =>` `b` is `undefined`. That's why you need to do `.then(([a, b]) =>` which is a destructuring assignment

http://stackoverflow.com/q/28720017
type: Question
has comment: http://stackoverflow.com/comment/45727059
has comment: http://stackoverflow.com/comment/45728408
has title: How to route pages on AngularJS
has comment: http://stackoverflow.com/comment/45727168
tagged with: javascript
has comment: http://stackoverflow.com/comment/45728052
has answer: http://stackoverflow.com/a/28721372
score: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/28721204
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45728558
has comment: http://stackoverflow.com/comment/45727333
has comment: http://stackoverflow.com/comment/45728523
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45727541
has comment: http://stackoverflow.com/comment/45728531
possible better answer: http://stackoverflow.com/a/28720954
has comment: http://stackoverflow.com/comment/45727868
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45728158
has answer: http://stackoverflow.com/a/28720954
has body: Hello guys I just started to learn Angular JS and I have a problem on loading the content from pages. I don't receive any content. This is my index and my js code: index.html My App Text 1 Text 2 Home Exterior Interior Gallery Form Live 2015 app.js var app = angular.module('app', ['ngRoute']); app.config(['$routeProvider', function($routes) { $route.when('/',{ templateUrl : '/views/index.html' }); $route.when('/exterior',{ templateUrl : '/views/exterior.html' }); $route.when('/interior',{ templateUrl : '/views/interior.html' }); $route.when('/gallery',{ templateUrl : '/views/gallery.html' }); $route.when('/form',{ templateUrl : '/views/form.html' }); $route.when('/live-preview',{ templateUrl : '/views/live-preview.html' }); $routes.otherwise({ redirectTo : '/' }); }]); My all pages are already created as files and the content is like this exterior.html Exterior My content here
has answer: http://stackoverflow.com/a/28721204

replace
tags question: http://stackoverflow.com/q/28745799
tags question: http://stackoverflow.com/q/28711316
tags question: http://stackoverflow.com/q/28731567
tags question: http://stackoverflow.com/q/28744178
type: Tag
tags question: http://stackoverflow.com/q/28739385
tags question: http://stackoverflow.com/q/28610038
tag name: replace
tags question: http://stackoverflow.com/q/28695182
tags question: http://stackoverflow.com/q/28706278
tags question: http://stackoverflow.com/q/28736704
tags question: http://stackoverflow.com/q/28596211

http://stackoverflow.com/comment/45615735
score: 0
type: AnswerComment
has text: This code will not resolve the problem because it will not read a local file.
type: Comment
comment on: http://stackoverflow.com/a/28660113

http://stackoverflow.com/comment/45694478
comment on: http://stackoverflow.com/q/28701980
score: 0
type: Comment
type: QuestionComment
has text: Also it applies the dataTools twice, if copied from the example.

http://stackoverflow.com/comment/45554485
type: Comment
score: 4
has text: Your selector is wrong. `.guess_box p` should be `.guess-box p` (you probably want `$(this).find('p')` anyway)
comment on: http://stackoverflow.com/q/28626897
type: QuestionComment

http://stackoverflow.com/comment/45700243
has text: Yes I am using multiple view models.
comment on: http://stackoverflow.com/a/28621398
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28724862
has comment: http://stackoverflow.com/comment/45737169
has comment: http://stackoverflow.com/comment/45737635
has comment: http://stackoverflow.com/comment/45737761
has comment: http://stackoverflow.com/comment/45737973
has comment: http://stackoverflow.com/comment/45739281
answers question: http://stackoverflow.com/q/28723980
has body: Try this out: $("#type").change(function () { var selectList = document.getElementById("type"); if (selectList.value === "UV") { $("#series option").attr("disabled", "disabled"); } else if (selectList.value === "EAFVH") { $("#series option").removeAttr("disabled"); } else if (selectList.value === "EAFVV") { $("#series option").removeAttr("disabled"); $("#series option:nth-child(4)").attr("disabled", "disabled"); $("#series option:nth-child(5)").attr("disabled", "disabled"); } else { $("#series option").removeAttr("disabled"); } });
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45737050
has comment: http://stackoverflow.com/comment/45736841
has comment: http://stackoverflow.com/comment/45737331

http://stackoverflow.com/comment/45617911
comment on: http://stackoverflow.com/a/28660668
has text: this one worked! >>Here is the demo without using location.hash = target;: http://jsfiddle.net/pcyn2fvk/1/ Thank you!! :)
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28701750
type: AnsweredQuestion
score: 3
has title: React: why is getDefaultProps a method while propTypes is a plain object?
has body: Since getDefaultProps doesn't refer to a component instance, it would seem like you wouldn't need a function (as there's no need to rebind this, for instance) and a plain old object would work fine. What's the advantage of using a function there, any why doesn't the same apply to propTypes?
has comment: http://stackoverflow.com/comment/80315228
accepted answer: http://stackoverflow.com/a/28707939
type: Question
tagged with: reactjs
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28707939
upvote count: 3

http://stackoverflow.com/comment/45755290
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28732397
score: 0
has text: Yea because having unique images are probably a 5-10 minutes job

http://stackoverflow.com/comment/45779170
type: QuestionComment
comment on: http://stackoverflow.com/q/28748558
has text: i think that's a browser setting
score: 0
type: Comment

http://stackoverflow.com/comment/45784304
type: AnswerComment
has text: In folder controllers I have 5 files js: humor.js, main.js, promissor.js, quadrinhos.js end terra.js, the pages that are under the control of humor.js are functioning normally, both principal and articles. The main pages that are up area of ​​other controllers appear the page wizard.html, however, should appear pages main.html, promissor.html, quadrinhos.html end terra.html, articles on these pages are functioning normally.
comment on: http://stackoverflow.com/a/28741898
type: Comment
score: 0

http://stackoverflow.com/q/28612686
type: Question
has body: Recently implented this javascript code in order to make all my video embeds the same size as my images. bhyphen.com &lt;script language='javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js' type='text/javascript'/&gt; &lt;script type='text/javascript'&gt;//&lt;![CDATA[ $(document).ready(function() { // change the dimension variable below to be the column size you want var newwidth= 660; // this identifies the post-body div element, finds each image in it, and resizes it $('.post-body').find('iframe').each(function(n, iframe){ var iframe = $(iframe); var height = iframe.attr('height'); var width = iframe.attr('width'); var newHeight = (height/width * newwidth).toFixed(0); iframe.attr('width',newwidth).attr('height',newHeight); }); }); //]]&gt;&lt;/script&gt; This code as also affected my Soundcloud embeds as well. Is there a piece of code I can add so that the iframes from my SC embeds will be ignored?
tagged with: soundcloud
answer count: 1
tagged with: javascript
has title: Exclude Soundcloud from javascript code
score: 0
type: UnansweredQuestion
tagged with: iframe
has answer: http://stackoverflow.com/a/28612877

http://stackoverflow.com/comment/45733291
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28717182
has text: I've edited the question with my progress
score: 0

http://stackoverflow.com/a/45319675
answers question: http://stackoverflow.com/q/28713598
has body: Calculte windows height using angular $scope.screenHeight = ''; $scope.calculateoriginalWidth = function() { var width = $window.innerWidth; $rootScope.originalWidth = width; } $scope.calculateScreenHeight = function() { var height = $window.innerHeight; var width = $window.innerWidth; var subheight = 0; var headerheight = document.getElementById('headerTitle1'); var headerheight2 = document.getElementById('headerTitle2'); if (headerheight) { subheight += headerheight.offsetHeight; } if (headerheight2) { subheight += headerheight2.offsetHeight; } $scope.screenHeight = height - subheight - 20; $rootScope.screenHeight = $scope.screenHeight; $scope.screenWidth = width; $rootScope.screenWidth = $scope.screenWidth; } var reg = $scope.$on('screenResize', function($evt, args) { $scope.calculateScreenHeight(); $scope.$apply(); }) window.onresize = function(event) { $scope.$apply(function() { $scope.calculateScreenHeight(); }) }; $scope.calculateScreenHeight(); $scope.calculateoriginalWidth(); You need to add the required dependencies in angular for using this code. Hope this will help you to calculate the height of the window.
score: 0
type: Answer

http://stackoverflow.com/comment/45637602
type: QuestionComment
type: Comment
has text: @skobaljic Care to provide an example of that?
comment on: http://stackoverflow.com/q/28671576
score: 0

http://stackoverflow.com/a/28739556
upvote count: 2
has body: The left property only applies to positioned elements. A positioned element is on where the value of the position property is something other than static. static is the default value and you haven't changed it. Set position to fixed, relative, or absolute depending on what you actually want. Additionally, if you are using a " to mark the start an end of an attribute value, then the next " will end the attribute value. onclick="move(getElementById(" If you want to use a " character as data in such a value, you must use a character reference: &quot; You could use ' instead. Additionally, your ID doesn't have any spaces in it, so you shouldn't have any spaces in the string you pass to getElementById.
downvote count: 0
answers question: http://stackoverflow.com/q/28739486
type: Answer
has comment: http://stackoverflow.com/comment/45808157
score: 2

http://stackoverflow.com/a/28709133
score: 1
has comment: http://stackoverflow.com/comment/45708226
has body: Your problem is that you can't pass parameters in the call to setTimeout. Try this instead: function loopThroughColors() { for (var i = 0x000000; i &lt;= 0xffffff; i++) { setTimeout(function() { setColor(i); }, i); } } This way you are giving an anonymous function with no parameters to setTimeout, but that function happens to have the parameter that you want. As Bergi said, when you try to pass the parameter i to setColor, you're really just evaluating the statement setColor(i). Instead you need to give the name itself of a function.
answers question: http://stackoverflow.com/q/28709081
upvote count: 1
type: Answer
downvote count: 0

youtube-javascript-api
type: Tag
tags question: http://stackoverflow.com/q/28654637
tag name: youtube-javascript-api

http://stackoverflow.com/comment/45701653
has text: I never mentioned CSS, what I'm trying to say is you should debug it, put a breakpoint just before the second condition, and then in the watch expressions, check what window.location.href is.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28704599

http://stackoverflow.com/q/28627263
score: 2
type: AnsweredQuestion
upvote count: 2
type: Question
has answer: http://stackoverflow.com/a/28649448
tagged with: javascript
has body: I have a table with some dynamic data, and columns as Name,Location, Salary. Problem i am facing in Step 2 i.e multiple condition check. Heres the step by step code. JS Fiddle Demo Step 1- Auto generate Filters i.e dynamically add Checkboxes, depend on table row values autoFilterItem("filterDiv"); Above function generate dynamic checkboxes, logic is it loop over table, read values row by row and return unique value array and generate checkbox respectively, currently am doing for 2 cols having class loc,sal. Step 2- Checkbox change event, depend on status (checked/unchekced) table rows will be hide/show . The problem i am facing is, if user checked 100 ( class as sal), and Kerala ( class as loc) is unchecked then row having kerala should be hide. For hide and show am adding/removing class .hideRow ///STEP TWO // On any checkbox clicked returns desired out $("body").on('change', '.chk', function () { var arrObj = [], arrCheckedValueCLass = []; var objCheckedData = {}; $("#filterDiv .chk").each(function (index, val) { var sf = $(this); if (sf.is(":checked")) { var sf = $(this); arrObj.push({ dataValue: $(sf).attr('data-value'), dataClass: $(sf).attr('data-class') }); } }); var self = $(this); var getClassName = self.attr("data-class"); var matchTextValue = $.trim(self.attr("data-value")); if (self.is(":checked")) { if (matchTextValue == "All") { $(".chk").prop('checked', true); } $("." + getClassName).each(function () { var innerSelf = $(this); var gVal = $.trim(innerSelf.html()); if (matchTextValue == "All") { innerSelf.closest("tr").removeClass("hideRow"); } else { if (matchTextValue === gVal) { console.log("checked and matchTextValue"); var i = 0, lg = arrObj.length; var flagSet = false; for (i; i < lg; ++i) { var objValue = arrObj[i].dataValue; var objClass = arrObj[i].dataClass; if (getClassName != objClass) { var prevDataCheck = $.trim(innerSelf.closest("tr").find("." + objClass).html()); if (prevDataCheck == objValue) { flagSet = true; return true; } } } if (!fl…
has title: How to filter Table row with multiple condition .ie on checkbox selection show respected row. each checkbox represent Column and row value
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28649448

http://stackoverflow.com/q/28606237
tagged with: css
tagged with: media-queries
downvote count: 1
type: Question
upvote count: 0
tagged with: javascript
tagged with: jquery
score: -1
has title: Expand menu based on width available
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28606732
answer count: 1
has body: I've been investigating ways of creating a responive menu. The standard technique would be to use a navicon on smaller devices which would trigger some kind of fly out/drop down menu. I would like the most common options to show on screen, so I came up with the idea of a nav-bar, consisting of only a few important menu items, which would be visible on smaller devices. This would still need the navicon to display any additional items. I then came across a menu which fulfills my requirements better in that it is more dynamic. The concept is that the menu grows as the screen size grows, but only displays an option when there is enough screen width to accomodate it fully. The remaining options are tucked beneath a dynamic navicon. Here is the menu: http://www.money.co.uk/ As you will see changing the screen width changes the available options. I could produce a semi-dynamic version using my media query breakpoints, but it would be good to be able to create a fully dynamic version. I'm guessing that it uses javascript - but as far as the techinque to be able to determine the available space and the space required, I don't know where to start. I have some basic js/jquery knowledge, but would appreciate it if anyone could give me some guidance on how to go about approaching this one. Thanks in advance.
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/28646433
tagged with: referrer
has body: I'm having some trouble using document.referrer on some sites, even the reference site using HTTP protocol. In what circumstances document.referrer may be empty (except HTTPS to HTTP)? What is the best way to get the url reference only document.referrer? In my site, document.referrer is empty, but when I look in Analytics website of references appears.
upvote count: 9
tagged with: javascript
has answer: http://stackoverflow.com/a/28648957
answer count: 4
has answer: http://stackoverflow.com/a/74527089
has title: Problems with document.referrer
has answer: http://stackoverflow.com/a/71908762
type: AnsweredQuestion
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/57284583
score: 9
type: Question
accepted answer: http://stackoverflow.com/a/28648957
has answer: http://stackoverflow.com/a/57284583
linked to: http://stackoverflow.com/q/385367

http://stackoverflow.com/q/28632865
favorite count: 0
has answer: http://stackoverflow.com/a/28638073
tagged with: sql-server
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45571339
has comment: http://stackoverflow.com/comment/45565988
has comment: http://stackoverflow.com/comment/45574468
score: 1
upvote count: 1
linked to: http://stackoverflow.com/q/8728128
has comment: http://stackoverflow.com/comment/45569106
type: AnsweredQuestion
has body: Hello I've ran into an issue that is stumping me: So I have an ngOption that loops through and displays unicode symbols &lt;select class="form-control symbolSelect" ng-model="input.loadSymbol" ng-options="d as d.TagShpUTF for d in loadSymbols" ng-change=""&gt;&lt;/select&gt; Here is an example jsFiddle showing it working: http://jsfiddle.net/tjm9a6o2/ I set up the datasource to have a unicode character like so: loadsymbols[0].TagShpUTF = '\u2660' This all works fine as static data, but when I try to pull the data from my DB it displays it as regular text and doesn't seem to know it's special unicode characters. This is how I have it setup in the DB (Don't mind other columns, TagShpUTF is the important one): ...what I think it's doing is automatically add a second slash '\' so it can be a valid string, but I don't want that to happen. I want it to be recognized as unicode so it shows the symbols in my dropdown (like jsFiddle), but instead it's showing the actual text (like '\u2660'). Any suggestions would be very helpful. Really need a way of storing these symbols and loading them into a drop down. I tried HTML unicode symbols, but they were giving me even more problems than this method. Thanks!
has comment: http://stackoverflow.com/comment/45574371
has comment: http://stackoverflow.com/comment/45566514
has comment: http://stackoverflow.com/comment/45571157
tagged with: javascript
has comment: http://stackoverflow.com/comment/45574412
has comment: http://stackoverflow.com/comment/45566137
type: Question
accepted answer: http://stackoverflow.com/a/28638073
has comment: http://stackoverflow.com/comment/45574572
tagged with: ng-options
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45566324
has title: using unicode symbols in ngOption
tagged with: unicode

http://stackoverflow.com/q/28649100
has body: How to select elements that have a specific data- attribute with jQuery ? The value doesn't matter. Lorem Ipsum Dolor Lorem Ipsum Dolor Lorem Ipsum Dolor Lorem Ipsum Dolor Lorem Ipsum Dolor I want to select all the elements (not just anchors) that have "data-apple" attribute. How to do it? I want to attach an event handler (on click) to each one of them.
type: AnsweredQuestion
has title: How to select elements that have a specific data- attribute with jQuery ? Value doesn't matter
downvote count: 2
type: Question
score: -2
has answer: http://stackoverflow.com/a/28649118
tagged with: javascript
has answer: http://stackoverflow.com/a/28649194
answer count: 2
upvote count: 0
linked to: http://stackoverflow.com/q/4333720
possible better answer: http://stackoverflow.com/a/28649194
tagged with: jquery
favorite count: 0
duplicate of: http://stackoverflow.com/q/4333720
accepted answer: http://stackoverflow.com/a/28649118
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45744735
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28725052
has text: I don't know why you're getting the repeat, but the real issue here is that your error handling is not robust enough to always return an appropriate response. While it's reasonable to try to figure out why node is doing what it's doing, you should work on your error handling so that an appropriate response is always returned. My guess is that you are hitting a server response timeout and then getting some sort of default behavior for that timeout. See [here](http://nodejs.org/api/all.html#all_response_settimeout_msecs_callback) for how to do your own timeout handling.

http://stackoverflow.com/comment/45699208
comment on: http://stackoverflow.com/q/28704793
type: QuestionComment
type: Comment
score: 1
has text: Possible Duplicate: http://stackoverflow.com/questions/1423777/javascript-how-can-i-check-whether-a-radio-button-is-selected

http://stackoverflow.com/q/28628287
has comment: http://stackoverflow.com/comment/45557276
has comment: http://stackoverflow.com/comment/45557389
favorite count: 0
has comment: http://stackoverflow.com/comment/45557408
has comment: http://stackoverflow.com/comment/45557637
has comment: http://stackoverflow.com/comment/45557561
type: Question
downvote count: 2
has answer: http://stackoverflow.com/a/28629756
score: -2
tagged with: php
has comment: http://stackoverflow.com/comment/45557116
has body: ok, i don't know if this is the proper way of doing this. If not, please give me an example on how to do it. How do i fetch the data in the JS and send it to html? JS $(document).ready(function() { var choosenYear = $('#choose_year'); $("#choose_year").select2({ data: [{ id: 0, text: '2015' }, { id: 1, text: '2014' }], val: ["0"] }).select2('val', 0); // Start Change $(choosenYear).change(function() { var choosenYear = $(choosenYear).select2('data').id; $('#choosen_year').val(choosenYear); }); //Change }); HTML &lt;form class="form-inline well col-md-8" id="form-choose_usr" action="#" method="post" enctype="multipart/form-data"&gt; //This is what i POST &lt;div&gt; &lt;input type='hidden' class='col-md-4' id='choose_usr_email' name='choose_usr_email'&gt; &lt;/div&gt; &lt;!-- Select2 choose_year --&gt; &lt;div&gt; &lt;input type='hidden' class='col-md-2' id='choose_year' name='choose_year'&gt; &lt;/div&gt; &lt;!-- Select2 choose_month --&gt; &lt;div&gt; &lt;input type='hidden' id='choosen_year' name='choosen_year'&gt; &lt;input type="submit" class="btn btn-info pull-right" value="Hämta" /&gt; PHP //And this is how i fetch it $posted_choosen_year = $_POST['choosen_year']; echo $posted_choosen_year;
has comment: http://stackoverflow.com/comment/45557528
has comment: http://stackoverflow.com/comment/45557454
has title: Send data from javascript to html and fetch with php
answer count: 3
possible better answer: http://stackoverflow.com/a/28629122
has answer: http://stackoverflow.com/a/28629122
has comment: http://stackoverflow.com/comment/45557308
has comment: http://stackoverflow.com/comment/45557061
accepted answer: http://stackoverflow.com/a/28629756
upvote count: 0
has comment: http://stackoverflow.com/comment/45557242
has answer: http://stackoverflow.com/a/28631641
has comment: http://stackoverflow.com/comment/45558108
tagged with: javascript
has comment: http://stackoverflow.com/comment/45557164
tagged with: jquery-select2
has comment: http://stackoverflow.com/comment/45557468
has comment: http://stackoverflow.com/comment/45557752
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45557665
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45669095
type: QuestionComment
has text: Can you post your code of your directive ??
comment on: http://stackoverflow.com/q/28688483
score: 0
type: Comment

eclipse
tags question: http://stackoverflow.com/q/28648379
tag name: eclipse
tags question: http://stackoverflow.com/q/28650487
tags question: http://stackoverflow.com/q/28684137
tags question: http://stackoverflow.com/q/28655274
type: Tag

http://stackoverflow.com/q/28667671
answer count: 1
downvote count: 0
score: 1
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: JavaScript - Inserting into Content section of HTML
upvote count: 1
has comment: http://stackoverflow.com/comment/45630036
type: Question
has answer: http://stackoverflow.com/a/28668854
tagged with: javascript
has body: I want my program to work like this: When i press a hyperlink in html, i want it to load new content into the "content" section. I have an example code that does this. But I am trying to insert a dygraph inside and I find that the example only passes string. The graph that i was trying to insert did not appear in the content, only basic html appeared (button, background color, etc) function loadPage(page) { if(window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET", page, true); xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttp.send(); xmlhttp.onreadystatechange = function () { if((xmlhttp.readyState == 4) &amp;&amp; (xmlhttp.status == 200)) { document.getElementById("content").innerHTML = xmlhttp.responseText; } } } If i'm not wrong, the loadPage function needs to be edited. But i'm not sure how. Hope you guys can answer me in a layman's term.
has comment: http://stackoverflow.com/comment/45631065

http://stackoverflow.com/a/28633971
accepted answer of: http://stackoverflow.com/q/28633814
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
score: 2
has body: I think the only way is to define success function for each ajax function like this : $.ajax({ url: "...", success: function(html){ //if success }; });
answers question: http://stackoverflow.com/q/28633814

http://stackoverflow.com/a/32089025
downvote count: 0
answers question: http://stackoverflow.com/q/28662977
upvote count: 2
has body: Shawn responded to you question on Pluralsight. Unfortunately, his solution didn't work for me. But I was able to do what you are trying to do using this workaround: First define a hidden field inside your view: &lt;input value="@model.yourData" name="someName" type="hidden" id="dataFromServer"&gt; Then in your controller, access the data by just fetching the hidden element. $scope.serverData = document.getElementById("dataFromServer").value;
type: Answer
score: 2

http://stackoverflow.com/q/28678692
tagged with: android
possible better answer: http://stackoverflow.com/a/28678821
tagged with: angularjs
tagged with: twitter-bootstrap
has body: I built an AngularJS application using few plugins such as angular ui-router, angular-translate... and bootstrap 3. It works for web browser of desktop/laptop. Smartphone with built-in web browser works fine too but I think it's not good enough (battery issue...). So now I need to build native app for mobile OS such as iOS or Android. So which is best way (may use framework or something like that) to build native app with lowest cost (because AngularJS app is already)? If I have to write native app for each mobile OS from scratch, it may consume much time. Please give me some suggestion.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28678809
accepted answer: http://stackoverflow.com/a/28678809
has title: Best way to build native app for mobile (iOS, Android, ...) using already AngularJS app
type: Question
has answer: http://stackoverflow.com/a/28678821
answer count: 2
tagged with: ios
tagged with: javascript
score: 0

http://stackoverflow.com/q/28700137
tagged with: javascript
has comment: http://stackoverflow.com/comment/45690478
has answer: http://stackoverflow.com/a/28701156
score: 0
has comment: http://stackoverflow.com/comment/45690380
has answer: http://stackoverflow.com/a/28700263
has comment: http://stackoverflow.com/comment/45690391
has title: How to assign a PHP variable to a JavaScript variable inside JavaScript code? The whole file is PHP though
tagged with: php
answer count: 4
has body: -------------php code ends here------------- &lt;script type="text/javascript"&gt; var e = &lt;?php echo $tweetText; ?&gt;; var f = twemoji.parse(e); document.write(f); &lt;/script&gt; -------------php code starts here------------- If I put single quotes or double quotes before and after then it matches any ' or " inside the tweetText and doesn't let the string print to screen.
linked to: http://stackoverflow.com/q/5895842
type: AnsweredQuestion
type: Question
possible better answer: http://stackoverflow.com/a/28700263
linked to: http://stackoverflow.com/q/168214
has answer: http://stackoverflow.com/a/28700406
accepted answer: http://stackoverflow.com/a/28700406
has answer: http://stackoverflow.com/a/28700197

http://stackoverflow.com/comment/45722794
comment on: http://stackoverflow.com/a/28717601
score: 0
type: AnswerComment
has text: Your code should look like this: `
type: Comment

http://stackoverflow.com/a/28709848
has comment: http://stackoverflow.com/comment/45708835
has comment: http://stackoverflow.com/comment/45708789
type: Answer
has comment: http://stackoverflow.com/comment/45709187
score: 2
has body: iHateTomatoes has a tutorial that teaches you how to make a preloader with CSS3 and JavaScript.
upvote count: 3
answers question: http://stackoverflow.com/q/28709813
downvote count: 1

http://stackoverflow.com/q/28740024
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28743603
type: Question
has comment: http://stackoverflow.com/comment/45769618
answer count: 1
tagged with: javascript
has title: What will be the parameters of HD image for uploading
tagged with: jquery
score: 0
has body: I want to check whether user is uploading HD image or normal image. Based on what parameters I can know that image is HD. I want to validate to upload only HD images. Thanks in advance!!
accepted answer: http://stackoverflow.com/a/28743603
tagged with: php

http://stackoverflow.com/comment/45607246
comment on: http://stackoverflow.com/q/28647017
type: Comment
type: QuestionComment
score: 1
has text: You should use something like **`jQuery.get('data.php', null, function(tsv) {...}`** for the **setTimeout** function.

http://stackoverflow.com/comment/45654494
type: QuestionComment
type: Comment
has text: @pixie_frigo: There's your answer. This syntax is ES6, which not all browsers support.
comment on: http://stackoverflow.com/q/28680679
score: 0

http://stackoverflow.com/a/28687617
has comment: http://stackoverflow.com/comment/45667620
has comment: http://stackoverflow.com/comment/45667618
has comment: http://stackoverflow.com/comment/45667701
type: Answer
has comment: http://stackoverflow.com/comment/45667681
has comment: http://stackoverflow.com/comment/45667629
has comment: http://stackoverflow.com/comment/45667761
has comment: http://stackoverflow.com/comment/45667710
has comment: http://stackoverflow.com/comment/45667735
has body: This is guaranteed to work: if (sender.parent().hasClass("assistanceRequired")) { // do whatever here } else { // do whatever ELSE here } Only one or the other can ever run when coded correctly since there is only one test and it will either be true or false the single time it is tested. There is no possibility for it to be changed by some side effect you are not aware of, which is most likely what is happening. This is not debatable. If this does not work the way you want then something else is wrong that you are not showing and without an executable jsFiddle good luck convincing anyone that a fundamental thing like the if ... else construct is broken.
has comment: http://stackoverflow.com/comment/45667754
has comment: http://stackoverflow.com/comment/45667729
score: 0
answers question: http://stackoverflow.com/q/28687568
upvote count: 1
type: AcceptedAnswer
downvote count: 1
has comment: http://stackoverflow.com/comment/45667591
accepted answer of: http://stackoverflow.com/q/28687568

http://stackoverflow.com/a/31517695
score: 12
downvote count: 1
accepted answer of: http://stackoverflow.com/q/28717819
has comment: http://stackoverflow.com/comment/51023767
answers question: http://stackoverflow.com/q/28717819
type: Answer
has comment: http://stackoverflow.com/comment/51016126
type: AcceptedAnswer
upvote count: 13
has body: In your webpack.config.js, use the following preLoaders (or postLoaders), module: { preLoaders: [ { test: /\.js$/, loader: "transform?envify" }, ] } Another way using the webpack.DefinePlugin: plugins: [ new DefinePlugin({ 'process.env': Object.keys(process.env).reduce(function(o, k) { o[k] = JSON.stringify(process.env[k]); return o; }, {}) }) ] NOTE: The old method using envify-loader was deprecated: DEPRECATED: use transform-loader + envify instead.

http://stackoverflow.com/comment/45502043
type: Comment
has text: Once again, I give input after the fact. Still, sometimes it's good to see the code in action, so I'll leave it up.
comment on: http://stackoverflow.com/a/28597859
type: AnswerComment
score: 0

http://stackoverflow.com/a/28636205
has body: Without fully knowing what is going on under the covers, I'm going to take a guess that you have an async operation happening outside of the "Angular-world". In other words, Angular is not aware that a change to a scope-exposed variable has happened and a digest cycle is not triggered, until you have clicked on a button with ng-click, for example, that triggers a digest. The likely place where it is happening is here: QB.data.list("Comments", data, function(err, result) { }); This is an async operation, correct? With the handler function invoked on completion? If you assign anything to the scope variable there, it would not be visible to Angular, unless you invoke $scope.$apply. Let's assume you factored out the current handler function as yourCurrentHandler: function yourCurrentHandler(err, result){ // whatever you do right now // ... } QB.data.list("Comments", data, function(err, result) { $scope.$apply(function(){ yourCurrentHandler(err, result); }); }); plunker with an illustrative example
has comment: http://stackoverflow.com/comment/45572953
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45573146
accepted answer of: http://stackoverflow.com/q/28636035
type: Answer
answers question: http://stackoverflow.com/q/28636035
has comment: http://stackoverflow.com/comment/45573287
has comment: http://stackoverflow.com/comment/45573369
upvote count: 1
score: 1

http://stackoverflow.com/a/28743798
answers question: http://stackoverflow.com/q/28743617
has body: Why were you adding a second click handler to #texts? There's one click handler here: $('.no-js li a').on("click", function () { //... }); But then there's another one here: $('.no-js li a#texts').on("click", function () { //... }); So while clicking on any other menu invokes only the first handler, clicking on #texts invokes both. It looks like you only want the first.
downvote count: 0
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/45603805
score: 0
comment on: http://stackoverflow.com/q/28653078
type: Comment
type: QuestionComment
has text: Give `$scope.item.name = 'the item'` a try..

http://stackoverflow.com/comment/45637269
type: Comment
comment on: http://stackoverflow.com/q/28669830
score: 0
has text: can i ask the jquery library version you are using?
type: QuestionComment

http://stackoverflow.com/q/28652956
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28653280
tagged with: jquery
tagged with: css
type: UnansweredQuestion
has title: Tooltip positioning with jQuery's .offset()
type: Question
has body: UPDATE - Still unresolved, last updated 9 p.m. Problem a) How do I use .offset() to position these tooltips relatively close to their image (ie. If I click on the "Allum" headshot, their tooltip pops up above their image) Where I'm at I'm trying to use jQuery's .offset() so that when an image (.headshot in index.html) of a politician is clicked, the tooltip/popup, containing information about their age, party etc. is positioned pretty close to their image. Right now I have dynamic content being pulled into these tooltips, but it's always in the same spot. scripts.js (Politician and Positioning snippet) // Shows a popup with MLA information $(".headshot").click(function(){ var idx = $(this).index(); $(".tooltip").fadeIn("slow"); $(".tooltipName").html(MLAs[idx].Name); $(".tooltipParty").html(MLAs[idx].Party).prepend("Party: "); $(".tooltipConstuency").html(MLAs[idx].Constuency).prepend("Constuency: "); $(".tooltipEthnicity").html(MLAs[idx].Ethnicity).prepend("Ethnicity: "); $(".tooltipAge").html(MLAs[idx].Age).prepend("Age: ").append(" years old"); }); // Positioning of the tooltips $('img').each(function(){ var img = $(this); img.click(function(){ $('.tooltip').show(100) // .text(img.attr('alt')) .offset({ top: img.offset().top + img.height(), left: img.offset().left }); }); }); index.html(Headshot snippet) tooltip.scss /*---------------------------------- TOOLTIP ----------------------------------*/ .tooltip { display: none; position: relative; left: 45px; top: -5px; } .info { @include serifLight; background: $yellow; color: $black; font-size: 1.4rem; padding: 12px; width: 15%; // text-align: center; p { margin: 0px; padding-top: 2%; } } .tooltipName, { font-family: 'Roboto Slab',serif; font-weight: 700; } .label { color: $b; display: inline; padding-top: 1.5%; } .tooltipEthnicity, .tooltipAge { display: block; } .arrow-down { width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent; border-top: 20px solid $yellow; position: re…
score: 0

http://stackoverflow.com/comment/45519027
score: 0
type: QuestionComment
type: Comment
has text: The line you've posted (assuming it is an inline click handler) doesn't throw any errors.
comment on: http://stackoverflow.com/q/28607398

http://stackoverflow.com/q/28640077
type: Question
has answer: http://stackoverflow.com/a/28642228
has body: I am really confused on how to build a typical REST type web app with Node.js (even though I am using Sockets). In a typical WAMP stack you have a public javascript file and server-side PHP files. The user might be able to execute a JS function like function updateDetails(){ $.post('details.php', formData, function(data){ console.log(data); },'json'); } And the server-side PHP file is something like var stmt = "UPDATE table SET user = :user"; var params = (':user', $user); stmt-&gt;execute(); Now I do know about node-mysql, but I don't see how it is implemented in the same way. How can I maintain a list of statements on the server side and allow the user to simply execute these statements on the client side. I have node_modules/mysql installed. In my server (app.js) var mysql = require('mysql'); But unless I add all my statements there, I don't seem to be able to access them from a public JS file.
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45579304
score: 0
accepted answer: http://stackoverflow.com/a/28642228
has title: How to build a typical REST type system with Node.js
tagged with: node.js
type: AnsweredQuestion
tagged with: mysql

http://stackoverflow.com/a/28651539
score: 1
has comment: http://stackoverflow.com/comment/45600485
upvote count: 1
has body: I think update will simply update existing records, not remove them. It looks for items in the returned array and updates them accordingly. If you want to use your trimArray, you'll have to empty the collection and then reinsert the trimArray results (terrible idea). Instead, you should set your collection up correctly to not store duplicates in the first place. You'll want to set up a unique index, and then you'll never have to purge. See the docs for details. db.things.ensureIndex({'photos.make_some_key' : 1}, {unique : true, dropDups : true})
accepted answer of: http://stackoverflow.com/q/28651281
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45600467
answers question: http://stackoverflow.com/q/28651281
type: Answer

http://stackoverflow.com/a/28604749
has body: You can use html2canvas js library to take a screen shot and then use canvas in javascript to download/save. HTML Download JS/jQuery $("#save-img").click(function () { html2canvas(document.body, { onrendered: function(canvas) { document.location = canvas.toDataURL("image/png"); } }); }); Or read this article if you want to achieve this in asp.net using DataVisualization. Hope that helps.
accepted answer of: http://stackoverflow.com/q/28604444
answers question: http://stackoverflow.com/q/28604444
type: AcceptedAnswer
score: 0
type: Answer

http://stackoverflow.com/a/28634595
has body: Assuming you do place an onclick on each article .. inside of your function, you could do this: function selectthis(THIS) { //remove the css classes from all articles var articles=document.getElementsByTagName('article'); for(var a=0;a&lt;articles.length;a++){ articles[a].setAttribute('class',''); } //add class back on for this article THIS.className = "countrySelected"; }
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28634316

http://stackoverflow.com/a/28662541
has body: The cause of the unexpected output with no values after the decimal is here: if (age &lt; 4 &amp;&amp; age &gt; 0) { document.getElementById('tickPrice').innerHTML = '$' + TICKET_PRICE_1; } else if (age &gt;= 4 &amp;&amp; age &lt;= 16) { document.getElementById('tickPrice').innerHTML = '$' + TICKET_PRICE_2; } else if (age &gt; 16) { document.getElementById('tickPrice').innerHTML = '$' + TICKET_PRICE_3; } When you want a set precision after the decimal point, use toFixed(), changing the code to: if (age &lt; 4 &amp;&amp; age &gt; 0) { document.getElementById('tickPrice').innerHTML = '$' + TICKET_PRICE_1.toFixed(2); } else if (age &gt;= 4 &amp;&amp; age &lt;= 16) { document.getElementById('tickPrice').innerHTML = '$' + TICKET_PRICE_2.toFixed(2); } else if (age &gt; 16) { document.getElementById('tickPrice').innerHTML = '$' + TICKET_PRICE_3.toFixed(2); } Note that this is a display convention, and not actually mutating the number represented. The second issue is the use of prompt() var age=prompt("Enter Customer's Age: ", "") prompt() returns a String and would need to be parsed. You could: var age = parseInt(prompt("Enter Customer's Age: ", "")); Why not use floating points for money As an ancillary to your question and response to comments, consider the following reasonable situation. var price = 0.10; var fee = 0.20; var total = price + fee; Floating point numbers can't represent all values exactly. Since JavaScript numbers are all floating point numbers, integers within a range are a safe thing (-(2^53 - 1) to 2^53 - 1 specifically). So if you output total, you'll get 0.30000000000000004 That's incorrect, that's supposed to be 0.30.
answers question: http://stackoverflow.com/q/28662430
upvote count: 2
score: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28662430
type: Answer

http://stackoverflow.com/a/28750920
score: 0
answers question: http://stackoverflow.com/q/28731450
type: Answer
has body: Check out following Code snippet. hope this is will help you. Steps I have performed Created one viewmodel with class Item with subscribe on change of isChecked property. There is Obsservable array of list items which will contain isChecked property. Finally on change of value it will call the sorting by selecting value on change in any item. function SomeViewModel() { var self = this; self.chkLists = ko.observableArray([]); function Item(isChecked, name) { this.isChecked = ko.observable(isChecked); this.name = ko.observable(name); this.isChecked.subscribe(function (newValue) { self.chkLists.sort(function (l) { return l.isChecked() === false }); }) } self.chkLists = ko.observableArray([ new Item(false, "Bear"), new Item(false, "Hippo"), new Item(false, "Lion"), new Item(false, "Tiger"), new Item ( false, "Zebra" ) ]); } $(document).ready(function () { var divEle = $("#sortedList")[0]; ko.applyBindings(SomeViewModel, divEle); })

http://stackoverflow.com/comment/45690458
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28699272
has text: so, here is my completed fiddle: http://jsfiddle.net/bwefs1ak/2/ please take a look to the tooltip now. I added a point format for 'Hamburg Frontmonat' only. There should be the difference behind "Basis: " ('Hamburg Frontmonat' - 'Matif'). Thanks a lot !!!
type: AnswerComment

http://stackoverflow.com/comment/45783928
comment on: http://stackoverflow.com/q/28750179
has text: That has a different error: `Uncaught SyntaxError: Unexpected end of input`
score: 0
type: Comment
type: QuestionComment

angular-ui-router
tags question: http://stackoverflow.com/q/28614338
tags question: http://stackoverflow.com/q/28748866
tags question: http://stackoverflow.com/q/28648394
tags question: http://stackoverflow.com/q/28711513
tags question: http://stackoverflow.com/q/28664473
tags question: http://stackoverflow.com/q/28618039
tags question: http://stackoverflow.com/q/28727173
tag name: angular-ui-router
tags question: http://stackoverflow.com/q/28620338
tags question: http://stackoverflow.com/q/28739108
tags question: http://stackoverflow.com/q/28692356
tags question: http://stackoverflow.com/q/28649395
tags question: http://stackoverflow.com/q/28749378
tags question: http://stackoverflow.com/q/28730322
tags question: http://stackoverflow.com/q/28664278
tags question: http://stackoverflow.com/q/28594810
tags question: http://stackoverflow.com/q/28666452
type: Tag
tags question: http://stackoverflow.com/q/28618191
tags question: http://stackoverflow.com/q/28639965

http://stackoverflow.com/q/28709053
favorite count: 0
has title: JQuery Resizable Touchscreen
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28727486
upvote count: 7
type: AnsweredQuestion
score: 7
has comment: http://stackoverflow.com/comment/45729356
type: Question
downvote count: 0
tagged with: jquery-mobile
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28727486
has comment: http://stackoverflow.com/comment/45741161
has body: i am using jQuery resizable method to resize the div, its working fine with mouse but on touchscreen its not working..it doesn't show the re-sizable cursor and doesnt resize with touch device. like android samsung tablet please let me how how to fix this. plunker http://plnkr.co/edit/mU18FfjoXRHgRkzAvIcx?p=preview please guide me how to proceed further on touch device. &lt;!doctype html&gt;

http://stackoverflow.com/a/28712959
has comment: http://stackoverflow.com/comment/45716552
has comment: http://stackoverflow.com/comment/45716227
score: 0
answers question: http://stackoverflow.com/q/28712860
type: Answer
has body: Try this $('#&lt;%= TextBox1.ClientID%&gt;').keyup(function () { $('&lt;%= Label1.ClientID %&gt;').text($(this).val()); });

http://stackoverflow.com/comment/45722277
comment on: http://stackoverflow.com/q/28717151
score: 0
type: Comment
type: QuestionComment
has text: Make especially sure that the closure objects are cleaned up.

http://stackoverflow.com/q/28743466
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45771396
tagged with: three.js
answer count: 0
tagged with: collada
has title: THREE JS Collada performance issue
has body: I have the following code which load a collada model to THREE.js, i clone it to 100 one then add each one to the scene, everything is ok but after loading the performance become very bad although they are only 100 objects and i plan load about 10000 objects for about 100 model. var loader=new THREE.ColladaLoader(); loader.options.convertUpAxis = true; var gc=new THREE.Object3D(); loader.load("resources/models/274.dae",function(collada){ for(var i=0;i&lt;100;i++){ var c=collada.scene.clone(); c.position.set(i,0,i*Math.random()); scene.add(c); } },function(xhr){ var percentComplete = xhr.loaded / xhr.total * 100; document.getElementById("sload").innerHTML="Scene, Mountain Downloaded: "+ Math.round(percentComplete, 2) + '%'; }); what should i do for best performance?
type: Question
has comment: http://stackoverflow.com/comment/45769685
has comment: http://stackoverflow.com/comment/57691846
tagged with: javascript
has comment: http://stackoverflow.com/comment/45770270
score: 0
has comment: http://stackoverflow.com/comment/45770022
has comment: http://stackoverflow.com/comment/45771308
has comment: http://stackoverflow.com/comment/45771424

http://stackoverflow.com/a/28685985
has comment: http://stackoverflow.com/comment/45665060
has body: I suggest you use a JS Validation Library as a fallback to HTML5 Validation (jQuery Validation is pretty neat). Either way, listen for submit event on the form (if using $.validation use the submitHandler config key). $('form#youId').on('submit', function(e){ e.preventDefault(); setTimeout(function(){ // your fliying animation // when your flying animation ENDS e.target.submit(); // this SENDS the actual form. }, 1000); }); EDIT see this Working Example. REMARKS on your demo Your demo didn't have jQuery Validate js file included, so it failed on .validate() method invocation. Also Your demo got a missing }); which produced an Unexpected End of Input error. New demo uses a custom Event to trigger form submit after animation has ended (actually when 1sec past after triggered).
score: 0
has comment: http://stackoverflow.com/comment/45665013
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28685912
type: Answer
accepted answer of: http://stackoverflow.com/q/28685912

http://stackoverflow.com/comment/45874598
type: AnswerComment
comment on: http://stackoverflow.com/a/28684141
has text: It doesn't respond to vertical height change. It only responds to width change.
type: Comment
score: 0

http://stackoverflow.com/comment/45717402
type: Comment
type: QuestionComment
has text: This may help you. You could handle an error directly on the element itself. For example:
comment on: http://stackoverflow.com/q/28714678
score: 0

http://stackoverflow.com/comment/45777686
type: Comment
comment on: http://stackoverflow.com/q/28747576
has text: An attempt to re-state your problem : you have an array "A" of characters, and a message M. You want to scramble M's chars and insert them, randomly, into A. Is this it ?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45528590
comment on: http://stackoverflow.com/q/28611473
has text: Wow, I was querying the wrong database. Thanks.
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/comment/45737331
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28724862
score: 0
has text: @AshtonFrench I appreciate all the help with this. Unfortunately, it is still not functioning. I took the updated code to JSFiddle and it isnt working as well. Here is the page: http://jsfiddle.net/ro2dv5k1/2/ . I tried it with and without the document ready code to no avail.

http://stackoverflow.com/q/28748337
downvote count: 0
has body: In Express 4, by default, routes are loaded from a separate file: app.use('/', routes); Would load routes/index.js. I have a third-party library that attaches to app itself. Is there a preferred way to access app from inside routes/index.js? I've thought about dependency injection ie, routes/index.js does module.exports = function(app){ (routes go here) } and then: app.use('/', routes(app)) But I wonder if there's a better way. What's the best way to access the express 'app' object from inside a separate route file?
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/28749318
has answer: http://stackoverflow.com/a/28748747
accepted answer: http://stackoverflow.com/a/28748747
upvote count: 6
tagged with: javascript
tagged with: express
has answer: http://stackoverflow.com/a/28749318
favorite count: 0
score: 6
tagged with: node.js
type: AnsweredQuestion
has title: What's the best way to access the express 'app' object from inside a separate route file?

http://stackoverflow.com/q/28708216
linked to: http://stackoverflow.com/q/19707969
possible better answer: http://stackoverflow.com/a/28708312
has comment: http://stackoverflow.com/comment/45733663
has answer: http://stackoverflow.com/a/28708312
accepted answer: http://stackoverflow.com/a/28708311
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28708300
has comment: http://stackoverflow.com/comment/45707799
has answer: http://stackoverflow.com/a/28708371
has title: Why "this" refers to Window in forEach in javascript?
has comment: http://stackoverflow.com/comment/45712548
has answer: http://stackoverflow.com/a/28708470
has comment: http://stackoverflow.com/comment/45707777
has comment: http://stackoverflow.com/comment/45706302
downvote count: 1
type: Question
has body: If I run this code, window object gets printed to console. var arr= [1,2,34,5,6,7,7,8]; arr.forEach(function(e){ console.log(this); }); Why does it not refer to arr object or specific items in array object? I want to understand the reason behind it, like what's going on. this gets defined using by new, or the object invoking this function, right?
answer count: 8
score: 3
duplicate of: http://stackoverflow.com/q/19707969
has comment: http://stackoverflow.com/comment/45706040
tagged with: javascript
upvote count: 4
has comment: http://stackoverflow.com/comment/45706528
has answer: http://stackoverflow.com/a/28708311
has answer: http://stackoverflow.com/a/28708349
tagged with: arrays
has answer: http://stackoverflow.com/a/28708395
has comment: http://stackoverflow.com/comment/45708116
has comment: http://stackoverflow.com/comment/45705844
has answer: http://stackoverflow.com/a/28708283
favorite count: 0
has comment: http://stackoverflow.com/comment/45733773

http://stackoverflow.com/q/28631427
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45563007
has title: jQuery background-position animation to run more smoothly
has answer: http://stackoverflow.com/a/28631694
accepted answer: http://stackoverflow.com/a/28631694
has answer: http://stackoverflow.com/a/28631570
type: Question
linked to: http://stackoverflow.com/q/21087518
has comment: http://stackoverflow.com/comment/45562844
tagged with: javascript
tagged with: jquery
has body: I have a pattern background animation in jQuery made like this. banner.css('backgroundPosition', x + 'px' + ' ' + y + 'px'); window.setInterval(function() { banner.css("backgroundPosition", x + 'px' + ' ' + y + 'px'); y--; }, 150); Live example http://codepen.io/anon/pen/emMxXa But it is rather 'jittery'. How can I make something like this to run more smoothly and slowly.
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/28631570
has answer: http://stackoverflow.com/a/28631586
tagged with: css

http://stackoverflow.com/q/28607164
linked to: http://stackoverflow.com/q/10872382
answer count: 1
has answer: http://stackoverflow.com/a/28607519
accepted answer: http://stackoverflow.com/a/28607519
tagged with: javascript
has body: Hi i am trying to read forbes.com 's thought of the day in my Java program. But in the view source of the webpage i am not getting the output rendered on the html page. Any clues as to how to read the rendered output? Heres the source code of website where i am reading the thoughts from. I have minimised and removed all clutter and kept it as basic as possible. Heres the view source of the site Here's my Java program public class extractor { public static void main(String args[]) throws Exception{ extractor t = new extractor(); t.connect(); } public void connect() throws Exception { URL obj = new URL("http://localhost:8080/q2p/thought.html"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); System.out.println(response.toString()); } } Here's the program output [SOLUTION] Well after some help from meister_reineke heres the java code which works :) and solves the problem. public class extractor { public static void main(String args[]) throws Exception{ extractor t = new extractor(); t.connect(); } public void connect() throws Exception { URL obj = new URL("http://localhost:8080/q2p/thought.html"); WebClient webClient = new WebClient(BrowserVersion.CHROME); HtmlPage myPage = ((HtmlPage) webClient.getPage(obj)); System.out.println(myPage.asText()); webClient.closeAllWindows(); } } The output for the above code is Patience strengthens the spirit, sweetens the temper, stifles anger, extinguishes envy, subdues pride, bridles the tongue. Share Facebook Twitter LinkedIn Google George Horne
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: How to read JavaScript output text in a Java Program
type: AnsweredQuestion
tagged with: java
type: Question

http://stackoverflow.com/comment/45636673
type: Comment
has text: `date.start = picker.startDate._d.toUTCString(); date.end = picker.endDate._d.toUTCString();` Save the values as UTCString and while re using it use as `new Date(date.start)`
type: AnswerComment
comment on: http://stackoverflow.com/a/28667094
score: 0

http://stackoverflow.com/a/28681747
accepted answer of: http://stackoverflow.com/q/28681667
has body: As long as the calls don't depend on each other, you can run them all in parallel using the async library, https://github.com/caolan/async .
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28681667

http://stackoverflow.com/a/28626390
has comment: http://stackoverflow.com/comment/45553527
score: 1
has body: You doing it wrong in isEven itself.. Do it like.. var isEven = function(number) { return number% 2 == 0; }
upvote count: 1
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/28626279

http://stackoverflow.com/q/28649766
accepted answer: http://stackoverflow.com/a/28649905
downvote count: 0
favorite count: 0
score: 13
has title: Request animation frame called constantly
upvote count: 13
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28649905
tagged with: rendering
possible better answer: http://stackoverflow.com/a/39648853
has body: Trying to understand RequestAnimationFrame and how it works internally. Browser has a main thread which is an event loop. The event loop can be populated with various asynchronous events like user interaction, timers getting fired, network calls completing and events triggering layout and painting e.g. input or JS. So, when a JS function invalidates the layout of the DOM or causes repaint, the browser's main thread repaints the layers that need updating and the compositor thread uploads the updated textures to the GPU where final compositing occurs and the resulting image is displayed onto the screen. So, I have the impression that browsers only perform paint when actually required. If you capture events on Chrome Dev Tools timeline on a static page with nothing happening, absolutely no events are captured (no layout, no paint, no animation frame fired). Makes sense. But then you run the following code on the console, function onBeforeNextRepaint() { requestAnimationFrame(onBeforeNextRepaint); console.log('About to paint ...'); } onBeforeNextRepaint(); Now, you capture the timeline events again and you notice the 'Animation Frame Fired' events and your console gets logged with 'About to paint ...'. According to MDN, The Window.requestAnimationFrame() method tells the browser that you wish to perform an animation and requests that the browser call a specified function to update an animation before the next repaint. That means the browser is constantly painting and therefore calling my function to log the message before each repaint. I am guessing the browsers maintain a scheduler that makes the paint calls at the rate that matches the refresh rate of the screen. Now my confusion lies on the following: Is the browser's main thread constantly repainting, generating textures and uploading textures to the GPU and making draw calls (throttled to match the refresh rate of the screen)? (Sounds inefficient) Is that the reason why my 'onBeforeNextRepaint' callback gets called…
has answer: http://stackoverflow.com/a/39648853
type: Question
tagged with: browser
answer count: 2
tagged with: requestanimationframe
tagged with: javascript

http://stackoverflow.com/a/28668063
answers question: http://stackoverflow.com/q/28656696
accepted answer of: http://stackoverflow.com/q/28656696
score: 0
type: AcceptedAnswer
type: Answer
has body: AngularJS uses jqLite, a small subset of jQuery. The problem in your case is that jqLite doesn't support script tags. The AngularJS team decided not to implement this since getting it to work on all supported browsers involves a lot of code. jQuery however supports script tags. So to get it to work you will need to load jQuery before AngularJS, which will make AngularJS use jQuery instead of jqLite. This means that the following line is of course redundant and can be removed: &lt;script src="http://codepen.io/assets/libs/fullpage/jquery.js"&gt;&lt;/script&gt; Demo: http://plnkr.co/edit/Pjg0ZrGmDD8WfG4tqXxG?p=preview

http://stackoverflow.com/comment/45680875
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28682385
has text: Can you clarify, possibly in the original question, if this file needs to be returned as part of the process and why having the server pause to do this work is unreasonable?
score: 0

http://stackoverflow.com/comment/45686742
type: Comment
comment on: http://stackoverflow.com/a/28686253
has text: This article gives a better idea of what I am trying to achieve.. http://stackoverflow.com/questions/16160707/casperjs-how-to-click-multiple-links-in-a-table-while-collecting-data-from-the-w - however, I haven't got as far as figuring if the click is working or not...
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45667046
type: Comment
has text: @Quentin i've seen the answer you were referring to but when running that example it has an error and i am not also sure if it was successfully upload since there was no confirmation also i dont see any jquery plugin that were is there so i can replicate his sample..
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28644200

http://stackoverflow.com/a/28653660
answers question: http://stackoverflow.com/q/28653651
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28653651
type: Answer
has comment: http://stackoverflow.com/comment/45604562
upvote count: 1
score: 1
has body: Changes.available needs to be on $scope ... var changes = { available : false }; ... to ... $scope.changes = { available : false }; This should do it. The ng-show on the button needs to be able to see the variable.

http://stackoverflow.com/comment/45588307
type: Comment
type: QuestionComment
has text: target='_blank' is for open in new tab. He want in new window you must have to read it. I don't know much more about these but can you see these link ....http://www.pageresource.com/jscript/jwinopen.htm
comment on: http://stackoverflow.com/q/28645064
score: 0

http://stackoverflow.com/comment/45613065
score: 1
has text: `getElementsByClassName()` returns a list, so you have to loop over the items in that list and set their class one by one. Are you trying to target just the *last* (most recently created) one, or all of them, or...?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28658552

http://stackoverflow.com/q/28654466
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28654581
has title: Auto refresh content but not if focus on the one of the inputs in this content
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28654581
has body: I have view: ... &lt;div id="actualverses"&gt; @Html.Action("Render3ActualVerses") &lt;/div&gt; ... &lt;script type="text/javascript"&gt; $(function () { setInterval(function () { $('#actualverses').load('/Verse/Render3ActualVerses'); }, 3000); }); &lt;/script&gt; all works fine but in the div with id "actualverses" is inputs and I want to refresh this view but not if the focus one one of the inputs. Something like: &lt;script type="text/javascript"&gt; $(function () { if(??? !focus on the $('#txtString')){ setInterval(function () { $('#actualverses').load('/Verse/Render3ActualVerses'); }, 3000); } }); &lt;/script&gt; how to write "if not focus on the element with id/name = "txtString"" in JavaScript? I need this for this site: http://boutsrimes.somee.com/ I want to refresh content of the div with id 'actualverses' but not if user type something in inputs in this div
type: Question
tagged with: c#
tagged with: asp.net-mvc
tagged with: javascript
tagged with: jquery
tagged with: ajax

webdriver-io
type: Tag
tag name: webdriver-io
tags question: http://stackoverflow.com/q/28742069

http://stackoverflow.com/q/28677253
has answer: http://stackoverflow.com/a/28677394
favorite count: 0
has comment: http://stackoverflow.com/comment/45647710
answer count: 3
has comment: http://stackoverflow.com/comment/45647707
has title: Trouble populating Javascript array of objects
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28677490
downvote count: 1
score: -1
has body: I'm trying to populate an array of objects in Javascript. If I check the array item using the index immediately after pushing it onto the array it looks good. However, if I try to use the elements of the array after it is populated, the whole array seems to be populated with copies of the last object I pushed. I have the same problem in both Chrome and Firefox. I have attached a simplified version of my code that demonstrates the issue. Any guidance would be appreciated. &lt;script type="text/javascript"&gt; var JSONHLDat=[ [ "2", "1", "72.2", "52.1" ], [ "2", "2", "72.2", "52.2" ], [ "2", "3", "72.3", "52.4" ], [ "2", "4", "72.4", "52.5" ] ];//data to be added to array var oHiLo ={ oMonth: 0, oDay: 0, oHi: 0, oLo: 0 };//oHiLo is the object var HiLo=[];//HiLo is the array to contain multiple oHiLo objects for (var j in JSONHLDat) { oHiLo.oMonth = JSONHLDat[j][0]; oHiLo.oDay = JSONHLDat[j][1]; oHiLo.oHi = JSONHLDat[j][2]; oHiLo.oLo = JSONHLDat[j][3]; console.log("oHiLo=", oHiLo);// here I display the object, it looks good. var ndx = HiLo.push(oHiLo); console.log("ndx=", ndx, " HiLo[(ndx-1)] = ", HiLo[(ndx - 1)]);//here I display the object in HiLo. It looks good. } for (var k=0;k&lt;4;k++) { console.log("k=", k, " HiLo[k] = ", HiLo[k]);// This appears to show that the array is populated with four copies of the last element pushed. } &lt;/script&gt;
linked to: http://stackoverflow.com/q/9329446
type: Question
upvote count: 0
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/28677487

http://stackoverflow.com/q/28667505
tagged with: express
score: 0
tagged with: redis
tagged with: node.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45644128
has title: How configure Redis Store for my production env?
type: Question
has body: I am trying to setup Redis for a session store, but is not working at. I'm using passport.js and express-flash, and if I try run the current Redis setup, it won't work: var session = require('express-session'); var favicon = require('serve-favicon'); var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); var redis = require("redis").createClient(); var RedisStore = require("connect-redis")(session); var load = require('express-load'); var flash = require('express-flash'); var path = require('path'); var logger = require('morgan'); var i18n = require('i18n-2'); var passport = require('passport'); var mongoose = require('mongoose'); If I use this session setup: app.use(session({ secret: 'keyboard cat' })); This will show an error saying that is not safe for use in production, however the passport.js and the express-flash will work. Moving on to Redis: app.use(session({ store: new RedisStore({ host: 54.94.171.197, port: 3000, client: redis }), secret: 'keyboard cat' })); Should I put the static IP in the host and the 3000 in the port? I am very confused with the proper values that I need pass to the new instance. This is my middleware: app.use(favicon(__dirname + '/public/images/icons/fav.ico')); app.use(logger('dev')); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: false })); app.use(flash()); app.use(cookieParser()); app.use(express.static(path.join(__dirname, 'public'))); app.use(session({ store: new RedisStore({ host: global.config.site.host, port: 6379, client: redis }), secret: 'keyboard cat' })); // Productions Middlewares if (process.env.NODE_ENV === 'production') { app.use(passport.initialize()); app.use(passport.session()); app.use('/admin', middleware.ensureAuthenticated); app.use(middleware.ensureHttps); }
has answer: http://stackoverflow.com/a/28675986
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/28632997
tagged with: ajax
type: Question
has comment: http://stackoverflow.com/comment/45566244
has answer: http://stackoverflow.com/a/28633070
upvote count: 1
tagged with: web-services
answer count: 1
tagged with: fine-uploader
has title: Call web services via JavaScript in a loop
has body: I am using the fine-uploader to allow multiple file uploads. The files are uploaded 1 by 1 by the fine-uploader library, and on the 'complete' event, which fires every time a file has uploaded successfully, I call a function that calls a web service and makes some updates to my database. Potentially a user could update 100, or a 1000 files at a time. My question is do i need to do anything specific to the JavaScript or Web services so that repeated requests do not cause a problem. I know that the $.ajax function is asynchronous by default, is this enough to ensure that problems don't occur?
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
score: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/45632981
favorite count: 0

http://stackoverflow.com/q/28600967
linked to: http://stackoverflow.com/q/2051678
type: Question
has answer: http://stackoverflow.com/a/29085788
type: AnsweredQuestion
tagged with: reflection
score: 10
downvote count: 0
has title: How to programmatically inspect the JavaScript scope chain?
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: scope
upvote count: 10
has body: In a JavaScript debugger, I can manually inspect the scope chain of a function. For instance, when executing foo() on this piece of code: var x1 = "global"; var foo = (function main () { var x2 = "inside obj"; return function internalFoo () { var x3 = "inside internalFoo"; console.log (x1+','+x2+','+x3); // get the scopes }; })(); foo (); and setting a breakpoint on the console.log, I see the following scopes: Is there some means to do this programmatically? How can I inspect what is defined at every scope level?
accepted answer: http://stackoverflow.com/a/29085788

http://stackoverflow.com/q/28697963
has answer: http://stackoverflow.com/a/28698117
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28735328
score: 0
answer count: 2
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has body: Is it possible to export data from asp.net's control to portable document format using JavaScript? I am trying to do this but I failed to do.
tagged with: asp.net
favorite count: 0
has title: How to export data from listview in asp.net to pdf using javascript
type: UnansweredQuestion
tagged with: css

http://stackoverflow.com/comment/45761425
comment on: http://stackoverflow.com/a/28625473
score: 0
type: AnswerComment
type: Comment
has text: sorry for the late reply! I was searching to solve my problem but with no result. What i need is to update the trackball controls to detect the mouse position event to a different screen. I managed to make the handleResize() function but the getmousePosition(event) is not working correct. any help how to fix this?

http://stackoverflow.com/comment/81269524
comment on: http://stackoverflow.com/a/28600866
type: AnswerComment
has text: Yea, but I wrote in mind that anyone reading this understands inheritance in an OOP way. From an OOP perspective this is logical to me. but maybe i'm weird like that ;-)
score: 0
type: Comment

http://stackoverflow.com/comment/45540573
type: Comment
has text: @TroelsJohannesen Oh yeah, I guess `.value` is when you use plan js `document.getElementById('id').value` but jquery shortened it to `$('#id').val()` ...stupid jquery.
comment on: http://stackoverflow.com/a/28618092
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45601409
comment on: http://stackoverflow.com/a/28651825
type: AnswerComment
score: 0
has text: I just tried it and still I have the same error. Like I said, If you need to see anymore of my code I can edit my question!
type: Comment

http://stackoverflow.com/comment/45577046
type: QuestionComment
has text: If you're drawing a semi-transparent disc each time you recieve a screen touch event, the result will indeed depend on the speed with which the finger moves on the screen.You might want to interpolate the position of successive events so that the density remain constant whatever the distance between two points.
comment on: http://stackoverflow.com/q/28638627
type: Comment
score: 0

http://stackoverflow.com/comment/45748164
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28727148
score: 0
has text: Does `btnSearch` cause a postback? is it an asp:Button control or simple html button where `type=button`?

http://stackoverflow.com/a/28858262
score: 0
has comment: http://stackoverflow.com/comment/45984310
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28626963
answers question: http://stackoverflow.com/q/28626963
type: Answer
has body: csswidth = screen.width / window.devicePixelRatio To get CSS width we have to divide screen width ('cause it's fullscreen app) by device pixel ratio. 480/1.5=320. All right.

http://stackoverflow.com/comment/45649861
type: QuestionComment
has text: Try making the absolute position relevant to the parent div's location/size, change the positioning left and top.
type: Comment
comment on: http://stackoverflow.com/q/28678219
score: 0

http://stackoverflow.com/comment/45525558
type: QuestionComment
type: Comment
has text: so now the problem is resolved or not?
score: 0
comment on: http://stackoverflow.com/q/28599497

http://stackoverflow.com/q/28621211
type: UnansweredQuestion
tagged with: php
tagged with: css
has answer: http://stackoverflow.com/a/28621248
score: 1
has title: How to stop this weird thing for limiting word in jquery?
upvote count: 1
has comment: http://stackoverflow.com/comment/45545759
type: Question
has body: Click http://jsfiddle.net/1ybzcppk/8/ to see. I can successfully limit word enter, but there is a weird thing happening. When you reach the max, the sixth word still show up. If I kept enter, it kept replace the last word. I want nothing show up when it reach the 5th word. Help, appreciate. JQuery: $("#input").keydown(function(event) { var count = $('#test').text(); var words = count.match(/\S+/g).length; if (words >= 5) { var trimmed = $('#test').text().split(/\s+/, 5).join(" "); // Add a space at the end to keep new typing making new words $('#test').text(trimmed + " "); } if (event.which == 13) { event.preventDefault(); //put input value into div var value = $('#input').val(); $('#test').text($('#test').html() + " " + value); } }); CSS: .test { display: inline-block; } HTML: dog
tagged with: javascript
has comment: http://stackoverflow.com/comment/45544770
answer count: 1
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/45544736
favorite count: 0

http://stackoverflow.com/comment/45684768
has text: If you're doing a light preference, then adding the same thing one or two more times wouldn't hurt, and would keep your code a bit cleaner. Wouldn't recommend it though if you were to add more than a few extra elements. After that it's just harder to manage.
type: QuestionComment
comment on: http://stackoverflow.com/q/28696298
score: 0
type: Comment

http://stackoverflow.com/q/28598303
has comment: http://stackoverflow.com/comment/45502920
has comment: http://stackoverflow.com/comment/45502987
score: 0
has comment: http://stackoverflow.com/comment/45503308
has body: function begin(firstName){ firstName = document.getElementById('name').value; var age = document.getElementById('age').value; console.log(firstName); if (firstName == ""){ alert("please enter a name here"); return; } if (age == ""){ alert("please enter your age here"); return; } if(0 &lt; age &amp;&amp; age &lt; 9){ location.href = "toys.html"; return; } if(10 &lt; age &amp;&amp; age &lt; 16){ location.href = "phones.html"; return; } else{ location.href = "cars.html"; }}; `table = document.getElementsByTagName('table')[0].childNodes[1]; row = table.childNodes[2]; price =[table.childNodes[2].childNodes[3].innerHTML.substr(1),table.childNodes[4].childNodes[3].innerHTML.substr(1), table.childNodes[6].childNodes[3].innerHTML.substr(1)]; amount = [table.childNodes[2].childNodes[7].innerHTML.substr(1), table.childNodes[4].childNodes[7].innerHTML.substr(1), table.childNodes[6].childNodes[7].innerHTML.substr(1)];` function update(){ console.log(firstName); q1 = parseInt(document.getElementById('quantity1').value); q2 = parseInt(document.getElementById('quantity2').value); q3 = parseInt(document.getElementById('quantity3').value); if(isNaN(q3) == true){ q3 = 0; } if(isNaN(q2) == true){ q2 = 0; } if(isNaN(q1) == true){ q1 = 0; } x = q1 + q2 + q3; var amount1 = document.getElementById('amount1').innerHTML = "$" + price[0] * q1; amount2 = document.getElementById('amount2').innerHTML = "$" + price[1] * q2; amount3 = document.getElementById('amount3').innerHTML = "$" + price[2] * q3; n = parseInt(price[0]) * q1 + parseInt(price[1]) * q2 + parseInt(price[2]) * q3; document.getElementById('totalAmount').innerHTML = "$" + n; table.childNodes[8].childNodes[5].innerHTML = x;} The variable firstName keeps coming up as undefined when the script moves to the next page, i thought i could use the variable in another function because it was declared globally but for some reason it keeps coming back undefined.
has comment: http://stackoverflow.com/comment/45503006
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45503002
has comment: http://stackoverflow.com/comment/45502929
has comment: http://stackoverflow.com/comment/45503048
has comment: http://stackoverflow.com/comment/45503028
has comment: http://stackoverflow.com/comment/45502951
has title: Getting variable undefined though it is declared globaly
has comment: http://stackoverflow.com/comment/45502986
type: Question
tagged with: javascript

http://stackoverflow.com/a/48019050
downvote count: 0
score: 1
has body: Are you using spring security version 4 or later? jquery filedownload internally uses an iframe. Spring security In version 4, x-frame-options is set to 'DENY' to block iframes for security reasons. So to use jquery filedownload you have to change the option value to 'SAMEORIGIN'. &lt;security:http auto-config="true" use-expressions="true"&gt; &lt;security:headers&gt; &lt;security:frame-options policy="SAMEORIGIN"/&gt; &lt;/security:headers&gt; .......... &lt;/security:http&gt; Add settings to the security context file I wish you well.
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28609996

http://stackoverflow.com/comment/45699748
type: QuestionComment
score: 0
has text: Please clarify that in your question.
comment on: http://stackoverflow.com/q/28704994
type: Comment

http://stackoverflow.com/comment/45674885
score: 0
comment on: http://stackoverflow.com/q/28691060
has text: What DBMS (brand and version) are you using? Is the file being stored in the database as a LOB, or as a physical file somewhere of the web server? Does your server-side code have the ability to rename a file immediately after it is uploaded?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28654986
type: Question
answer count: 1
tagged with: javascript
has title: How to test function returning next method with Hippie?
has body: I've got a function which returns next(); as a function to allow next route to be called and it's used for checking the token as an interceptor and allows function to go through. The problem I have now is that I want to test this particular function and I don't have next route it's just that one so when I use some API testing tool like Hippie and make a request it hangs and does nothing until timed out. So the test call I have is like below with Hippie: hippie(server) .header('token', token) .json() .put('/token') .send(tokenRequest) .end(function(err, res, body) { if (err) { throw err; } done(); }); Basically token endpoint is linking to token interceptor and that returns next(); How do I make this into testable state?
score: 0
type: UnansweredQuestion
tagged with: restify
tagged with: node.js
has answer: http://stackoverflow.com/a/32502432

http://stackoverflow.com/a/28730999
accepted answer of: http://stackoverflow.com/q/28730901
upvote count: 2
type: AcceptedAnswer
has body: Is there an elegant way to fix this and still use a closure? Or must I revert to my previous solution, forget closures, and make elapsed a member variable? It has to be instance-specific; that doesn't mean it has to be a property on the object. You can create the closure from within the init method: //member variable this.elapsed has been removed Level.init = function(){ //a closure is used to keep track of elapsed time this.countdown = createCountdownMethod(); return this; }; Level.update = function(){ this.countdown(); }; function createCountdownMethod(){ var elapsed = 0; return function() { elapsed += 1; var remaining = (GAME_LENGTH*60) - (elapsed/TICKS); var minutes = Math.floor(remaining/60); var seconds = Math.floor(remaining%60); this.countdown.html(minutes + ":" + ("0"+seconds).slice(-2)); if (elapsed/TICKS &gt;= GAME_LENGTH*60) { elapsed = 0; this.end_level(); } }; } Or this may be a bit easier to read: //member variable this.elapsed has been removed Level.init = function(){ var elapsed = 0; //a closure is used to keep track of elapsed time Level.countdown = countdown; return this; function countdown() { elapsed += 1; var remaining = (GAME_LENGTH*60) - (elapsed/TICKS); var minutes = Math.floor(remaining/60); var seconds = Math.floor(remaining%60); this.countdown.html(minutes + ":" + ("0"+seconds).slice(-2)); if (elapsed/TICKS &gt;= GAME_LENGTH*60) { elapsed = 0; this.end_level(); } } }; Level.update = function(){ this.countdown(); };
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28730901

parameters
tags question: http://stackoverflow.com/q/28698565
tags question: http://stackoverflow.com/q/28722074
tags question: http://stackoverflow.com/q/28619320
type: Tag
tag name: parameters
tags question: http://stackoverflow.com/q/28633099

http://stackoverflow.com/q/28648599
has body: When using a foreach from jTemplate, jQuery doesn't hook into the .click() event of any DOM Elements within the applied template. Solutions such as .live('click', function()) do not work (Partially because .live was deprecated, but the alternative introduced to replace it .on('click', function()) does the same thing...), and i cannot figure out how to get Click events from the results of a jTemplate. Thing's i've tried: .live('click', function()) .click(function()) .on('click', function()) All 3 events in $(window).load(function()), $(document).ready(function()), and just freely in a Script tag All 3 events before and after calling the .processTemplate() function At this point, i have no more ideas on how to solve this issue. My jQuery version for reference is 2.1.3, and jTemplate is 0.8.4.
answer count: 1
has comment: http://stackoverflow.com/comment/45594826
has answer: http://stackoverflow.com/a/28648794
tagged with: jtemplates
has comment: http://stackoverflow.com/comment/45595015
has title: Cannot hook Click Event from a jTemplate output
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28648794
type: Question
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/a/28687554
accepted answer of: http://stackoverflow.com/q/28687483
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47545253
downvote count: 0
has comment: http://stackoverflow.com/comment/47544991
type: Answer
answers question: http://stackoverflow.com/q/28687483
score: 2
upvote count: 2
has body: You can call window.stop() to stop window loading, if that is what you are looking for. It sounds like it would be easier to pause the script execution with the browsers javascript debugger though, by setting some breakpoints instead of manually inserting a stop statement.

webpack
tags question: http://stackoverflow.com/q/28720041
tags question: http://stackoverflow.com/q/28709161
type: Tag
tags question: http://stackoverflow.com/q/28648255
tag name: webpack
tags question: http://stackoverflow.com/q/28600536
tags question: http://stackoverflow.com/q/28717819

http://stackoverflow.com/comment/63801537
type: AnswerComment
comment on: http://stackoverflow.com/a/28627292
has text: The code is on HTML section. Try testing it in the JS section.
type: Comment
score: 0

http://stackoverflow.com/comment/45628341
has text: what you are receiving in alert?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28666758

http://stackoverflow.com/comment/45764309
comment on: http://stackoverflow.com/q/28740261
score: 0
has text: @pankajparkar thanks for replay. dfsq given the solution down ,it is working
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45745263
has text: Followup question: If it's cell[2] or cell[6] for example, what would I use isntead of `td:first` ? `td:third` seems to throw an error. Sorry if this is a basic question.
comment on: http://stackoverflow.com/a/28729235
score: 0
type: AnswerComment
type: Comment

sockets
tags question: http://stackoverflow.com/q/28708389
tags question: http://stackoverflow.com/q/28651534
tags question: http://stackoverflow.com/q/28644202
tags question: http://stackoverflow.com/q/28694205
tags question: http://stackoverflow.com/q/28702282
type: Tag
tags question: http://stackoverflow.com/q/28657175
tags question: http://stackoverflow.com/q/28618623
tags question: http://stackoverflow.com/q/28663886
tags question: http://stackoverflow.com/q/28724904
tag name: sockets
tags question: http://stackoverflow.com/q/28609196
tags question: http://stackoverflow.com/q/28655685
tags question: http://stackoverflow.com/q/28683194
tags question: http://stackoverflow.com/q/28737671
tags question: http://stackoverflow.com/q/28642494

http://stackoverflow.com/a/56623898
has body: This works, but with jQuery. window.addEventListener("keydown", (evt) =&gt; { const {type, key} = evt; parent.$("body").trigger(parent.$.Event(type, {key})); }) Interestingly, parent.$.Event(evt) directly doesn't work.
score: 0
answers question: http://stackoverflow.com/q/28672152
type: Answer

http://stackoverflow.com/comment/45755551
has text: Daniel, Thanks for editing my code. It helps a lot.
comment on: http://stackoverflow.com/q/28733434
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28741064
accepted answer: http://stackoverflow.com/a/28743984
has comment: http://stackoverflow.com/comment/45766365
upvote count: 2
tagged with: php
tagged with: laravel
has comment: http://stackoverflow.com/comment/45765586
type: AnsweredQuestion
has body: I want to make my one page website multilingual, and I want to dynamically refresh the content on calling a ajax function. I don't want that the user have to reload the page, so I call a ajax function that will retrieve the new language datas (who are stocked in a .json file). I don't have problems for that but when the new content is loaded, all the javascripts functions doesn't work anymore. I tried to encapsulate all of the initialisation functions under a "master function" like pageInit(); but that doesn't work either. I uploaded the development version of my website for the debugging time : http://cv.gillequentin.be/ The first loading is correct but try to change the lang on clicking on the "FR" or "EN" button, no more javascript ? I'm working with jQuery and Laravel 4. Thanks for the help !
has comment: http://stackoverflow.com/comment/45766074
type: Question
has answer: http://stackoverflow.com/a/28743984
has comment: http://stackoverflow.com/comment/45765742
score: 2
has comment: http://stackoverflow.com/comment/45765788
has comment: http://stackoverflow.com/comment/45765888
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Reinit javascript functions when page change with ajax
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/45766578
has comment: http://stackoverflow.com/comment/45766253

http://stackoverflow.com/a/28632800
type: Answer
has body: What should probably work is to define a function before your $.when something like this: function createRequest(port) { return $.ajax({ url:"https://www.aaaaaaa.com?param="+port, crossDomain: true, dataType: "jsonp", success: function (response) { data = data.concat(response); } }) } and then use that in your $.when $.when(createRequest(0), createRequest(2500), createRequest(5000)); And if you want to create this function call dynamically with more parameters you can create an array of these requests for-loop and then call $.when.apply(this, array) $.when.apply(this, your_request_array) See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply Hope this helps
score: 2
accepted answer of: http://stackoverflow.com/q/28632608
downvote count: 0
type: AcceptedAnswer
upvote count: 2
answers question: http://stackoverflow.com/q/28632608

http://stackoverflow.com/q/28709161
type: Question
has answer: http://stackoverflow.com/a/31462735
tagged with: webpack
downvote count: 0
tagged with: javascript
has title: webpack watch cache between instances
answer count: 1
favorite count: 0
type: UnansweredQuestion
score: 11
upvote count: 11
tagged with: build
tagged with: instance
has body: Anyone have an example of webpack's cache option shared between instances? In the Webpack's docs it sais: You can pass an object to enable it and let webpack use the passed object as cache. This way you can share the cache object between multiple compiler calls. Note: Don’t share the cache between calls with different options. But it is not clear about the implementation. Any help? Thanks
tagged with: caching

http://stackoverflow.com/a/28672213
type: AcceptedAnswer
downvote count: 0
has body: Firebug (extension) in Firefox or developer tools (ctrl+shift+i) in chrome. These are the tools you should use to debug.
type: Answer
answers question: http://stackoverflow.com/q/28672172
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28672172

http://stackoverflow.com/q/28728121
score: 0
has comment: http://stackoverflow.com/comment/45743530
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
answer count: 0
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45785289
has title: How to load google polygons from database? How to modify loaded content?
has body: I tried loaded more polygons, but not work and can't change color... just 1 polygon, but i need more: // Define the LatLng coordinates for the polygon. var Coords = [ new google.maps.LatLng(52.25103074693554,20.982491970062256), new google.maps.LatLng(52.24871867105816,20.98236322402954), new google.maps.LatLng(52.24941493385994,20.975325107574463) ]; // Construct the polygon. loadedContent = new google.maps.Polygon({ paths: Coords, strokeWeight: 0, fillColor: '#FF0000', fillOpacity: 0.35 }); loadedContent.setMap(map); //--------------------------------------------------------- How to load google polygons from database (with coordinates, border, fill, title...)? I need more polygons. How to modify loaded content (title, fill...)? thx Drawing Tools Delete Selected Shape

http://stackoverflow.com/q/28605910
tagged with: javascript
has comment: http://stackoverflow.com/comment/45516196
accepted answer: http://stackoverflow.com/a/28606081
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/28606081
upvote count: 1
answer count: 1
has body: This is a simple class that looks familiar. var Cat = function () { this.speak = function() { return "meow"; }; }; But, I often see this written that way var Dog = function() { var api = {}; api.speak = function() { return "bark"; }; return api; }; They both are instantiated and used the same way. var garfield = new Cat(); console.log(garfield.speak()); var odie = new Dog(); console.log(odie.speak()); So, what is the advantages of using the Dog way ?
has title: advantages of using return vs this

http://stackoverflow.com/comment/45532558
type: AnswerComment
comment on: http://stackoverflow.com/a/28614084
score: 0
type: Comment
has text: I put the code from fiddle and the page is ok when running in IE11, Please make sure add 'http:' at front of jquery.js url as src='http: //code.jquery.com/jquery-1.10.1.js

http://stackoverflow.com/comment/45582307
type: Comment
type: QuestionComment
has text: Isn't the problem the `data:` part infront of the actual image data? Try to decode the input using `$json = json_decode($picstr, true)` then doing like this: `$picstr = base64_decode($json['data']);`
comment on: http://stackoverflow.com/q/28641710
score: 0

http://stackoverflow.com/q/28654645
tagged with: php
has comment: http://stackoverflow.com/comment/45606180
has comment: http://stackoverflow.com/comment/45606147
has title: Read the value entered in text box in html form and use it by retrieving it in a php page
type: Question
has comment: http://stackoverflow.com/comment/45607437
type: AnsweredQuestion
tagged with: javascript
has answer: http://stackoverflow.com/a/28654703
accepted answer: http://stackoverflow.com/a/28654703
possible better answer: http://stackoverflow.com/a/28654960
score: 0
answer count: 2
upvote count: 1
has body: Train Information from Indian Railways API Please enter train number: example.php <?php echo "Value entered is: " .$_GET['train ']; $ch = curl_init("http://api.erail.in/route/?key=3d970b43-550b-4568-9227-492697f47093&trainno=12138"); $fp = fopen("example_homepage.txt", "w"); //$ch is a cURL handle returned by curl_init curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); //Execute $ch $result = curl_exec($ch); //Read the file contents $json_data = file_get_contents('example_homepage.txt'); echo $json_data; curl_close($ch); fclose($fp); ?> I am unable to retrieve the user entered value in php and then use it to manipulate the url there, which gets me the data from API server. When I run the HTML page, it just gives me an alert of ERROR. What am I doing wrong? Is it the ajax call? Should it be post method? I tried using ajaxForm from AJAX plugin but no change. Any help will be appreciated. Thank You.
downvote count: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28654960
has comment: http://stackoverflow.com/comment/45606183
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45752231
comment on: http://stackoverflow.com/a/28733298
score: 0
type: Comment
has text: Yup. And by "at the bottom", you mean as the last child of the `body` element. However, since _this code_ in particular is only accessing `document.body`, it would work even as the first child of `body`.
type: AnswerComment

http://stackoverflow.com/q/28605198
has answer: http://stackoverflow.com/a/28605366
tagged with: razor
has answer: http://stackoverflow.com/a/28856032
type: AnsweredQuestion
type: Question
possible better answer: http://stackoverflow.com/a/28605366
tagged with: asp.net-mvc
tagged with: javascript
has title: Razor code creates new line inside of JavaScript string
score: 0
answer count: 2
has body: I have a JavaScript variable which should hold Razor code to be generated when a button clicked: $("#addNewCatBtn").click(function(e){ e.preventDefault(); counter++; var html = ' İçerik Kategorisi '+ '@{ List<SelectListItem> modCatList = new List<SelectListItem>(); if (Model.CategoryList != null && Model.CategoryList.Count > 0) { foreach (var cat in Model.CategoryList) { modCatList.Add(new SelectListItem { Text = cat.CategoryName, Value = cat.ModCategoryId.ToString(), Selected = false }); } } else { modCatList.Add(new SelectListItem { Text = "Kategori Yok", Value = "0", Selected = true }); } } @Html.DropDownList("ModCategoryId_"+Html.Raw("counter"), modCatList, new { @class = "select2-select-00 col-md-12 full-width-fix required", @data_rule_required = "true", @data_msg_required = ModerationWEB.ErrorMessages.NOTVALID_MODCAT_EMPTY }) ' +' Süreç Kategorisi '+ '@{ List<SelectListItem> flowCatList = new List<SelectListItem>(); if (Model.FlowCatList != null && Model.FlowCatList.Count > 0) { foreach (var cat in Model.FlowCatList) { flowCatList.Add(new SelectListItem { Text = cat.CategoryName, Value = cat.FlowCategoryId.ToString(), Selected = false }); } } else { flowCatList.Add(new SelectListItem { Text = "Kategori Yok", Value = "0", Selected = true }); } } @Html.DropDownList("FlowCatId_" +Html.Raw("counter"), flowCatList, new { @class = "select2-select-00 col-md-12 full-width-fix required", @data_rule_required = "true", @data_msg_required = ModerationWEB.ErrorMessages.NOTVALID_MODCAT_EMPTY, @multiple = "multiple", @size = "5" }) '; $("#modFlowCatGroupDiv").html(); }); When it generates the list elements, the options come in new lines and it causes JavaScript to give Unterminated string constant error. How can I stop this?
accepted answer: http://stackoverflow.com/a/28856032
tagged with: string

http://stackoverflow.com/a/28697364
has comment: http://stackoverflow.com/comment/45883871
score: 1
has body: You have a lot of code that essentially looks like this: // Listen to x to ... var a = x.map(function (val) { ... }); But then you never show what you do with a. map takes an observable and produces a new observable that will run the supplied mapping operation. However, the observable it returns is inert and does not actually do anything unless you eventually subscribe to a (or some derivative of a). It looks like for your controller and model you eventually do subscribe to the observables they are producing (through the circuitous route of adding them to your obs and then subscribing to them in your view). However, it isn't clear you ever subscribe to changeNumberColor or modelAmount. Based upon the imperative code within those two map methods, I'm guessing you should be using subscribe instead of map in those 2 cases. Also, for modelAmount you are using the last operator incorrectly. Most likely you think last does something different than it does.
answers question: http://stackoverflow.com/q/28678206
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28678206
has comment: http://stackoverflow.com/comment/45694621
type: Answer
has comment: http://stackoverflow.com/comment/45886033
has comment: http://stackoverflow.com/comment/45695020
downvote count: 0

http://stackoverflow.com/q/28675147
tagged with: debugging
upvote count: 0
tagged with: javascript
tagged with: jquery
score: -1
has title: Newbie CSS needs help debugging
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45643781
type: UnansweredQuestion
tagged with: css
has body: This is my first post to Stack, I'm having trouble debugging some CSS errors on a project I am working on. Here is a link to the page: http://musiccomputing.com/copy-of-studioblade-5-61-key-macos-x/ You can see how the thumbnails seem to repeat, and there is some text jumbling on the right side, this is what it should look like: musiccomputing.com/studioblade-5-61-key-macos-x/ (sorry they wouldn't let me post more than 2 links). I was working on adding a "tabbed" section under the product description. Here is the code I added which caused the aforementioned issues to occur. http://pastebin.com/JhbbmFTb. I have been trying to debug this with Pesticide and Firebug, but unfortunately I am still learning, so decided to turn to you guys who I know could solve this fairly quickly. (by the way this is on a Bigcommerce platform) Any help is much appreciated.
downvote count: 1
has answer: http://stackoverflow.com/a/28675431
type: Question

http://stackoverflow.com/comment/45631247
comment on: http://stackoverflow.com/a/28667322
type: AnswerComment
score: 0
type: Comment
has text: On my server-side, how do I recognize the session cookie?

http://stackoverflow.com/a/28673483
answers question: http://stackoverflow.com/q/28673217
has body: Basically you need to store direction along x/y-axes ( two binary flags representing 'increment/decrement_x/y_coordinate' suffice) that have to change upon reflection at one of the field edges. var ball = document.getElementById('ball'); var field = document.getElementById('field'); var d_x = 1.0; var d_y = 1.0; var h_ball = parseFloat(window.getComputedStyle(ball).height); var w_ball = parseFloat(window.getComputedStyle(ball).width); var h_field = parseFloat(window.getComputedStyle(field).height); var w_field = parseFloat(window.getComputedStyle(field).width); ball.style.left = '200px'; ball.style.top = '200px'; var timer = setInterval(function () { var posTop = ball.offsetTop; var posLeft = ball.offsetLeft; var ballPositionX = parseFloat(window.getComputedStyle(ball). left) ; var ballPositionY = parseFloat(window.getComputedStyle(ball). top); if ( ballPositionX &lt;= 0 ) { d_x = 1.0; } if ( ballPositionX &gt;= w_field - w_ball ) { d_x = -1.0; } if ( ballPositionY &lt;= 0 ) { d_y = 1.0; } if ( ballPositionY &gt;= h_field - h_ball ) { d_y = -1.0; } ball.style.top = (posTop + d_y) + 'px'; ball.style.left = (posLeft + d_x) + 'px'; }, 10); d_x/y in the code above represent the coordinate change per time step. Weight and scale these with the coordinates and the length of your speed vector. Live demo on jsFiddle
has comment: http://stackoverflow.com/comment/45640491
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45640479
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28673217

http://stackoverflow.com/comment/45651329
comment on: http://stackoverflow.com/a/28679129
has text: Even the first console.log(markers) also shows [] when i call the method second time from the change of value of combobox
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28609450
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28609791
tagged with: ajax
score: 0
has title: Sending a variable with ajax call .done
has body: Is there a possible way to send the variable, 'schedule_id[i]', with the result of the call. Also is it possible to add this variable in the data object? My code: for (var i = 0; i &lt; schedule_id.length; i++) { //Ajax call $.ajax({ url: "http://api.viewer.zmags.com/schedules/" + schedule_id[i] + "?key=" + api_key }) // .done(function(data){ }
has answer: http://stackoverflow.com/a/28609791
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28609738
accepted answer: http://stackoverflow.com/a/28609738
tagged with: call
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45522868

http://stackoverflow.com/comment/45696150
type: QuestionComment
has text: It seems like the problem is in the User factory definition. What does the save method look like?
score: 0
comment on: http://stackoverflow.com/q/28703014
type: Comment

date
tags question: http://stackoverflow.com/q/28595870
tag name: date
tags question: http://stackoverflow.com/q/28662890
tags question: http://stackoverflow.com/q/28618964
tags question: http://stackoverflow.com/q/28695693
tags question: http://stackoverflow.com/q/28668763
tags question: http://stackoverflow.com/q/28705902
tags question: http://stackoverflow.com/q/28694214
tags question: http://stackoverflow.com/q/28689524
tags question: http://stackoverflow.com/q/28622265
tags question: http://stackoverflow.com/q/28679413
tags question: http://stackoverflow.com/q/28655903
tags question: http://stackoverflow.com/q/28660525
tags question: http://stackoverflow.com/q/28611099
tags question: http://stackoverflow.com/q/28657113
tags question: http://stackoverflow.com/q/28632618
tags question: http://stackoverflow.com/q/28682340
tags question: http://stackoverflow.com/q/28692762
tags question: http://stackoverflow.com/q/28746424
tags question: http://stackoverflow.com/q/28720337
tags question: http://stackoverflow.com/q/28634734
type: Tag
tags question: http://stackoverflow.com/q/28746466
tags question: http://stackoverflow.com/q/28612113
tags question: http://stackoverflow.com/q/28641689
tags question: http://stackoverflow.com/q/28668123
tags question: http://stackoverflow.com/q/28702276
tags question: http://stackoverflow.com/q/28632062
tags question: http://stackoverflow.com/q/28720838
tags question: http://stackoverflow.com/q/28642258
tags question: http://stackoverflow.com/q/28667681
tags question: http://stackoverflow.com/q/28693776
tags question: http://stackoverflow.com/q/28683666
tags question: http://stackoverflow.com/q/28641616
tags question: http://stackoverflow.com/q/28701583
tags question: http://stackoverflow.com/q/28705618
tags question: http://stackoverflow.com/q/28686526
tags question: http://stackoverflow.com/q/28740419
tags question: http://stackoverflow.com/q/28612525

http://stackoverflow.com/q/28748473
possible better answer: http://stackoverflow.com/a/31605567
has answer: http://stackoverflow.com/a/31605567
tagged with: javascript
has body: On a new connection i get sometimes the error TypeError: Cannot read property 'country' of null and mostly it works correct! How do i avoid this whenever its null so i will not get the error? Error line is var location = geo.country; var ip = socket.ip //socket.ip; var geo = geoip.lookup(ip); var location = geo.country; console.log(location);
score: 0
answer count: 2
has title: GEO location TypeError: Cannot read property 'country' of null
has answer: http://stackoverflow.com/a/28748543
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28748543
linked to: http://stackoverflow.com/q/1771786
tagged with: geolocation
type: Question

http://stackoverflow.com/q/28619210
tagged with: git
linked to: http://stackoverflow.com/q/30397041
accepted answer: http://stackoverflow.com/a/28623482
tagged with: javascript
has comment: http://stackoverflow.com/comment/74766476
answer count: 4
has answer: http://stackoverflow.com/a/28624098
score: 25
type: AnsweredQuestion
downvote count: 0
favorite count: 0
upvote count: 25
type: Question
has answer: http://stackoverflow.com/a/28623482
has title: Configure bower to install only dist folder
possible better answer: http://stackoverflow.com/a/31844258
tagged with: bower
has answer: http://stackoverflow.com/a/30397709
has answer: http://stackoverflow.com/a/31844258
has body: I am trying to learn tools such as bower/grunt/requirejs in order to speed up the development process for my website and to make my code more modularized/efficient. I am currently following this tutorial. How does one make Bower only install the dist folder for my dependencies (setup in my component.json file) instead of the entire Git repository?

http://stackoverflow.com/q/28712623
type: Question
tagged with: angularjs-module
has comment: http://stackoverflow.com/comment/45713312
answer count: 2
has comment: http://stackoverflow.com/comment/45713282
tagged with: model-view-controller
has answer: http://stackoverflow.com/a/28713133
has comment: http://stackoverflow.com/comment/45713348
score: 0
accepted answer: http://stackoverflow.com/a/28713133
has title: AngularJS module separation doesnot work properly
has comment: http://stackoverflow.com/comment/45713363
tagged with: javascript
has comment: http://stackoverflow.com/comment/45713431
possible better answer: http://stackoverflow.com/a/28712692
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28712692
linked to: http://stackoverflow.com/q/951791
has body: I am a newbie to angular js and I have just started learning it. I was been going through w3schools tutorials and I got stuck in forms part. The reason being is below: The code given in tutorial is as below and it works fine: First Name: Last Name: RESET form = {{user}} master = {{master}} But what I am trying is separation of modules as shown in one of their tutorail but that doesn't work at all. Below is what I tried. Angular JS First Name : Last Name : Reset form = {{user}} master= {{master}} myCtrl.js contains below code app.controller("myCtrl",function($scope) { $scope.firstName = "John", $scope.lastName = "Doe" $scope.myVar = false; $scope.toggle = function() { $scope.myVar = !$scope.myVar; }; }); app.controller("formController",function($scope) { $scope.master = {firstName: "John", lastName: "Doe"}; $scope.reset = function() { $scope.user = angular.copy($scope.master); }; $scope.reset(); }); and myApp.js is as below: var app=angular.module("myApp",[]); But when I try the tutorial code it gives me below output form = {"firstName":"John","lastName":"Doe"} master = {"firstName":"John","lastName":"Doe"} and when I run what I tried it gives below output form = {{user}} master= {{master}} Why is this happening so? I have also tried keeping angular.js link at the top but still the result is same..
tagged with: angularjs

http://stackoverflow.com/a/28639722
has comment: http://stackoverflow.com/comment/45578951
has comment: http://stackoverflow.com/comment/45578930
has comment: http://stackoverflow.com/comment/45578959
has comment: http://stackoverflow.com/comment/45580182
has comment: http://stackoverflow.com/comment/45580161
has comment: http://stackoverflow.com/comment/45580351
answers question: http://stackoverflow.com/q/28639324
score: 0
has comment: http://stackoverflow.com/comment/45587134
has body: Okay I finally understand you problem! You need to create a new array when you create your new SalesPerson, as creating a new object doesn't create a new array object. It still references the first array. After var sales = Object.create(SalesPerson); add this line sales.amount = []; So the code looks like this: var sales = Object.create(SalesPerson); sales.amount = []; See this JsFiddle.
type: Answer

http://stackoverflow.com/q/28595172
has title: Authenticate Javascript based Web client
has answer: http://stackoverflow.com/a/28597553
type: UnansweredQuestion
tagged with: authentication
type: Question
has body: We have developed multi-client application i.e. the business logic resides on server side and the interfaces are exposed via REST API and mobile/web-client consumes the APIs. The application allows different users to signup/login to get user specific data. We use http digest based authentication and a token mechanism to keep track of user state. However, we want to restrict the access of APIs i.e. only our registered mobile/web-client could access them. So we introduced a second layer of authentication and named it service layer authentication. We are using our custom token based system just like we did for user authentication. The over all flow for mobile clients is good enough for us but for web-clients we have issues. If we embed the user credentials in Javascript, anyone can extract those credentials and consume the APIs. In summary, all we want is to identify/authenticate the Javscript based web-client upon ajax calls. P.S. Just for clarification, with web-client I mean our web application not the browser.
tagged with: web-client
answer count: 1
has comment: http://stackoverflow.com/comment/45497025
tagged with: javascript
score: 0

http://stackoverflow.com/a/28616555
type: Answer
has comment: http://stackoverflow.com/comment/45538438
has comment: http://stackoverflow.com/comment/45536452
answers question: http://stackoverflow.com/q/28616325
has body: You can set contextMenu: falsein the options, or you can configure the context menu to not display "Remove Column" and "Remove Row": http://handsontable.com/demo/contextmenu.html
score: 0

http://stackoverflow.com/q/28630260
has comment: http://stackoverflow.com/comment/45561124
has title: Why my javascript time string needs page to refresh to change?
type: Question
tagged with: javascript
tagged with: jquery
score: 0
has body: I use following code to set time to user's messages in real-time on single-page using Meteor framework var now = new Date(); var h = now.getHours(); var m = now.getMinutes(); var s = now.getSeconds(); var time = h + ":" + m + ':' + s; Messages.insert({ name: name, message: message.value, time : time }); But time is incomplete with zeros and doesn't change unless page is refreshed : Matt at 14:4:51 : fdsfd Matt at 14:4:51 : fdsfds Where is the problem with this ? You can see by yourself at http://hlavackachat.meteor.com/
answer count: 1
has answer: http://stackoverflow.com/a/28630420
tagged with: meteor
accepted answer: http://stackoverflow.com/a/28630420
tagged with: datetime
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45564599

http://stackoverflow.com/a/28635585
score: 0
type: AcceptedAnswer
type: Answer
has body: Let me see if I understod you correctly. You want to create a new HTML button using javascript? Then something like this would work. Create button
accepted answer of: http://stackoverflow.com/q/28634860
has comment: http://stackoverflow.com/comment/45571016
answers question: http://stackoverflow.com/q/28634860

http://stackoverflow.com/q/28710373
type: Question
score: 5
tagged with: javascript
answer count: 1
has body: First off I'm a bit new to SVG. I just started working on a gantt-ish style timeline/roadmap for products supported in my area. Each item has a category, and subcategory, and then a number of versions. Each product ends up as its own separate mini-chart. The SVG is produced by d3.js, however the issue doesn't seem to be related to the JavaScript. The example SVG is here: http://plnkr.co/edit/ipqZIZODDN4lYKVeLt73 Fundamentally there are two g groups that should be stacked on top of each other. In the example there is red and blue outline respectively. The blue group should be directly below the red group. To position the blue group I measured the height of the red group using getBBox. I then use that height and the transform attribute on blue group. Here are the relevant groups: &lt;g class="product" transform="translate(0,0)" style="outline: thin solid red"&gt;...&lt;/g&gt; &lt;g class="product" transform="translate(0,122)" style="outline: thin solid blue"&gt;...&lt;/g&gt; Note: these groups are contained within numerous other groups, however no transformations (with the exception of translate(0,0)) are applied to these groups. In the example if you use the chrome inspector to measure the height of the red group, it is 121 pixels: So the 122 used for the translate for the blue group should be fine. However when rendered the red and blue groups overlap significantly: In fact if you adjust the numbers in the chrome inspector you need an offset of 143 pixels: transform="translate(0,143)", before the two groups align in the way I want them: Are the units for the translation not in pixels? I don't see any obvious reason why the 122 unit translation wouldn't move the group 122 pixels unless that was so. It does render the same way in IE11 so it must be something about SVGs or this markup that I'm not aware of. Does anyone have any ideas? Update This morning I took some screenshots and measured the pixel values of the boxes. The blue box is indeed 121 pixels tall just as g…
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
upvote count: 5
has comment: http://stackoverflow.com/comment/45724860
tagged with: d3.js
tagged with: css
type: AnsweredQuestion
has title: SVG Group Translation Issue - Wrong Units?
downvote count: 0
has comment: http://stackoverflow.com/comment/45715530
has answer: http://stackoverflow.com/a/28721774
accepted answer: http://stackoverflow.com/a/28721774

http://stackoverflow.com/comment/45567295
score: 0
type: Comment
type: QuestionComment
has text: Declare the var $x as an array initially perhaps?
comment on: http://stackoverflow.com/q/28633654

http://stackoverflow.com/q/28618502
type: Question
tagged with: javascript
has title: How to get equal spacing in ssh with javascript console.log
answer count: 2
downvote count: 0
has body: I'm running javascript with node.js and looking at the console.logs through Putty. How can I get the terminal in ssh to show me things with the tabs inline? I see two tab spaces but the string following is out of place depending on how long the first string is. console.log('short'+'\t\t'+'valueA'); console.log('looooooong'+'\t\t'+valueH); I might get something like this short valueA looooooong valueH whereas for readability it would be much nicer to see short valueA looooooong valueH
favorite count: 0
tagged with: console
tagged with: terminal
tagged with: ssh
has answer: http://stackoverflow.com/a/28641253
has answer: http://stackoverflow.com/a/69483852
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28641253
score: 1
possible better answer: http://stackoverflow.com/a/69483852
upvote count: 1

http://stackoverflow.com/a/28693390
has body: you need to bind to the spin event to get the value entered then update the DOM accordingly function quantity(price, multiplier) { if (multiplier === 1) { return '$' + price.toFixed(2); } return '$' + (price * multiplier).toFixed(2); } $( ".spinner" ).spinner({ min: 1, spin: function (event, ui) { var value = ui.value; var $target = $(event.target); var $priceCell = $target.parents('td').next('td'); var $subtotalCell = $priceCell.next('td'); $subtotalCell.text(quantity($priceCell.data('price'), value)); } }); fiddle - http://jsfiddle.net/m6csdx51/1/ notice the addition of data-price to the price cells
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28692880

http://stackoverflow.com/comment/45783725
type: QuestionComment
comment on: http://stackoverflow.com/q/28750146
score: 0
type: Comment
has text: @acquinas are you talking about the code that calls `_addTweetToFeed`? or the code that is called on the `$("body").on("click")`?

http://stackoverflow.com/comment/45663185
type: Comment
has text: The second answer to the linked question shows how to do it: http://stackoverflow.com/a/4760279/218196
type: QuestionComment
comment on: http://stackoverflow.com/q/28685128
score: 0

http://stackoverflow.com/comment/45731516
score: 1
comment on: http://stackoverflow.com/a/28722264
type: AnswerComment
type: Comment
has text: // given url http://example.com/#/some/path?foo=bar&baz=xoxo var searchObject = $location.search(); // => {foo: 'bar', baz: 'xoxo'} // set foo to 'yipee' $location.search('foo', 'yipee'); // $location.search() => {foo: 'yipee', baz: 'xoxo'}

http://stackoverflow.com/a/28600258
has comment: http://stackoverflow.com/comment/45506544
score: 1
has comment: http://stackoverflow.com/comment/45508871
has body: $scope.createChallenge = function() { //get the field and store in db $scope.resetForm(); } $scope.master = {}; $scope.resetForm = function() { $scope.submitted = false; //Try adding this $scope.challenge = angular.copy($scope.master); $scope.createvalidation.$setPristine(); }
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45506586
accepted answer of: http://stackoverflow.com/q/28599600
type: Answer
answers question: http://stackoverflow.com/q/28599600
has comment: http://stackoverflow.com/comment/45511749
upvote count: 1

http://stackoverflow.com/comment/45603654
has text: Absolutely fantastic, I'm always learning, I was reading the Angular docs and couldn't figure out how to solve my problem before I posted my question, the actual use-case I have is a lot more complicated than this one but I figured that learning how to do a simple version of what I want to do, I can figure the rest myself, the last bit about changing the sorting actually covered something I was going to do next too so thank you so much!
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28635397
type: AnswerComment

http://stackoverflow.com/comment/45792822
type: QuestionComment
comment on: http://stackoverflow.com/q/28707975
score: 0
type: Comment
has text: yes, but since the functionality changed when I upgraded I figured there would be a property i could set

http://stackoverflow.com/a/28729517
upvote count: 1
has body: The way you are selecting your bxSlider in the link instance is incorrect. I assume selecting the class is generating multiple instances. Here is a way to make it work: link: function(scope, elm, attrs) { elm.ready(function() { $(elm).bxSlider({ mode: 'fade', autoControls: true, slideWidth: 360, slideHeight:600 }); }); }
score: 1
answers question: http://stackoverflow.com/q/28728994
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28728994

http://stackoverflow.com/a/28745053
type: Answer
has body: $.browser Will not work in jQuery 1.9 or later unless the jQuery Migrate plugin is included. Source: http://api.jquery.com/jquery.browser/
has comment: http://stackoverflow.com/comment/45772832
answers question: http://stackoverflow.com/q/28744938
score: 0

http://stackoverflow.com/q/28710754
has answer: http://stackoverflow.com/a/28710880
tagged with: angularjs
has body: I've just started learning Angular and my first big question relates to the use of handlebars expressions such as {{ variableName }}. When the HTML first loads but before the JS executes, shouldn't the users see a bunch of handlebars expressions all over the page before they're evaluated as the JS executes? Wouldn't this cause a glitchy appearance? Since I assume that must not happen, how has the effect been accomplished?
answer count: 5
has title: Why don't users see the {{ handlebars expressions }} in Angular when the page first loads?
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/28710781
has answer: http://stackoverflow.com/a/28710929
upvote count: 2
has comment: http://stackoverflow.com/comment/45710271
type: Question
possible better answer: http://stackoverflow.com/a/28710880
has answer: http://stackoverflow.com/a/28710835
accepted answer: http://stackoverflow.com/a/28710835
has answer: http://stackoverflow.com/a/28710798
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45710331
favorite count: 0

http://stackoverflow.com/q/28605999
tagged with: javascript
has body: I'm trying to write some JavaScript code that connects to SoundCloud and lists the tracks on my Soundcloud profile. (https://soundcloud.com/bigwedgeofcheese) I have been following the instructions here: https://developers.soundcloud.com/docs/api/sdks I've added a page called callback.html to my locally hosted website as per the instructions. I have no issues in Chrome but in Internet Explorer I get the following error after the 'Allow “SoundcloudTestApp” access to your SoundCloud account?' page has disappeared. Line: 7 Error: Unable to get property 'setTimeout' of undefined or null reference This is coming from here: Connect with SoundCloud This popup should automatically close in a few seconds But this works fine in Chrome. Please can anyone help? If you need more info, please let me know and I'll add it. Thanks
score: 0
tagged with: soundcloud
answer count: 1
has answer: http://stackoverflow.com/a/28606227
has title: Issue authenticating with SoundCloud in Internet Explorer 11
type: UnansweredQuestion
tagged with: authentication
type: Question
tagged with: window.opener

http://stackoverflow.com/a/48236860
type: Answer
downvote count: 0
has body: If you are looking for a sheet function look at ISNUMBER(), it seems to know if text can be converted to a number. If you are in js the code: if (isNaN(parseFloat(your_data))==false) seem to work to detect if you can convert the string to a number.
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28599507

http://stackoverflow.com/comment/45624102
type: AnswerComment
has text: Hey @Mark. Your solution is also working for my UseCase. Thanks a lot! Now I'm finally able to use the jQuery TableSorter Plugin :) Thanks again!!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28663263

http://stackoverflow.com/comment/45607088
type: Comment
comment on: http://stackoverflow.com/a/28654842
score: 0
type: AnswerComment
has text: Why are you using `$.each` their is just one one input with both the names

http://stackoverflow.com/a/28692077
accepted answer of: http://stackoverflow.com/q/28692001
answers question: http://stackoverflow.com/q/28692001
upvote count: 1
score: 1
has body: This is likely a setting in your browser to clear your cookies when you close it. So it cannot be resolved by code, some users will have this setting enabled and won't want to use cookies so you should plan for that situation.
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/45653624
score: 0
comment on: http://stackoverflow.com/a/28680014
type: Comment
has text: As an aside, in response to your edit (reviewed here: http://stackoverflow.com/review/suggested-edits/7136477), might I suggest reading these articles: "[What is the etiquette for modifying posts?](http://meta.stackexchange.com/questions/11474/what-is-the-etiquette-for-modifying-posts)" and "[Why can people edit my posts? How does editing work?](http://stackoverflow.com/help/editing)"
type: AnswerComment

karma-jasmine
tags question: http://stackoverflow.com/q/28655451
type: Tag
tags question: http://stackoverflow.com/q/28665841
tags question: http://stackoverflow.com/q/28651306
tags question: http://stackoverflow.com/q/28718584
tags question: http://stackoverflow.com/q/28702108
tags question: http://stackoverflow.com/q/28728237
tag name: karma-jasmine

http://stackoverflow.com/a/28618811
downvote count: 0
has comment: http://stackoverflow.com/comment/77426966
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/28618766
has body: This will work in Chrome 39 and above. First you need to put the "clipboardRead" permission into the permissions section of the manifest file. See these links for more details on that: https://developer.chrome.com/apps/manifest and https://developer.chrome.com/apps/declare_permissions Then, you can use this function: // getClipboardText - return any text that is currently on the clipboard function getClipboardText() { // create div element for pasting into var pasteDiv = document.createElement("div"); // place div outside the visible area pasteDiv.style.position = "absolute"; pasteDiv.style.left = "-10000px"; pasteDiv.style.top = "-10000px"; // set contentEditable mode pasteDiv.contentEditable = true; // find a good place to add the div to the document var insertionElement = document.activeElement; // start with the currently active element var nodeName = insertionElement.nodeName.toLowerCase(); // get the element type while (nodeName !== "body" &amp;&amp; nodeName !== "div" &amp;&amp; nodeName !== "li" &amp;&amp; nodeName !== "th" &amp;&amp; nodeName !== "td") { // if have not reached an element that it is valid to insert a div into (stopping eventually with 'body' if no others are found first) insertionElement = insertionElement.parentNode; // go up the hierarchy nodeName = insertionElement.nodeName.toLowerCase(); // get the element type } // add element to document insertionElement.appendChild(pasteDiv); // paste the current clipboard text into the element pasteDiv.focus(); document.execCommand('paste'); // get the pasted text from the div var clipboardText = pasteDiv.innerText; // remove the temporary element insertionElement.removeChild(pasteDiv); // return the text return clipboardText; }
score: 3
has comment: http://stackoverflow.com/comment/77424547

http://stackoverflow.com/a/28641256
has body: If the string is at the beginning of the response, simple &amp; fast: $.get(url).done(function(data) { data = data.split('%26mode%3d%26code%3d500|')[1]; }
type: Answer
answers question: http://stackoverflow.com/q/28641175
score: 0

http://stackoverflow.com/a/28629268
has body: You should use Ajax to send data to the server &lt;script&gt; function sendData(){ var data1 = "Hello"; var data2 = "World"; var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function(){ if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) alert(xmlhttp.responseText); } xmlhttp.open("GET", "ajax.php?data1=" + data1 + "&amp;data2=" + data2, true); xmlhttp.send(); } &lt;/script&gt; You call the sendData function, when the button is clicked: &lt;input type=button value="test" onClick="sendData()"&gt; The server reads the GET-Parameter if(isset($_GET['data1']) &amp;&amp; isset($_GET["data2"])){ $data1 = $_GET["data1"]; $data2 = $_GET["data2"]; return $data1 . " " . $data2 . " was sent to the server"; }
score: 0
has comment: http://stackoverflow.com/comment/45633496
has comment: http://stackoverflow.com/comment/45631395
has comment: http://stackoverflow.com/comment/45559377
has comment: http://stackoverflow.com/comment/45559063
type: Answer
answers question: http://stackoverflow.com/q/28629019

http://stackoverflow.com/a/28696277
answers question: http://stackoverflow.com/q/28696140
score: 0
type: Answer
has body: Use jquery My Button function MyFunc(element) { var parentNd = element.parentElement parentNd.innerHTML += " Hello " + element.innerHTML $("#x").remove(); } DEMO OR use below code it will also works function MyFunc(element) { var parentNd = element.parentElement document.write(element.innerHTML); parentNd.removeChild(element); } Note: I didn't prefer this method , i think the best idea is hide the button in onclick event

http://stackoverflow.com/a/28604032
has comment: http://stackoverflow.com/comment/45514598
has comment: http://stackoverflow.com/comment/45514727
upvote count: 1
has comment: http://stackoverflow.com/comment/45514318
score: 1
accepted answer of: http://stackoverflow.com/q/28602911
answers question: http://stackoverflow.com/q/28602911
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45513955
downvote count: 0
has body: You can try to use the ng-model-options attribute in order to limit the api callings. Just append ng-model-options="{ debounce: 500 }" to your input, the model will be updated only 0.5 sec after the last change. If the the trigger is a ng-change directive it will limit the amount of query. Don't hestitate to use as well the input directives like ng-minlengthand ng-maxlength Moreover, you can use a boolean to block the api callings when a query is already in progress. You could do something like this. var Resource = $resource(URL, {},{ getAutocompleteResults: { method: "GET" }}); var locked = false; function getMoreData() { if(locked) return; locked = true; Resource.autoCompleteResults() .$promise.then(function(data) { $scope.autocompleteViewResults = data; locked = false; }); } Furthermore I highly recommend you to store your code logic into factories and/or services.
type: Answer

http://stackoverflow.com/a/28638841
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45578444
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28638566
has comment: http://stackoverflow.com/comment/45582577
type: Answer
has comment: http://stackoverflow.com/comment/45590611
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28638566
has body: Assuming you are passing in a string, the best way to handle this would be to arrange your arrays into an object. So instead of: var skins = []; var eyes = []; // etc... You'll have something like: parts = { skins: [], eyes: [], // etc }; Now in your function you can do something like: function SwitchElement(type){ var cur = parts[type].indexOf(document.getElementById(type).src); console.log(cur); if(cur &lt; parts[type].length-1){ } }
has comment: http://stackoverflow.com/comment/45582003
has comment: http://stackoverflow.com/comment/45582977

datatables
tags question: http://stackoverflow.com/q/28659670
tags question: http://stackoverflow.com/q/28739189
tags question: http://stackoverflow.com/q/28739800
tags question: http://stackoverflow.com/q/28617443
tags question: http://stackoverflow.com/q/28600819
tags question: http://stackoverflow.com/q/28593854
tags question: http://stackoverflow.com/q/28730147
tags question: http://stackoverflow.com/q/28679534
tags question: http://stackoverflow.com/q/28605806
tags question: http://stackoverflow.com/q/28701980
tags question: http://stackoverflow.com/q/28737441
tags question: http://stackoverflow.com/q/28727470
tags question: http://stackoverflow.com/q/28662890
tags question: http://stackoverflow.com/q/28718241
type: Tag
tag name: datatables
tags question: http://stackoverflow.com/q/28707975
tags question: http://stackoverflow.com/q/28678968
tags question: http://stackoverflow.com/q/28729687
tags question: http://stackoverflow.com/q/28622212

http://stackoverflow.com/q/28632126
has body: I'm creating a bubble chart with the Google Visualizations API and have a nice looking chart that I'm happy with. Using the API reference documentation, I've made some custom changes to the appearance of the chart var options = { title: 'Cool Chart', hAxis: { title: 'System Score', baseline: 0, maxValue: 4, ticks: [2,4] }, vAxis: { title: 'Financial Score', baseline: 0, maxValue: 4, ticks: [2,4] }, bubble: { textStyle: {fontSize: 11}, opacity: .6 }, series: {'High': {color: 'red'}, 'Medium': {color: 'yellow'}, 'Low': {color: 'green'} }, sizeAxis: { minValue: 3.5, maxValue: 25, }, chartArea: { backgroundColor: '#123456' } The chartArea.backgroundColor is where I'm looking for guidance. I've added a hex color here, no problem. But I'd love is to replace that with a CSS3 gradient like this: background: -moz-linear-gradient(45deg, #ff120a 0%, #f8fc02 47%, #4bd31d 100%); (I know that's just for Mozilla...) I've scoured the API documentation to see if there's a way to do this - but I'm hoping they just left out this part. Does anyone know if this is do-able...and if so, how to do it? I can knock it out in straight CSS - but when put in JavaScript, I lose traction. Thanks for reading and I look forward to hearing your thoughts.
score: 2
downvote count: 0
type: Question
upvote count: 2
tagged with: google-visualization
has comment: http://stackoverflow.com/comment/76877812
tagged with: javascript
favorite count: 0
tagged with: css
answer count: 0
type: UnansweredQuestion
has title: Can I add a CSS3 gradient to Google Visualizations Bubble Chart background?

http://stackoverflow.com/comment/45523842
has text: is this part of generated HTML document? or source of php.file?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28609997

http://stackoverflow.com/comment/45607791
has text: I think `row` should be `Row`
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28655644

http://stackoverflow.com/a/28736994
has body: You are fixing the top value top:556px; which would vary in different browsers. You need to set bottom:0 to the bottom div with absolute position. .topfix { height: 100%; /*add other styles*/ } figure#caption { position: absolute; /*add other styles*/ bottom: 0; }
answers question: http://stackoverflow.com/q/28736735
type: Answer
score: 2
upvote count: 2
downvote count: 0

http://stackoverflow.com/a/28628302
has comment: http://stackoverflow.com/comment/45561985
upvote count: 5
answers question: http://stackoverflow.com/q/28628288
has comment: http://stackoverflow.com/comment/45556950
downvote count: 0
type: Answer
has body: Via className property: var element = document.getElementById('myelement'); element.className = 'a b'; However, as mentioned by @dfsq in the comments, you probably have to fix your CSS rules to set classes for the same element rather than for its descendants, e.g. .a.b { color: red; }. DOC: https://developer.mozilla.org/en-US/docs/Web/API/Element.className
score: 5

http://stackoverflow.com/comment/45653941
type: Comment
has text: http://gyazo.com/f530ca0e9d6817f832adf1255676ad9d works on firefox 32.0.3, without vertical align the longer labels appear too high
comment on: http://stackoverflow.com/a/28675211
type: AnswerComment
score: 0

http://stackoverflow.com/a/78927455
type: Answer
answers question: http://stackoverflow.com/q/28620087
upvote count: 1
has comment: http://stackoverflow.com/comment/139178222
has body: process.stdout.write('\x1b[2K'); process.stdout.write(`${anyDataOrText}` + '\x1b[0G'); \x1b[2K = remove last \x1b[0G = put new
score: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/139184763

http://stackoverflow.com/comment/45662214
has text: Basically , it requires 2 values to perform any operation so after getting first number from the user I erased the edit text ,saved it in an integer variable and then again taken 2nd number in another integer variable.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28684137
type: Comment

http://stackoverflow.com/a/28655667
has comment: http://stackoverflow.com/comment/45608411
has comment: http://stackoverflow.com/comment/45608149
has comment: http://stackoverflow.com/comment/45608298
has comment: http://stackoverflow.com/comment/45607836
has comment: http://stackoverflow.com/comment/45607855
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45607819
has body: Just make a function out of your code... function changeElem(y1,m1,d1,elem){ d = new Date(); i = new Date(y1,m1,d1,0,0,0); //This is my "argument" var timesince = Math.floor((d.getTime() - i.getTime())/1000/60); var unit = "min"; var colour = '#AAA'; if (timesince &gt; 60){ timesince = Math.floor(timesince/60); unit = "h"; if (timesince &gt; 7) colour = '#a46744'; } elem.innerHTML = timesince.toString()+unit; elem.style.color = colour; } To apply it to all a elements just do... var elem = document.getElementsByTagName("a"); [].forEach.call(elem, function(e){ var y = +e.getAttribute("data-y"); var m = +e.getAttribute("data-m"); var d = +e.getAttribute("data-d"); changeElem(y,m,d,e); }); (I used + unary operator to convert the string to numberical value, getAttribute will fetch the data attributes.) And the a tag should be like &lt;a href="..." data-y="2014" data-m="0" data-d="19"&gt;...&lt;/a&gt;
has comment: http://stackoverflow.com/comment/45608586
answers question: http://stackoverflow.com/q/28655637
type: Answer
has comment: http://stackoverflow.com/comment/45608169
accepted answer of: http://stackoverflow.com/q/28655637
has comment: http://stackoverflow.com/comment/45608477
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45607962

http://stackoverflow.com/a/28706435
type: Answer
has body: you need a object for this structure, for instance: locals: { menus: { m1: ['a', 'b', 'c', 'd'], m2: ['x', 'y', 'z'], m3: ['i', 'ii'] } } then you can use this template: ul each menuKey in Object.keys(menus) - menu = menus[menuKey] li a(href='')=menuKey ul each submenu in menu li a(href='') #{submenu} you can try this on this site: http://jade-lang.com/demo/ copy paste the template to the top left, and the locals to the top right textarea.
has comment: http://stackoverflow.com/comment/45873967
upvote count: 4
type: AcceptedAnswer
downvote count: 0
score: 4
accepted answer of: http://stackoverflow.com/q/28615164
answers question: http://stackoverflow.com/q/28615164

http://stackoverflow.com/a/28679129
score: 1
has comment: http://stackoverflow.com/comment/45651329
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45651330
type: Answer
accepted answer of: http://stackoverflow.com/q/28679072
has comment: http://stackoverflow.com/comment/45651276
answers question: http://stackoverflow.com/q/28679072
has body: The second call to the console is being run before the function updateMap is called. Place your second console.log() directly after you call updateMap.

http://stackoverflow.com/q/28612604
accepted answer: http://stackoverflow.com/a/28612785
has title: dynamically add jquery ajax options
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28612785
tagged with: javascript
type: AnsweredQuestion
has body: I have some couchdb queries, for which I'm using the jquery-couchdb plugin. I'd like to compile a set of queries with which I can decide at call-time what options to set. E.g. $db.view("design/view", { success: function(data) { // do something e.g.: callback_function(data); }, option1: value1, option2: value2 // What if I want an option3 to be set only some of the time? }); Is there a way to achieve this? Something like running over kwargs in python, or a way to pass in an object with keys and values? Cheers, Matt
tagged with: jquery
tagged with: ajax
type: Question

http://stackoverflow.com/comment/45552945
comment on: http://stackoverflow.com/q/28625889
type: Comment
type: QuestionComment
score: 0
has text: You said it was before, so presumably - yes. (Unless you've changed other things about the page, such as putting it in a different security zone)

http://stackoverflow.com/comment/45881076
has text: no problem while display buttons but at a time i want to select only one radio not multiple from a list of radio buttons
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28745240

http://stackoverflow.com/a/28737737
downvote count: 0
has body: Cool, you are almost there! There are two things you're missing. We need 2 players! Create a second random variable, or a second player if you like. Then you need to invoke your random() function, or nothing will happen. Try this: var rPs = ["Rock", "Paper", "Scissors"]; // We need two random variables, one for 'you' var you = rPs[Math.floor(Math.random() * 3)]; // and one for the 'computer' var computer = rPs[Math.floor(Math.random() * 3)]; // Now invoke function random(you, computer); function random(you, computer){ if (you===computer){ console.log ("It's a tie!"); } else if (you==="Rock" &amp;&amp; computer === "Scissors" || you === "Paper" &amp;&amp; computer==="Rock"||you==="Scissors"&amp;&amp;computer==="Paper") { console.log ("You've won!"); } else { console.log ("You've lost!"); } }
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45882907
upvote count: 2
answers question: http://stackoverflow.com/q/28737679
has comment: http://stackoverflow.com/comment/45843609

http://stackoverflow.com/q/28744275
has comment: http://stackoverflow.com/comment/45772826
score: 2
answer count: 0
upvote count: 2
type: UnansweredQuestion
has title: How can I revert a jquery draggable object after drop event
has comment: http://stackoverflow.com/comment/45771776
type: Question
tagged with: jquery-ui
has body: Can you tell me please how can I revert the position of a draggable object after been dropped ? $(".draggable").draggable({revert: "invalid"}); is not what I want. I want that the droppable reverts the draggable after the drop event, not the draggable reverts itself to its initial position after drop event. (Sorry for my bad english). I want that because I have two droppable and one draggable. The first droppable removes the draggable and the second droppable displays more information about the draggable. After that, the draggable reverts to its initial position. Thank you !
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/28600205
tagged with: parse-platform
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45628705
has title: Parse.com: unable to get recently created objectid in parse javascript
has body: I am trying to save a record then getting new created objectId.I am using following Code. var query = new Parse.Query("Inspection"); var Inspection = new Parse.Object("Inspection"); query.include('property'); query.equalTo("property", { "__type": "Pointer", "className": "Property", "objectId": propertyId}); query.first({ success: function(inspectionData) { Inspection.set("companyAddress", inspectionData.get("companyAddress")); Inspection.set("companyLogo", inspectionData.get("companyLogo")); Inspection.set("tenantPhone", inspectionData.get("tenantPhone")); Inspection.save().then(function(Inspection) { console.log("in success"); console.log(Inspection); console.log(Inspection.id); }, function(error) { console.log("Error: " + error.code + " " + error.message); }); }, error: function(error) { console.log('in error') console.log("Error: " + error.code + " " + error.message); } }); But new record inserted and i did not get the console.log of "in success" and object id. What i am doing wrong ? Thanks in advance.
has comment: http://stackoverflow.com/comment/45567633
has answer: http://stackoverflow.com/a/28620660
type: Question
tagged with: javascript
score: 0
answer count: 1
tagged with: facebook-javascript-sdk

http://stackoverflow.com/comment/45533313
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28612873
has text: How can i cumulate multiple board type on a single button filter. Ex: i have divs with Bed And Breakfast and some of them with Breakfast Buffet, can i use the Breakfast button to show both of them ?
type: AnswerComment

http://stackoverflow.com/q/28625281
has comment: http://stackoverflow.com/comment/45551960
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45551936
has comment: http://stackoverflow.com/comment/45551908
has comment: http://stackoverflow.com/comment/45551655
has comment: http://stackoverflow.com/comment/45551669
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45551722
type: Question
has answer: http://stackoverflow.com/a/28626453
has comment: http://stackoverflow.com/comment/45551591
has answer: http://stackoverflow.com/a/28626646
has comment: http://stackoverflow.com/comment/45551831
answer count: 2
has body: I have the following code for an angularjs app : &lt;li class="sm c" ng-repeat="msg in chat.msgs"&gt; &lt;p&gt;{{chat.msgs[$index - 1].ts}}&lt;/p&gt; chat.msgs contains the following :- {"1424093810600290": {"mId":"1424093810600290","ts":1424093810000,"s":"o_S"}, "1423736194723684": {"mId":"1423736194723684","ts":1423736194000,"s":"o_R"}}, so on .. How can I access chat.msgs[$index - 1] form ? Because there is no index but a unique id. I need to access the ts for the previous message.
has comment: http://stackoverflow.com/comment/45551845
has comment: http://stackoverflow.com/comment/45551697
has comment: http://stackoverflow.com/comment/45552052
score: 0
has comment: http://stackoverflow.com/comment/45551769
has title: $index issue in angularjs
tagged with: javascript

http://stackoverflow.com/a/30567263
type: Answer
has comment: http://stackoverflow.com/comment/49911408
upvote count: 18
score: 18
has body: The problem is when you install mongoose via npm it assumes you have python installed on your windows and tries to build required libraries. Since you do not have python it skips building phase with a warning. But when you start your application, required modules are not there so you get this error. In order to do things right first install python (version 2.7) on your computer from: https://www.python.org/downloads/ or if u have installed chockolatey just type choco install python2. Then make sure your python variable is set. You can set it on command prompt like: SET python=D:\Python27\python.exe (Of course you should change the path according to your location of python) Then install node-gyp: npm install -g node-gyp Now you can reinstall mongoose or whatever module causing the problem: npm install mongoose You will see some yellow lines instead of red ones this time but the error will be gone.
has comment: http://stackoverflow.com/comment/49968240
downvote count: 0
has comment: http://stackoverflow.com/comment/59117092
answers question: http://stackoverflow.com/q/28651028
has comment: http://stackoverflow.com/comment/53446954

http://stackoverflow.com/q/28636255
has answer: http://stackoverflow.com/a/28636628
tagged with: oop
has answer: http://stackoverflow.com/a/28638110
answer count: 5
has body: Whats the difference between these two approaches? First approach // Shape - superclass function Shape() { this.x = 0; this.y = 0; } // superclass method Shape.prototype.move = function(x, y) { this.x += x; this.y += y; }; // Rectangle - subclass function Rectangle() { Shape.call(this); } // subclass extends superclass Rectangle.prototype = Object.create(Shape.prototype); Rectangle.prototype.constructor = Rectangle; var rect = new Rectangle(); Second approach // Shape - superclass function Shape() { this.x = 0; this.y = 0; } // superclass method Shape.prototype.move = function(x, y) { this.x += x; this.y += y; }; // Rectangle - subclass function Rectangle() { Shape.call(this); } // subclass extends superclass Rectangle.prototype = new Shape(); var rect = new Rectangle();
has answer: http://stackoverflow.com/a/28636336
score: 2
downvote count: 0
tagged with: javascript
has title: javascript object inheritance - subclass and superclass
has answer: http://stackoverflow.com/a/28636447
accepted answer: http://stackoverflow.com/a/28638110
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45572720
possible better answer: http://stackoverflow.com/a/28636406
favorite count: 0
has answer: http://stackoverflow.com/a/28636406
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/45572304
linked to: http://stackoverflow.com/q/28159784

http://stackoverflow.com/a/28674184
has body: tip: your for has no body (putting ; after it just loops without doing anything)... and it does not make sense to define a function inside that for.
answers question: http://stackoverflow.com/q/28674102
score: 0
type: Answer

http://stackoverflow.com/q/28630716
tagged with: javascript
score: 0
answer count: 1
tagged with: templates
has answer: http://stackoverflow.com/a/28630876
type: UnansweredQuestion
has body: I'm trying to get data from a list into a single template in onsen, sort of the detail template The controller has data already from an ajax http function, I get an empty page at the detail template though, the shopitemcontroller is the controller I use to show the index data... the shop controller gets all the list data so a user can click and get the detail template frustrating module.controller('ShopItemController', function($scope){ $scope.item = $scope.activeItem; }); module.controller('ShopController', function($scope, $http, $interval){ $scope.items = $shop.items; $scope.showItem = function(index){ var activeItem = $scope.items[index]; $scope.activeItem = activeItem; $scope.ons.navigator.pushPage('shop_item.html', {title : activeItem.item_title}); };
has title: Angular js how to get index data into another template
type: Question

http://stackoverflow.com/comment/45605504
comment on: http://stackoverflow.com/q/28654202
type: Comment
type: QuestionComment
has text: Why don't you read the lodash's [`reduce`](https://github.com/lodash/lodash/blob/master/lodash.js#L6447) code?
score: 0

http://stackoverflow.com/a/28601708
has comment: http://stackoverflow.com/comment/45513420
accepted answer of: http://stackoverflow.com/q/28600097
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28600097
type: Answer
has body: Add these css attributes to your #fixedContainer selector: overflow-x: auto; max-width: 100%;
downvote count: 0
score: 1

http://stackoverflow.com/comment/45723080
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28717907
has text: Is this on live ?Then I need to see this .. because there has to be something that is why it is giving an error.
type: Comment

http://stackoverflow.com/q/28722102
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/34116117
downvote count: 0
has body: my URLs look like this at the moment: http://www.sitename.com/watch?companyId=507f1f77bcf86cd799439011&amp;employeeId=507f191e810c19729de860ea&amp;someOtherId=..... So, as you can see, it gets pretty long, pretty fast. I was thinking about shortening these ObjectIds. Idea is that I should add new field called "shortId" to every model in my database. So instead of having: var CompanySchema = mongoose.Schema({ /* _id will be added automatically by mongoose */ name: {type: String}, address: {type: String}, directorName: {type: String} }); we would have this: var CompanySchema = mongoose.Schema({ /* _id will be added automatically by mongoose */ shortId: {type: String}, /* WE SHOULD ADD THIS */ name: {type: String}, address: {type: String}, directorName: {type: String}, }); I found a way to do it like this: // Encode var b64 = new Buffer('47cc67093475061e3d95369d', 'hex') .toString('base64') .replace('+','-') .replace('/','_') ; // -&gt; shortID is now: R8xnCTR1Bh49lTad But I still think it could be shorter. Also, I found this npm module: https://www.npmjs.com/package/short-mongo-id but I don't see it's being used too much so I can't tell if it's reliable. Anyone has any suggestions?
has answer: http://stackoverflow.com/a/28743431
favorite count: 0
possible better answer: http://stackoverflow.com/a/34116117
tagged with: node.js
type: AnsweredQuestion
score: 7
accepted answer: http://stackoverflow.com/a/28743431
tagged with: objectid
upvote count: 7
type: Question
tagged with: mongodb
has title: Shorten ObjectId in node.js and mongoose
tagged with: mongoose

http://stackoverflow.com/q/28602684
possible better answer: http://stackoverflow.com/a/28602733
has answer: http://stackoverflow.com/a/28602733
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28602729
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28602729
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has body: The html code is; Categories Discipline Main Group Technical Contracts Procurement / Logistics Administrative Financial Legal Effect on (Part 1) Warranty Operability Reliability Reputation the function is; $(function () { $('.list_who_to_mail').on('change', function() { var id = $(this).attr("id"); var value = $("#"+id).val(); $("#list_mail").append(value); }); }); The concept is when user clicks on the select fields function will collect ids of fields and with these ids it will list emails in "#list_mail". The question is; when I click any option values all ids are writing side by side in the div. How can I ignore previous selection and write only last selected id of every option on the div? Considering "disciplineSelect", name="main", categoryID" and "observedPhase[]". Thanks in advance Edit: language
favorite count: 0
has title: How can I ignore previous selection and write only last selected
upvote count: 1

http://stackoverflow.com/a/36019256
has body: This is called "destructuring assignment" in ECMAScript 6. Mozilla Developer Network has some examples: var a, b; [a, b] = [1, 2] {a, b} = {a:1, b:2} It is supported in Node.js since at least version 8, and also in some browsers, as you can see in this ECMAScript compatibility table. You can still use it if you transpile your code to ECMAScript 5 with something like Babel.
downvote count: 0
score: 3
type: Answer
answers question: http://stackoverflow.com/q/28617513
upvote count: 3

http://stackoverflow.com/q/28738177
has body: We have the function function Buffer(initValue) { this.append(initValue); } Buffer.prototype = { items: [], append: function(str) { this.items[this.items.length] = str instanceof Buffer ? str.toString() : str; return this; }, toString: function() { return this.items.join(""); } }; console.log(new Buffer("one").append(new Buffer("two")).toString()); but suddenly it logs "onetwoonetwo" - beyond all expectations... Why?
linked to: http://stackoverflow.com/q/16063394
has title: Why doesn't the below code log "onetwo" as expected?
has comment: http://stackoverflow.com/comment/45760450
tagged with: javascript
has comment: http://stackoverflow.com/comment/45760467
type: Question
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28738532
has comment: http://stackoverflow.com/comment/45763850
has answer: http://stackoverflow.com/a/28738367
has answer: http://stackoverflow.com/a/28738985
type: UnansweredQuestion

http://stackoverflow.com/comment/45574851
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28636518
type: AnswerComment
has text: `[^a-z0-9\s.|]` matches already all the characters of the other character class, so the second part is not needed.

http://stackoverflow.com/comment/45551822
comment on: http://stackoverflow.com/q/28625344
has text: will you please rephrase your question and tell us what is exact problem you are facing?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28681237
upvote count: 1
has comment: http://stackoverflow.com/comment/45667028
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28680809
has body: This is possible, my code might have some errors, but here it is: elem = document.querySelectorAll('#my-element')[0]; function callClickOnDescendants(element, event){ for (var i = 0, len = element.children.length; i &lt; len; i++){ element.children[i].onclick.call(element.children[i], event); callClickOnDescendants(element.children[i], event); } } elem.onclick = function(event){ callClickOnDescendants(elem, event); } If you wait before downvoting, I'll be able to test in a jsfiddle. EDIT It works, jsfiddle proof
answers question: http://stackoverflow.com/q/28680809
type: Answer

http://stackoverflow.com/comment/45775649
type: QuestionComment
has text: Browser does not allow cross domain AJAX requests due to security issues. Cross-domain requests are allowed only if the server specifies same origin security policy. If you have access to the server code then it is possible. Check out this post http://hayageek.com/cross-domain-ajax-request-jquery/
comment on: http://stackoverflow.com/q/28746581
score: 1
type: Comment

http://stackoverflow.com/a/28612265
score: 1
type: Answer
upvote count: 1
has body: closest() works on the parent of the element. hr and input are not parent of label. thanks
answers question: http://stackoverflow.com/q/28610965
downvote count: 0

http://stackoverflow.com/comment/45593144
comment on: http://stackoverflow.com/a/28646164
has text: @Matthias I could be wrong. But, I looked around at the code, briefly, and the above *seems* to be the case. From my understanding, the `href` link is used to point to two types of resources: internal and external. Internal resources are places within the same document that user can "bounce" to (Wikipedia does this, a lot). External, obviously, would be other documents. Typically, when looking at things like dynamic user-interfaces (with pop-ups, etc.), that's all handled with JavaScript and JQuery.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/28660572
has comment: http://stackoverflow.com/comment/45616917
answers question: http://stackoverflow.com/q/28660324
type: Answer
has body: Reading here: Using document.write. When the page finishes loading, the document becomes closed. An attempt to document.write in it will cause the contents to be erased. Further the .load() function is used to load data from a server. I believe you want the .html function. [Untested] Change the line $('#basket-info').load(document.write(basket_text())); To $('#basket-info').html(basket_text());
has comment: http://stackoverflow.com/comment/45617147
has comment: http://stackoverflow.com/comment/45617008
score: 0
has comment: http://stackoverflow.com/comment/45616883

http://stackoverflow.com/comment/45754057
score: 0
comment on: http://stackoverflow.com/q/28734393
type: Comment
type: QuestionComment
has text: 100 switches? That's pretty crazy. I think you should consider server-sided processing with a database, in that case.

mongodb
tags question: http://stackoverflow.com/q/28653797
tags question: http://stackoverflow.com/q/28669345
tags question: http://stackoverflow.com/q/28626765
tags question: http://stackoverflow.com/q/28744944
tags question: http://stackoverflow.com/q/28638403
tags question: http://stackoverflow.com/q/28702884
tags question: http://stackoverflow.com/q/28658688
tags question: http://stackoverflow.com/q/28749471
tags question: http://stackoverflow.com/q/28680741
tags question: http://stackoverflow.com/q/28663273
tag name: mongodb
tags question: http://stackoverflow.com/q/28615670
tags question: http://stackoverflow.com/q/28707368
tags question: http://stackoverflow.com/q/28617798
tags question: http://stackoverflow.com/q/28651028
tags question: http://stackoverflow.com/q/28628282
tags question: http://stackoverflow.com/q/28709172
tags question: http://stackoverflow.com/q/28653243
tags question: http://stackoverflow.com/q/28623910
tags question: http://stackoverflow.com/q/28651281
tags question: http://stackoverflow.com/q/28632858
tags question: http://stackoverflow.com/q/28691735
tags question: http://stackoverflow.com/q/28649593
tags question: http://stackoverflow.com/q/28715859
tags question: http://stackoverflow.com/q/28686821
type: Tag
tags question: http://stackoverflow.com/q/28675545
tags question: http://stackoverflow.com/q/28715451
tags question: http://stackoverflow.com/q/28745046
tags question: http://stackoverflow.com/q/28640179
tags question: http://stackoverflow.com/q/28675254
tags question: http://stackoverflow.com/q/28655090
tags question: http://stackoverflow.com/q/28598034
tags question: http://stackoverflow.com/q/28688615
tags question: http://stackoverflow.com/q/28615666
tags question: http://stackoverflow.com/q/28641302
tags question: http://stackoverflow.com/q/28620984
tags question: http://stackoverflow.com/q/28620161
tags question: http://stackoverflow.com/q/28724936
tags question: http://stackoverflow.com/q/28638980
tags question: http://stackoverflow.com/q/28710378
tags question: http://stackoverflow.com/q/28733046
tags question: http://stackoverflow.com/q/28617862
tags question: http://stackoverflow.com/q/28614136
tags question: http://stackoverflow.com/q/28646121
tags question: http://stackoverflow.com/q/28742052
tags question: http://stackoverflow.com/q/28727110
tags question: http://stackoverflow.com/q/28729374
tags question: http://stackoverflow.com/q/28598286
tags question: http://stackoverflow.com/q/28731664
tags question: http://stackoverflow.com/q/28593944
tags question: http://stackoverflow.com/q/28722102
tags question: http://stackoverflow.com/q/28626410
tags question: http://stackoverflow.com/q/28731992
tags question: http://stackoverflow.com/q/28606443
tags question: http://stackoverflow.com/q/28614282
tags question: http://stackoverflow.com/q/28674771

firefox
tags question: http://stackoverflow.com/q/28657604
tags question: http://stackoverflow.com/q/28714638
tags question: http://stackoverflow.com/q/28637589
tags question: http://stackoverflow.com/q/28724774
tags question: http://stackoverflow.com/q/28715319
tags question: http://stackoverflow.com/q/28633231
tags question: http://stackoverflow.com/q/28629513
tags question: http://stackoverflow.com/q/28708096
tags question: http://stackoverflow.com/q/28692014
tags question: http://stackoverflow.com/q/28714541
tag name: firefox
tags question: http://stackoverflow.com/q/28689873
tags question: http://stackoverflow.com/q/28697491
tags question: http://stackoverflow.com/q/28632729
tags question: http://stackoverflow.com/q/28594143
tags question: http://stackoverflow.com/q/28750167
tags question: http://stackoverflow.com/q/28695572
tags question: http://stackoverflow.com/q/28727574
tags question: http://stackoverflow.com/q/28709011
tags question: http://stackoverflow.com/q/28635379
tags question: http://stackoverflow.com/q/28677145
tags question: http://stackoverflow.com/q/28737615
type: Tag
tags question: http://stackoverflow.com/q/28647607
tags question: http://stackoverflow.com/q/28725561
tags question: http://stackoverflow.com/q/28653825
tags question: http://stackoverflow.com/q/28644468
tags question: http://stackoverflow.com/q/28691133
tags question: http://stackoverflow.com/q/28672897
tags question: http://stackoverflow.com/q/28700498
tags question: http://stackoverflow.com/q/28719691
tags question: http://stackoverflow.com/q/28676186
tags question: http://stackoverflow.com/q/28626395
tags question: http://stackoverflow.com/q/28736870
tags question: http://stackoverflow.com/q/28705634
tags question: http://stackoverflow.com/q/28633221
tags question: http://stackoverflow.com/q/28593513
tags question: http://stackoverflow.com/q/28690643
tags question: http://stackoverflow.com/q/28714930

http://stackoverflow.com/q/28705009
has comment: http://stackoverflow.com/comment/45701668
has answer: http://stackoverflow.com/a/28705478
accepted answer: http://stackoverflow.com/a/28706630
has answer: http://stackoverflow.com/a/28705453
has title: How do I get the server uptime in Node.js?
downvote count: 0
possible better answer: http://stackoverflow.com/a/28705478
favorite count: 0
tagged with: node.js
has answer: http://stackoverflow.com/a/28705480
type: AnsweredQuestion
has body: How do I get a server uptime in Node.js so I can output it by a command like; if(commandCheck("/uptime")){ Give server uptime; } Now I don't know how to calculate the uptime from the server's startup.
type: Question
has answer: http://stackoverflow.com/a/43147967
has answer: http://stackoverflow.com/a/28706630
score: 18
has answer: http://stackoverflow.com/a/41662715
tagged with: javascript
answer count: 6
upvote count: 18

http://stackoverflow.com/a/28638921
has comment: http://stackoverflow.com/comment/45943161
answers question: http://stackoverflow.com/q/28638760
upvote count: 1
has comment: http://stackoverflow.com/comment/45577955
has body: When you start the timer, save the current date-time. var start_dt = Date.now(); When you want to update the display, start by using the following: var current_dt = Date.now(); var elapsed_ms = current_dt - start_dt; That gives an accurate count of the elapsed time. Repeatedly incrementing a variable as you are doing will drift. Now, it's time to format as H:MM:SS function format_timer(ms) { var s = ("0" + Math.floor((ms / ( 1000)) % 60)).substr(-2); var m = ("0" + Math.floor((ms / ( 60*1000)) % 60)).substr(-2); var h = Math.floor((ms / (60*60*1000)) ); return h + ":" + m + ":" + s; }
has comment: http://stackoverflow.com/comment/45943658
has comment: http://stackoverflow.com/comment/45577427
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45943626
type: Answer

http://stackoverflow.com/comment/45764423
type: Comment
has text: https://jsfiddle.net/8z4x2eha/2/
comment on: http://stackoverflow.com/q/28740265
score: 0
type: QuestionComment

http://stackoverflow.com/q/28701174
has body: I am sure this has been cover by many people. So sorry for asking What will work to control a on click speed that someone can press. Need to not log the person out but need to slow the load on server as user seam to be using auto-clickers. i want to be-able to set in milliseconds. Exp 1) <?php // Checking Clicks $now = microtime(); if ($_SESSION['click'] > ($now-0.05)) { $message = die(' src="images/Unknown.png" /> Error: Don\'t '); } $_SESSION['click'] = $now; this works but will only do 1 sec microtime would not go below 1 sec so i was thing ing this would be a workable 2) <?php // Checking Clicks $now = microtime(true); if ($_SESSION['click'] > ($now < 100)) { $message = die(' Error: Don\'t '); } $_SESSION['click'] = $now; or just a loop <?php // Checking Clicks $now = for($i=0;$i<100;$i++); if ($_SESSION['click'] > ($now)) { $message = die(' Error: Don\'t '); } $_SESSION['click'] = $now; Thanks what would be best and what is wrong no need for time stamp in db
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/45692663
has comment: http://stackoverflow.com/comment/45694716
has title: microtime mouse click speed
answer count: 0
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45692523

http://stackoverflow.com/comment/45531691
comment on: http://stackoverflow.com/a/28614116
has text: If it was any item in the array?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28701729
has comment: http://stackoverflow.com/comment/45697967
accepted answer of: http://stackoverflow.com/q/28701499
answers question: http://stackoverflow.com/q/28701499
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45701607
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45701746
has body: I think there's a problem with how the data is stored: Every object needs to have a unique id Every Child object needs to return a reference to the parentId. This needs to be stored on insert or creation of the child object. There needs to be a way to look up any object by id

http://stackoverflow.com/comment/45748885
score: 0
type: Comment
type: QuestionComment
has text: @KenFyrstenberg, you're completely right. I'll refine my prototype to edit this question later.
comment on: http://stackoverflow.com/q/28723568

http://stackoverflow.com/q/28687843
answer count: 3
has body: I'm creating a div inside a for loop and placing them on the document. 2 divs are to be placed side by side and the following 2 divs below them and so on. Can someone suggest me what would be the css styling for this case? Here is my code for (var i = 0; i &lt; piechartDataArray.length; i++) { var elementID = 'piechart' + (i+1).toString(); var element = document.createElement('div'); element.id = elementID; document.body.appendChild(element); if (i%2 == 0) { document.getElementById(elementID).style.width=... }else{ document.getElementById(elementID).style.width=... } }
has answer: http://stackoverflow.com/a/28687884
has answer: http://stackoverflow.com/a/28688058
has comment: http://stackoverflow.com/comment/45668036
favorite count: 0
accepted answer: http://stackoverflow.com/a/28687884
possible better answer: http://stackoverflow.com/a/28688058
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/45668017
type: AnsweredQuestion
downvote count: 2
upvote count: 1
type: Question
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45668037
has title: Placing div side by side in a for loop - CSS styling
has answer: http://stackoverflow.com/a/28687897

http://stackoverflow.com/a/28735851
has body: Well, I got it solved, just changed $event.currentTarget.className; to $event.target and .append to .after to avoid duplication tooltips. so the code becomes: $scope.showToolTip = function(text,$event){ angular.element($event.target).after('&lt;p class="tooltip2"&gt;' +text+ '&lt;/p&gt;'); }; $scope.hideToolTip = function($event) { angular.element(document).find('.tooltip2').remove(); }; html remains same. Let me know If I have added simplest custom tooltip in AngularJS :) Here is the CSS: .tooltip2 { display:block; position:absolute; border:1px solid #333; background-color:#161616; border-radius:5px; padding:10px; color:#fff; font-size:12px Arial; } Working fine now
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28735793
answers question: http://stackoverflow.com/q/28735793
score: 0

http://stackoverflow.com/comment/45580601
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28640760
has text: of course nothing easier as that. wait for answere

http://stackoverflow.com/q/28737511
type: Question
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28737537
has answer: http://stackoverflow.com/a/28737563
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/28737563
has title: how to avoid return of case sensitive
has answer: http://stackoverflow.com/a/28737537
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28737586
has body: I use the following code and its working just for case senestive values, i want some how to overcome it that if the user use capital or lower case it will work the same,how should I do that ? oAc.setFilterFunction(function(sValue, oItem) { debugger; var val = (oItem.getText().indexOf(sValue) != -1) || (oItem.getAdditionalText().indexOf(sValue) != -1); return val; }); in sValue i got the value and val return true or false in oItem.getText() I got the text to compare with like if I got in sValue = i and the oItem.getText() return index the method return true.

http://stackoverflow.com/comment/45672166
score: 4
comment on: http://stackoverflow.com/q/28690303
has text: I think this **not** deserves a downvote. Why?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/34404774
has body: I did a bunch of research and as far as I can tell these are your two options: Use a transparent &lt;div&gt; to cover the link/image using a &lt;div&gt; with style="background: url(yourimage.png)" instead of &lt;img src="yourimage.png"&gt; The core problem is that mobile IE on Windows Phone doesn't properly handle preventDefault with contextmenu events. That is the proper way to do this and it works in every other browser. The contextmenu event is fired on WP IE but it actually happens when the long press context menu is dismissed. It should happen before even showing the menu so that you can prevent it. Here are some of the other options I tried: Events: I tried registering for every event and using e.preventDefault(), e.stopPropagation() and return false to prevent all of the default actions. JSBin example. Use element:before or element:after to place an element on top of the link or image. I thought this might be able to automatically do what the transparent &lt;div&gt; does. Unfortunately the :before or :after content is part of the &lt;a&gt; so it is all clickable as well. Also, apprently &lt;img&gt; elements don't support :before or :after. JSBin example. user-select: none -ms-touch-action -webkit-touch-callout: none I even pinged someone on the IE team and he didn't know of a way.
score: 2
answers question: http://stackoverflow.com/q/28610143
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28610143
upvote count: 2
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/45557665
type: Comment
comment on: http://stackoverflow.com/q/28628287
score: 0
has text: choosen_year is sending a blank value, so try changing it from hidden to text so you can watch the value is for it.. The string "" means it never has had a value set. try doing an alert on "$(choosenYear).select2('data').id" in the first line of your change event
type: QuestionComment

ruby-on-rails-4
type: Tag
tags question: http://stackoverflow.com/q/28646112
tags question: http://stackoverflow.com/q/28681971
tags question: http://stackoverflow.com/q/28630062
tags question: http://stackoverflow.com/q/28635049
tags question: http://stackoverflow.com/q/28696685
tags question: http://stackoverflow.com/q/28649717
tags question: http://stackoverflow.com/q/28669769
tag name: ruby-on-rails-4
tags question: http://stackoverflow.com/q/28619731
tags question: http://stackoverflow.com/q/28621179

http://stackoverflow.com/a/28632061
score: 4
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28632025
has comment: http://stackoverflow.com/comment/45564058
accepted answer of: http://stackoverflow.com/q/28632025
has body: It's because the .next() method only returns the next adjacent element. If the very next sibling element doesn't have class .csvTable-box, nothing is selected. If you want to iterate through all the next sibling elements, use the .nextAll() method, and then chain .first() if you want to reduce the set so that only the first match is returned. $(this).nextAll('.csvTable-box').first();
upvote count: 4

http://stackoverflow.com/comment/45734503
comment on: http://stackoverflow.com/q/28723248
has text: I read the same article, but i could not understand it. Could you please tell me what is wrong with my above code?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45550348
score: 0
has text: try with `$(window).load(fn)`
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28624363

http://stackoverflow.com/comment/45513757
comment on: http://stackoverflow.com/q/28602030
has text: @ArtjomB.I tryed with 1.9.2,1.9.8,2.0
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28683069
tagged with: gulp
favorite count: 0
type: UnansweredQuestion
tagged with: gulp-ruby-sass
has comment: http://stackoverflow.com/comment/45659304
has comment: http://stackoverflow.com/comment/45659451
has answer: http://stackoverflow.com/a/28683347
score: 3
downvote count: 0
has body: I've used the gulp-ruby-sass a number of times, however on this new project my task is failing with the following error: gulp-ruby-sass stderr: OptionParser::NeedlessArgument: needless argument: --sourcemap=none Use --trace for backtrace. Here's my package.json { "name": "new", "version": "1.0.0", "main": "gulpfile.js", "license": "ISC", "devDependencies": { "gulp": "^3.8.11", "gulp-concat": "^2.5.2", "gulp-connect": "^2.2.0", "gulp-ng-annotate": "^0.5.2", "gulp-ruby-sass": "^1.0.0-alpha.3", "gulp-sourcemaps": "^1.3.0" } } Gulpfile.js: // Include gulp var gulp = require('gulp'); // Include Our Plugins var concat = require('gulp-concat'); var uglify = require('gulp-uglify'); var minifyCSS = require('gulp-minify-css'); var ngannotate = require('gulp-ng-annotate'); var sass = require('gulp-ruby-sass'); var sourcemaps = require('gulp-sourcemaps'); var connect = require('gulp-connect'); var gutil = require('gulp-util'); var paths = { js: ['assets/js/app.js', 'assets/js/controllers/*.js', 'assets/js/services/*.js', 'assets/js/directives/*.js'], sass: ['assets/css/styles.scss'] }; //SASS task gulp.task('sass', function () { return sass (paths.sass) .pipe(concat('all.min.css')) .pipe(gulp.dest('assets/css/')) .pipe(connect.reload()); }); styles.scss: @import "modules/mixins.scss"; @import "modules/vars.scss"; @import "modules/reset.scss"; @import "modules/header.scss"; @import "modules/footer.scss"; Folder structure is: app assets css modules header.scss footer.scss etc.... styles.scss (this is outside of the modules folder) Like I said, ive used this plugin a number of times over the past year. It seems this 'alpha' version has caused a lot of issues. Has anyone experienced this issue? How can I resolve. My whole project is on halt until this is resolved :(
type: Question
tagged with: sass
has title: New gulp-ruby-sass alpha task failing
tagged with: javascript
upvote count: 3
answer count: 1

http://stackoverflow.com/q/28684428
has body: Is it possible to get the results of "fusiontabledata" and "fusiontabledata2", compare both and generate a third "sidebar" showing only the duplicates? document.getElementById('sidebar_1').innerHTML = fusiontabledata; document.getElementById('sidebar_2').innerHTML = fusiontabledata2; function getData_From(response) { FTresponse = response; numRows = response.getDataTable().getNumberOfRows(); numCols = response.getDataTable().getNumberOfColumns(); fusiontabledata = " "; fusiontabledata += " "; for (i = 0; i < numRows; i++) { for (j = 0; j < numCols; j++) { fusiontabledata += " " + response.getDataTable().getValue(i, j) + " "; } fusiontabledata += " "; } fusiontabledata += " " document.getElementById('sidebar_1').innerHTML = fusiontabledata; } function getData_To(response) { FTresponse = response; numRows = response.getDataTable().getNumberOfRows(); numCols = response.getDataTable().getNumberOfColumns(); fusiontabledata2 = " "; fusiontabledata2 += " "; for (i = 0; i < numRows; i++) { for (j = 0; j < numCols; j++) { fusiontabledata2 += " " + response.getDataTable().getValue(i, j) + " "; } fusiontabledata2 += " "; } fusiontabledata2 += " " document.getElementById('sidebar_2').innerHTML = fusiontabledata2; }
downvote count: 4
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/28695629
tagged with: innerhtml
score: -4
has comment: http://stackoverflow.com/comment/45661748
tagged with: google-fusion-tables
type: Question
tagged with: javascript
tagged with: google-maps
answer count: 1
has comment: http://stackoverflow.com/comment/45662023
favorite count: 0
has comment: http://stackoverflow.com/comment/45661941
accepted answer: http://stackoverflow.com/a/28695629
has title: How to compare innerHTML string?

http://stackoverflow.com/q/28670052
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45634287
has body: I am trying to navigate through next pageS using js. It's working fine with navigation but the only issue is it's not getting stop when "next" button is not available. Can we stop it if "next >>" is not available Currently It's loop remains infinite :( var clickNext; clickNext= headerCode; clickNext+= "TAG POS=1 TYPE=STRONG ATTR=TXT:next&lt;SP&gt;»" + "\n"; clickNext+= "WAIT SECONDS=5"+ "\n"; var nextLink = 1; for(var i=1; i&lt;=99999999; i++) { if(nextLink = 1) iimPlay(clickNext); if(nextLink === 0) break;}
score: 0
has title: Next Page Navigation
type: UnansweredQuestion
tagged with: macros
has comment: http://stackoverflow.com/comment/45655066
tagged with: imacros
has comment: http://stackoverflow.com/comment/45671963
type: Question
has answer: http://stackoverflow.com/a/28745932

http://stackoverflow.com/comment/45771510
score: 1
has text: @PanzerKadaver I'm going to add an answer for another fix.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28743686

http://stackoverflow.com/comment/45639812
type: Comment
type: QuestionComment
has text: @adeneo oh sorry! it's my bad it wont work..!
score: 0
comment on: http://stackoverflow.com/q/28673068

http://stackoverflow.com/q/28684350
favorite count: 0
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45662130
has comment: http://stackoverflow.com/comment/45661987
duplicate of: http://stackoverflow.com/q/3106605
has body: My problem is that I'm trying to remove an event listener on javascript. I had the listener as anonymous as I was passing parameters. The problem is that I have to remove the event listener from all the images later on in my code. I realize I need to re-write my code in order to give it an ID of some kind but I'm really struggling. Here is the part of my code that needs changing, any help will be great. var images = document.getElementsByTagName("img"); for (var i = 0; i &lt; 4; i++) { listenForI(i); } function listenForI(i) { images[i].addEventListener("click",function() { changeImage(i); }); }
score: 1
type: Question
has title: Removing event listener with anonymous listener
upvote count: 2
has comment: http://stackoverflow.com/comment/45662981
tagged with: addeventlistener
has comment: http://stackoverflow.com/comment/45661868
tagged with: javascript
has comment: http://stackoverflow.com/comment/45661735
has comment: http://stackoverflow.com/comment/45662044
linked to: http://stackoverflow.com/q/3106605
downvote count: 1

http://stackoverflow.com/a/28680165
score: 0
has comment: http://stackoverflow.com/comment/45662876
type: Answer
has body: It looks weird, but I found the solution. It seems you can pass selected in the call from caller only and even if it is defined in the generic function, it will work. Check this out. I just added return so that condition can be evaluated. and it worked. I tested with all different conditions and it is working ..sweet, but weird. jQuery(document).ready(function() { profile_field_toggler("base[remove_option]", "general_passwordassword_block", function() {return(selected == "auth")}); });
answers question: http://stackoverflow.com/q/28679892

http://stackoverflow.com/comment/45646231
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28612124
has text: Hard for me to guess. Are you sure the URL is correct?

http://stackoverflow.com/comment/45660140
type: Comment
type: QuestionComment
has text: What is .get[] ? What you are trying to achieve can done by data[1][1] .
score: 3
comment on: http://stackoverflow.com/q/28683626

http://stackoverflow.com/comment/45618080
type: Comment
score: 1
type: AnswerComment
has text: Pure CSS-animations are smoother especially on mobile-phones
comment on: http://stackoverflow.com/a/28661349

http://stackoverflow.com/q/28750297
has body: I am building an app that would overlay phone cases with designs and save the final image to a folder. The code below works and shows up in the browser but i want to be able to save the image automatically as soon as the page is loaded. The goal is to run this script using a cron so images are generated and saved automatically. I have tried using canvas.toDataURL and canvas2image to no success? What am i doing wrong? How do i go about achieving it? (function () { var canvas = document.getElementById('canvas'); canvas.width = 403; canvas.height = 800; var ctx = canvas.getContext("2d"); $.when( loadImage('./img/pattern.jpg'), loadImage('./img/iphone_mask.png'), loadImage('./img/iphone_overlay.png') ).then( function (patternImage, maskImage, overlayImage){ ctx.save(); ctx.drawImage(maskImage, 0, 0); ctx.globalCompositeOperation = "source-in"; ctx.drawImage(patternImage, 0, 0); ctx.globalCompositeOperation = "destination-atop"; ctx.restore(); ctx.drawImage(overlayImage, 0, 0); } ); function loadImage(url){ var promise = $.Deferred(); var image = new Image(); image.src = url; image.onload = function(){ promise.resolve(image); }; image.onerror = promise.reject; return promise; } })(); `
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
score: -1
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28750425
favorite count: 0
type: UnansweredQuestion
has title: Save canvas as image using javascript
has comment: http://stackoverflow.com/comment/45799139
downvote count: 1

http://stackoverflow.com/q/28651924
downvote count: 0
has comment: http://stackoverflow.com/comment/45601354
type: UnansweredQuestion
score: 1
has body: How can I group ng-shows without ruining the dom tree order? Reason: I want to decrease the amount of watchers For example I have these ng-shows: A B C D E Can I somehow do something like this: A B {{ng-show-start(canEdit)}} C D E {{ng-show-end(canEdit)}} Using an DOM element instead of ng-show-start&end can also be an solution, but it must be able to remove its element and show the contents on true.
has title: Angularjs - grouping ng show
tagged with: javascript
type: Question
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/28652189
has comment: http://stackoverflow.com/comment/45601157
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/52257333

http://stackoverflow.com/comment/45583480
type: AnswerComment
type: Comment
has text: Is this correct ? $currentdatetime "(date('Ymd')"; echo $currentdatetime
comment on: http://stackoverflow.com/a/28642127
score: 0

http://stackoverflow.com/a/28746995
type: AcceptedAnswer
has body: Something like this, example here: var combinationsFormController = { prop1: {'prop1':7}, prop2: {'prop2':8}, prop3: {'prop2':9}, 1: {'prop1':7}, 2: {'prop2':8}, 3: {'prop2':9}, 7: {'prop1':7}, 8: {'prop2':8}, 9: {'prop2':9}, }; var arrProps=[]; for ( property in combinationsFormController ) { if (combinationsFormController.hasOwnProperty(property)) { console.log( property ); arrProps.push(property) } }
downvote count: 0
answers question: http://stackoverflow.com/q/28746868
has comment: http://stackoverflow.com/comment/45776321
type: Answer
has comment: http://stackoverflow.com/comment/45776397
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28746868

http://stackoverflow.com/comment/45608934
score: 0
type: AnswerComment
has text: Sorry @haim770 is right. It's early in the morning, mixed them up :-). Updated it.
type: Comment
comment on: http://stackoverflow.com/a/28656301

http://stackoverflow.com/a/28689744
answers question: http://stackoverflow.com/q/28689521
score: 0
type: Answer
has body: Try this... document.getElementsByTagName("input").addEventListener("click", function(){ alert('hello');});

http://stackoverflow.com/a/28837310
type: Answer
has comment: http://stackoverflow.com/comment/46037841
downvote count: 0
score: 1
has body: I am using something like this on one of my projects, had the same problem hope it helps: window.onLoad = function(callback) { $(document).ready(callback); $(document).on('page:load', callback); }; and then wrap up my functions with onLoad, something like onLoad(function() { counter() }); The onLoad function binds the ready event and the turbolink page:load event
answers question: http://stackoverflow.com/q/28619731
upvote count: 1

http://stackoverflow.com/a/50814421
has body: I created a code so that it will not allow more that 3 event in day cell. drop: function(t, a) { var n = e(this).data("eventObject"), r = e.extend({}, n); var date = new Date(t._d); var year = date.getFullYear(); var rawMonth = parseInt(date.getMonth()) + 1; var month = rawMonth &lt; 10 ? '0' + rawMonth : rawMonth; var rawDay = parseInt(date.getDate()) + 1; var day = rawDay &lt; 10 ? '0' + rawDay : rawDay; var dropdate = year+'-'+month+'-'+day; var eventId = ''; var totalEvents = e('#calendar').fullCalendar( 'clientEvents', function(eventObj){ eventId = eventObj._id; var date = new Date(eventObj.start._d); var year = date.getFullYear(); var rawMonth = parseInt(date.getMonth()) + 1; var month = rawMonth &lt; 10 ? '0' + rawMonth : rawMonth; var rawDay = parseInt(date.getDate()) + 1; var day = rawDay &lt; 10 ? '0' + rawDay : rawDay; var newdate = year+'-'+month+'-'+day; if (dropdate == newdate) { return true; } else { return false; } }).length; if( totalEvents &gt; 3 ){ e('#calendar').fullCalendar('removeEvents', eventId); } },
score: -1
downvote count: 1
type: Answer
upvote count: 0
answers question: http://stackoverflow.com/q/28732674

http://stackoverflow.com/q/28708096
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45705659
has body: I am trying to edit a Firefox preference in the about:config, general.useragent.override, which actually does not even exist by default, but I want my code to create it or overwrite its existing value at will without using the Firefox GUI, and instead using my Java app to edit the prefs.js or user.js files. However, I do not see the prefs.js file in the folder of the profile I'm using (the default profile), nor do I see user.js, which I realize user.js isn't created by default, but even when I do manually create them, and start Firefox, the code line below: user_pref("general.useragent.override","Foobar"); doesn't change this preference. I have also tried using the pref instead as below: pref("general.useragent.override","Foobar"); But this also doesn't work. I just want a simple Java method that can edit Firefox preferences. Any suggestions?
tagged with: java
type: Question
tagged with: firefox
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45707379
answer count: 1
has comment: http://stackoverflow.com/comment/45706810
has title: Editing Firefox Preferences without Firefox
has comment: http://stackoverflow.com/comment/45706380
has answer: http://stackoverflow.com/a/28709125
accepted answer: http://stackoverflow.com/a/28709125
has comment: http://stackoverflow.com/comment/45705808

http://stackoverflow.com/q/28673433
has comment: http://stackoverflow.com/comment/45640345
tagged with: javascript
tagged with: jquery
score: -1
answer count: 2
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has body: I have been created time-line for my web page, by using html,css3 and js. html: Title 4 India’s Saina Nehwal won the Australian Badminton Open Super Series title at the State Sports Centre in Sydney on 29 June, 2014. Saina began the match in aggressive fashion as she raced into a 12-8 lead in the first game against Spain’s Carolina Marin in the final. 2014 css: .cntl-center { left:0; right:0; margin-left:auto; margin-right:auto; } .cntl-bar { position: absolute; width: 10px; top: 0; bottom: 0; background-color: #ccc; box-shadow: inset 0px 0px 7px -2px #000; } .cntl-bar-fill { background-color: #66cc00; position: absolute; left:0; right:0; top:0; height:0; } .cntl-state { position: relative; width:100%; min-height: 200px; margin-bottom: 50px; } .cntl-state::after { display:block; content: ' '; clear:both; } .cntl-icon { border-radius: 50%; width: 100px; height: 100px; background-color: #003300; border: solid 3px #009900; box-shadow: 0px 0px 19px -9px #000; position: absolute; top: 0; text-align: center; line-height: 100px; font-size: 40px; color: #fff; } .cntl-content { width: 30%; padding: 2%; background-color: rgba(238, 238, 238, 0.25); border-radius: 8px; border-bottom: solid 3px #009900; float:left; opacity:0; position:relative; margin-left:-40%; } .cntl-state:nth-child(2n+2) .cntl-content { float:right; margin-right:-40%; } .cntl-image { opacity:0; width: 40%; padding: 2%; } .cntl-state:nth-child(2n+1) .cntl-image { float:right; } .cntl-content h4 { font-size:20px; font-weight: normal; margin-bottom: 10px; } /* animations */ .cntl-bar-fill,.cntl-content,.cntl-image { -webkit-transition: all 500ms ease; -moz-transition: all 500ms ease; -o-transition: all 500ms ease; -ms-transition: all 500ms ease; transition: all 500ms ease; } .cntl-state:nth-child(2n+2).cntl-animate .cntl-content { margin-right:6%; } .cntl-animate .cntl-content { opacity:1; margin-left:6%; } .cntl-animate .cntl-image { opacity:1; } And i have used js files also, i m trying to create jsfiddle, bu…
favorite count: 0
type: UnansweredQuestion
tagged with: css
has answer: http://stackoverflow.com/a/28674935
has answer: http://stackoverflow.com/a/28673738
upvote count: 0
has title: Issue in joining the image and description in html
type: Question

http://stackoverflow.com/comment/45555539
type: Comment
comment on: http://stackoverflow.com/a/28627445
has text: encodeURIComponent(name) doesn't do anything about '.' or '/'
score: 1
type: AnswerComment

http://stackoverflow.com/a/29859755
score: 0
answers question: http://stackoverflow.com/q/28605001
type: Answer
has body: If you know angular.js you could create a separate html file for the text you want to add/replace and instead of replacing all the text through javascript you could just create &lt;div ng-include="'html-with-text.html'"&gt;&lt;/div&gt; with javascript.

http://stackoverflow.com/comment/45665815
type: QuestionComment
has text: try `div_resizable.attr("id", "div_resizable");`
score: 0
comment on: http://stackoverflow.com/q/28686678
type: Comment

http://stackoverflow.com/q/28633796
tagged with: twitter-bootstrap
tagged with: dynamic-loading
has body: I have the following: Titel Autor Datum But what I want is the following: The inputfield shouldn't be always there, I'm looking for a solution to dynamically load the "item" under the select, when one of the first two options is chosen, the textbox should appear, when you choose the 3rd entry, then a calendar should appear (Datum means date, so you should be able to choose a date in a calendar). Maybe I also have to carry about, that nothing is prechosen in the select-box, otherwise it's a bit bizarre, when theres something chosen but nothing has appeared to enter sth.
type: Question
has answer: http://stackoverflow.com/a/28633951
has answer: http://stackoverflow.com/a/28634596
tagged with: javascript
score: 0
answer count: 2
type: UnansweredQuestion
has title: HTML Select, Javascript dynamic load

http://stackoverflow.com/q/28746798
type: UnansweredQuestion
has body: This jsfiddle seems to be working fine for me, however when I try to replicate it doesn't work, when I press the button nothing happens? http://jsfiddle.net/KPEGU/1850/ Here's my code: test Column One Column Two Column Three row1 Col1 row1 Col2 row1 Col3 row2 Col1 row2 Col2 row2 Col3 row3 Col1 row3 Col2 row3 Col3 Export Table data into Excel Notes To write in new document and download the csv format without jQuery Any idea why? Thank you! -warfo09
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28746845
linked to: http://stackoverflow.com/q/28766357
has comment: http://stackoverflow.com/comment/45779092
has comment: http://stackoverflow.com/comment/45775846
type: Question
has title: Can't seem to get this jsfiddle to work locally...?
tagged with: jsfiddle
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45812798
answer count: 1
has comment: http://stackoverflow.com/comment/45776431

http://stackoverflow.com/q/28648379
tagged with: eclipse
type: Question
has answer: http://stackoverflow.com/a/28668140
tagged with: javascript
upvote count: 2
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has body: I want to emulate some Java classes and therefore I use the super-source tag in a gwt.xml module. I created two eclipse projects one only for the super sources and another which contains the app code. The super source project has the following structure: / /super/Emul.gwt.xml /super/emul/EmulatedJavaClass.java Emul.gwt.xml contains: &lt;super-source path="emul"/&gt; In eclipse I right clicked on the super folder and added it to the Build Path. That works fine. The problem is that eclipse shows an error on the package tag of my emulated java files. In my emulated package I cannot use: &lt;super-source path=""/&gt; This will give an error while compilation. Can I do something that Eclipse does not show an error in the package and still have all the nice eclipse features like code completion?
has title: Handle GWT super-source in Eclipse
tagged with: gwt
type: AnsweredQuestion
score: 2
downvote count: 0
accepted answer: http://stackoverflow.com/a/28668140
tagged with: java

http://stackoverflow.com/comment/45591760
has text: I'm not really using any manual login procedures, but I am only using `accounts-password`, not any OAuth-based providers or anything like that.
comment on: http://stackoverflow.com/q/28647061
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28693338
has body: I am writing a function that checks if a n-dimensional array has a certain value: function checkVal(array, value) { if (value exists) { return true; } else { return false; } } My problem is that I want this function to work for any array regardless of its number of dimensions or types of elements. I tried to first flatten the array, but only managed to do it for a couple of dimensions. EDIT: Some examples of possible arrays: var arr1 = ['1','3',['a','b'],'4,5']; var arr2 = ['a','b',['c','d',['e',['e',['e',['e',['e',['e',['e',['e',['e',['e',['f',['f',['f',['f',['f',['f',['g',['g',['g',['g',['g',['g',['g',['h']]]]]]]]]]]]]]]]]]]]]]]]]];
has answer: http://stackoverflow.com/a/28693426
downvote count: 3
type: Question
answer count: 2
upvote count: 0
possible better answer: http://stackoverflow.com/a/28693478
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/28693478
accepted answer: http://stackoverflow.com/a/28693426
has comment: http://stackoverflow.com/comment/45677684
has title: Check if value exists in random n-dimensional array Javascript
favorite count: 0
tagged with: multidimensional-array
score: -3
type: AnsweredQuestion

http://stackoverflow.com/comment/136384952
type: Comment
comment on: http://stackoverflow.com/a/28617779
has text: Just to add to this, these are the options for when you create the google.maps.KmlLayer object and not google.maps.Map
type: AnswerComment
score: 0

http://stackoverflow.com/a/28642354
has comment: http://stackoverflow.com/comment/45586776
has comment: http://stackoverflow.com/comment/45587052
has comment: http://stackoverflow.com/comment/45588242
has comment: http://stackoverflow.com/comment/45586589
score: 0
has body: var svgcontainer = d3.select("body").append("svg") .attr("width", 200) .attr("height",200); //d3.json("real.json",function(json){ var json = { "residues":[ {"name":"A","mut":[ {"what":"A1H","type":"non-neutral"} ],"cx": 50,"cy":50, "r":20}, {"name":"H","cx": 90,"cy":80, "r":20} ]}; var elem = svgcontainer.selectAll("div") .data(json.residues); var elemEnter = elem.enter() .append("g"); var circle = elemEnter.append("circle") .attr("cx",function(d){ return d.cx;}) .attr("cy",function(d){ return d.cy;}) .attr("r",function(d){ return d.r;}) .style("fill","red"); elemEnter.append("text") .attr("dy", function(d){ return d.cy+5; }).attr("dx",function(d){ return d.cx-5;}) .text(function(d){return d.name}); //}) ; &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.11/d3.min.js"&gt;&lt;/script&gt; var circle = elemEnter.append("circle") .attr("cx",50) .attr("cy",50) .attr("r",10) .style("fill","red"); Don't use static values to set cx, cy and r values of circle, using static values will set all the circle to be in one position, we can't see all the circles only circle will be visible. elemEnter.append("text") .attr("dx",-20) .text(function(d){return d.name}); Here also we are setting dx value of text with -20, negative value will take the element out of svg, so we can't see the text, try to set the dx and dy values of text according to circle cx and cy values this will set both together. I made all the changes, Hope you got it. If not ask me for more.
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/45586160
accepted answer of: http://stackoverflow.com/q/28641821
has comment: http://stackoverflow.com/comment/45597017
answers question: http://stackoverflow.com/q/28641821

http://stackoverflow.com/comment/45505280
type: Comment
type: QuestionComment
has text: Array iteration is one problem, see the duplicate to solve it. There's another problem though with treating `g` as if it were a number or string, however it's actually a DOMNode. Not sure what you're expecting from it, but maybe something like `g.innerHTML` or such.
comment on: http://stackoverflow.com/q/28599592
score: 0

http://stackoverflow.com/q/28745530
has body: We have a single page app and we have a divs for each page like this: &lt;div id="page1"&gt; &lt;/div&gt; &lt;div id="page2"&gt; &lt;/div&gt; In page2 I have a button to get the image from the gallery and this is my code to get image: function getPhoto() { navigator.camera.getPicture(onPhotoURISuccess, onFail, { destinationType: Camera.DestinationType.FILE_URI, quality: 30, sourceType: Camera.PictureSourceType.SAVEDPHOTOALBUM }); } function onPhotoURISuccess(imgURI) { } But the problem is after getting image, the page is getting refreshed because of that entire page is reloaded and it is coming to page1 div (the initial div which we show). My question is how can I prevent cordova from refreshing the page? Since after capturing the image I want to convert it to a base64 data so I cannot avoid onPhotoURISuccess() event. Can anyone help me or give me some hints to override this behaviour?
has comment: http://stackoverflow.com/comment/45774682
type: Question
has comment: http://stackoverflow.com/comment/61316882
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45773756
linked to: http://stackoverflow.com/q/8368091
tagged with: jquery
has title: Prevent cordova/phonegap camera plugin from refreshing the page
type: UnansweredQuestion
tagged with: android
tagged with: http://stackoverflow.com/tag/html
tagged with: cordova
answer count: 0

http://stackoverflow.com/a/28734053
answers question: http://stackoverflow.com/q/28733813
has comment: http://stackoverflow.com/comment/45753564
has body: without using pure javascript, use jQuery like the following code. $('document').ready(function(){ $('#imageDialog').on('click',function(){ alert($('#imageDialog select').value); }) })
has comment: http://stackoverflow.com/comment/45753536
score: 0
type: Answer

http://stackoverflow.com/q/28720851
has comment: http://stackoverflow.com/comment/45728613
accepted answer: http://stackoverflow.com/a/28722235
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45728768
has title: Can't figure out how to create a function which takes two date parameters as a range and checks if the dates between are palindromes
has body: Sorry if the title is hard to understand, if anyone has a better title please suggest it or edit it. I have a project I've been given that I'm having some trouble with. Problem statement: Implement a function named palindrome that takes a start and end date as parameters and returns a distinct set of Dates in chronological order(inclusive of start and end dates) that, when formated as MMddyyyy, are palindromes. So far I've been able to create a function that takes a single string value, reverses it, then does a check between the two to see if they're palindromes. SCRIPT function palindrome(date1, date2){ check_date = new Date(date1); while(check_date < date2){ check_date.setTime(check_date.getTime() + 86400000); console.log(check_date); var reverse_date = check_date.split("").reverse().join(""); if(check_date == reverse_date){ console.log(check_date +" is a palindrome."); } else{ console.log(check_date +" is not a palindrome."); } } } palindrome(2000, 2015); HTML Get Reverse However, I have no clues as to how I go about getting the dates between two distinct years and then printing them out chronologically if they are palindromes after being formatted. Can anyone provide guidance?
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28721151
has answer: http://stackoverflow.com/a/28722235
has answer: http://stackoverflow.com/a/28721151
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/57298080
type: QuestionComment
has text: Why does this question have 5 downvotes but no votes to close? The downvotes don't seem helpful.
score: 0
comment on: http://stackoverflow.com/q/28641481
type: Comment

http://stackoverflow.com/q/28741960
tagged with: javascript
tagged with: kendo-ui
has title: I want to set muliplte values in my dropdownList in kendo UI, but in dataTextField attribute it is accepting only one value
type: AnsweredQuestion
type: Question
tagged with: kendo-dropdown
accepted answer: http://stackoverflow.com/a/28746816
has body: Here is my code Sample: &gt; $("#User").kendoDropDownList({ dataTextField: "UserName", dataValueField: "UserID", dataSource: users, optionLabel: "Select", }).data("kendoDropDownList").value(UserID); The dataSource attribute is set to the object 'users' which consists of associated values. Now with the 'UserName' display value, I want to append the value of 'Gender' as well which is coming from 'users' object, in my dropdownList display.
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28746816

http://stackoverflow.com/comment/45599887
type: AnswerComment
type: Comment
has text: @Agamemnus Eh, technicalities. I've added a note on this.
comment on: http://stackoverflow.com/a/28651001
score: 0

http://stackoverflow.com/comment/45657593
score: 0
type: Comment
has text: Ok I have got what is the issue here... I am sending the data to the php page when user clicks on submit button. So once the submit button is clicked the user sends the data to php page and stores it in the $_POST['total_price'] on insert_man_order.php . And than it bring backs the data which is being echo out on that page. Than the PHP performs it operation and sends the data again using POST method in FORM. So that page insert_man_order.php is refreshed and my POST variable is empty... So what is solution for it..???
type: QuestionComment
comment on: http://stackoverflow.com/q/28666758

http://stackoverflow.com/comment/45775933
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28746772
score: 0
has text: it creates a reusable component.

http://stackoverflow.com/q/28702986
has body: I have the following directive: angular.module('mymod').directive("hideOnScroll", function($animate, $document) { return function(scope, element, attrs) { $document.bind('scroll', function () { if ($document.scrollTop() > 80) { console.log("this is fired1") $animate.addClass(element, "fade"); } else { console.log("this is fired2") $animate.removeClass(element, "fade"); } }); }; }); I have both "this is fired" messages in the log at some point Plus, I have the following animation service: angular.module('mymod').animation(".fade", function() { console.log("this is never fired3") return { addClass: function(element, className) { console.log("this is never fired4") //TweenMax.to(element, 1, {opacity: 0}); }, removeClass: function(element, className) { console.log("this is never fired5") //TweenMax.to(element, 1, {opacity: 1}); } }; }); None of it's console messages is fired. at all (3, 4 and 5). I checked if it's added to the browser, it is. And I have ngAnimate as a dependency This is the element: Hello Edit: I can see in chrome's element inspector that the div doesn't get the new class after '$animate.addClass(element, "fade")' is fired What am I missing?
type: AnsweredQuestion
tagged with: javascript
has title: AngularJS: Hide element on scroll with $animate
tagged with: angularjs
type: Question
accepted answer: http://stackoverflow.com/a/28706988
tagged with: animation
score: 0
tagged with: directive
answer count: 1
has answer: http://stackoverflow.com/a/28706988

http://stackoverflow.com/a/28626033
upvote count: 1
answers question: http://stackoverflow.com/q/28625567
has body: Use the timeout argument of $http function MyCtrl($scope, $http){ $scope.logs='' // Will try to get targetUrl every 500ms, then call successCallback with the data function tryToGet(targetUrl,successCallback){ $scope.logs+='\n New attempt \n'; // Try a get with the timeout argument var attempt = $http.get(targetUrl,{timeout:500}) // On error, try again attempt.error(function(){ tryToGet(targetUrl,successCallback); }); // On success, exectute the callback attempt.success(successCallback); } function whenOk(data){ $scope.logs+=data } tryToGet('http://google.com', whenOk) } &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"&gt;&lt;/script&gt; &lt;div ng-app&gt; &lt;pre ng-controller="MyCtrl" ng-bind="logs"&gt; &lt;/div&gt;
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45553547
has comment: http://stackoverflow.com/comment/45556995

http://stackoverflow.com/a/28738981
score: 0
answers question: http://stackoverflow.com/q/28738916
type: Answer
has body: You don't need to find same element for which keyup is registered, just use this &lt;script type="text/javascript"&gt; jQuery(document).ready(function() { jQuery("#myform:idTextarea").keyup(function(){ var testValue = jQuery(this).val(); console.log(testValue); }); }); &lt;/script&gt;

http://stackoverflow.com/comment/45673513
comment on: http://stackoverflow.com/q/28690852
score: 0
type: Comment
type: QuestionComment
has text: forgot the id="day" how to solve this.I am struggling to solve this . I need answer in query or java script. How to solve this in problem. I have given my code.

http://stackoverflow.com/q/28713129
type: UnansweredQuestion
score: 3
tagged with: performance
has answer: http://stackoverflow.com/a/28713229
type: Question
tagged with: reactjs
answer count: 2
tagged with: javascript
upvote count: 3
has body: The ReactJS website states that, When the data changes, React conceptually hits the "refresh" button, and knows to only update the changed parts. What does this mean exactly? How is this achieved? How is this different from what AngularJS does?
has title: What does it mean exactly that "React updates DOM dynamically"?
favorite count: 0
downvote count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28713981

http://stackoverflow.com/comment/45648913
has text: You should probably explain what problem(s) your code solves, and how. Code, by itself, is rarely useful as a teaching aid (and answering questions does, however tenuously, constitute 'teaching').
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28677903

sorting
tags question: http://stackoverflow.com/q/28631752
tags question: http://stackoverflow.com/q/28612113
tags question: http://stackoverflow.com/q/28685128
tags question: http://stackoverflow.com/q/28711653
tags question: http://stackoverflow.com/q/28625506
tags question: http://stackoverflow.com/q/28620703
tags question: http://stackoverflow.com/q/28669877
tags question: http://stackoverflow.com/q/28677145
tags question: http://stackoverflow.com/q/28701630
type: Tag
tags question: http://stackoverflow.com/q/28706471
tags question: http://stackoverflow.com/q/28629055
tag name: sorting
tags question: http://stackoverflow.com/q/28680517
tags question: http://stackoverflow.com/q/28689023
tags question: http://stackoverflow.com/q/28599961
tags question: http://stackoverflow.com/q/28654349

http://stackoverflow.com/comment/45760718
type: AnswerComment
comment on: http://stackoverflow.com/a/28738150
type: Comment
has text: The answer in your linked question is perfectly valid if the user is authenticated and granted the `publish_actions` permission. You just need to authenticate the user beforehand. A full auth implementation example is linked in my answer (https://developers.facebook.com/docs/facebook-login/login-flow-for-web/v2.2)
score: 0

http://stackoverflow.com/a/28661141
score: 1
has body: You should avoid using data attribute in this way. Read more about .data() attribute HTML: John Maria Tony Script: $("#users").on("click", '.privateMessage', function () { if(!$(this).data('selected')){ $(this).data('selected', 'selected'); // do not use '.attr()', use natvie jQuery '.data()' var $msgTo = $(this).data('who'); $("#messageBox").append(" "+$msgTo+" "); } }); DEMO Alternatively, you could just use .one() event, and reactivate it later for specific button (f.ex. after the person was removed from the chat): function singleClick(el) { $(el).one("click", function () { var $msgTo = $(this).data('who'); $(" "+$msgTo+" ").appendTo("#messageBox"); }); } singleClick('.privateMessage'); DEMO (with delete example using .one())
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28660891
downvote count: 0

http://stackoverflow.com/comment/45767334
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28741941
has text: @cyberskunk "The aim is to prevent the form from submitting when enter is pressed" I don't know any other key that fire a submit of a form.

http://stackoverflow.com/comment/45666534
has text: @wdetac it's ugly - 2 loops is easier to deal with
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28670498
type: Comment

http://stackoverflow.com/q/28644730
has title: Why jQuery's each loop’s function saves a reference to an element object
has answer: http://stackoverflow.com/a/28644776
answer count: 2
has comment: http://stackoverflow.com/comment/45587615
downvote count: 0
accepted answer: http://stackoverflow.com/a/28644776
tagged with: jquery
has body: Recently I discovered that jQuery saves a variable in an each loop’s function, if it has been set with a jQuery object reference. For example below $elem value stays the same during the second and third iteration of each method, and it refers to the first div. $("div").each(function(index) { //below $elem is initialized with div reference during first iteration if (index === 0) $elem = $(this); var text = "index: " + index + ", $(this).html(): " + $(this).html() + ", elem.html(): " + $elem.html() + ""; $("#output").append(" " + text + " "); }); li span { color: blue; } li span:nth-child(2) { color: red; } li span:nth-child(4) { color: green; } 1 DIV 2 DIV 3 DIV jQuery each loop's output: I was kind of surprised that $elem doesn’t become null or undefined during the second iteration of each loop. Following that behavior the output has text: 1 DIV on each three lines. Does anyone have an idea why $elem refers to the first div during second and third iteration of each method? – Thanks
favorite count: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28644839
has comment: http://stackoverflow.com/comment/45587487
score: 1
has comment: http://stackoverflow.com/comment/45587492
upvote count: 1
possible better answer: http://stackoverflow.com/a/28644839
type: Question
tagged with: javascript

http://stackoverflow.com/q/28594987
has body: I'm still learning AngularJS and I'm trying to (for example) switch the names on a regular interval. I've got most of the basic idea down but I'm running into problems with how Angular handles how information is shared I've tried this: http://jsfiddle.net/nwz5krw4/1/ The core of the fiddle is this (where names is an array of names): this.changeName = function($scope,names) { this.nameIndex++; if ($scope.$parent.nameIndex &gt; (names.size - 1)) { $scope.$parent.nameIndex = names[0]; } else { $scope.$parent.myName = names[$scope.$parent.nameIndex]; } }; Oddly, that will load in the browser and give me the first name, then simply refuse to change Reading the console reveals that t. Another path I've taken based on How do I use $rootScope in Angular to store variables? is to create this: app.run(function($rootScope){ }); And place my array of names in there as $rootScope.names. Obviously $rootScope is to be avoided where possible, but right now I'm just going for functionality. However, this, too, did not work. Passing $scope to the method resulted in $scope.names or $rootScope.names being undefined. I'm not yet "thinking in Angular" and need some mental translation to make the leap.
answer count: 2
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28595255
possible better answer: http://stackoverflow.com/a/28595232
has answer: http://stackoverflow.com/a/28595232
type: AnsweredQuestion
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28595255
has title: Accessing scope variable in function in AngularJS
linked to: http://stackoverflow.com/q/18880737
score: 0

http://stackoverflow.com/q/28618766
has body: I was searching for how in a Chrome App to use javascript to simply get the current text from the clipboard. Although I did a fair bit of searching I was not able to find a solution that was current, complete and adaptable to various scenarios. So, I thought I'd ask and answer the question here for the hopeful benefit of others. Here are some related questions (most to least related): Storing clipboard data into a variable with JavaScript and the Google Chrome API the proper use of execcommand("paste") in a chrome extension Can't get execCommand('paste') to work in Chrome
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/6969403
has title: Get current text from clipboard in chrome app
has answer: http://stackoverflow.com/a/28618811
upvote count: 1
answer count: 1
favorite count: 0
linked to: http://stackoverflow.com/q/7144702
tagged with: google-chrome-app
tagged with: clipboard
type: UnansweredQuestion
downvote count: 0
score: 1
linked to: http://stackoverflow.com/q/22702446
linked to: http://stackoverflow.com/q/27908309

http://stackoverflow.com/a/28628987
has body: Following snippet works for me: var value = 0.0038575; var discount = value.toFixed(3); console.log(discount); If your value is of type string you can try to cast it to a number with the + operator: var discount = (+value).toFixed(3); But without any reproducible code snippet I can only guess an answer.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28628633

http://stackoverflow.com/q/28617513
has body: Does JavaScript have a language construct or something similar to the php list command? http://php.net/manual/en/function.list.php This command will assign the values of an array to variables in a single statement. For example, given the array: $info = array('Coffee', 'brown', 'caffeine'); The list command will assign each of the array element values to named variables: list($drink, $color, $power) = $info; such that: echo "$drink is $color and $power makes it special."; // results in: Coffee is brown and caffeine makes it special. So this is an easy way to assign values to many variables in one statement. Does JavaScript have something equivalent where each variable does not have to be assigned separately? Is there a way to do this using either an object's properties or an array's elements? If not, can a function be written that would do it? If the only way to do this is via a function, then the function would need access to the scope where the variables are defined. I tried the solutions in this five year old question: Javascript equivalent of PHP&#39;s list(), but they don't work. The Array prototype change fails to assign the variables in my node.js environment and the left handed array assignment is a reference error in Chrome. There is talk about an experimental new technique, but the talk is several years old. I'd like to know if there is a solution to this better than those listed in the linked question.
has comment: http://stackoverflow.com/comment/45541644
linked to: http://stackoverflow.com/q/1954426
has comment: http://stackoverflow.com/comment/45538286
tagged with: symbol-table
has answer: http://stackoverflow.com/a/28621019
has comment: http://stackoverflow.com/comment/45538484
tagged with: javascript
possible better answer: http://stackoverflow.com/a/36019256
has answer: http://stackoverflow.com/a/37202481
has title: Does JavaScript have a language construct similar to the php list command?
answer count: 4
tagged with: node.js
has comment: http://stackoverflow.com/comment/45538212
has comment: http://stackoverflow.com/comment/45541759
accepted answer: http://stackoverflow.com/a/28621019
has comment: http://stackoverflow.com/comment/45538391
tagged with: php
has comment: http://stackoverflow.com/comment/45538123
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/17379277
has answer: http://stackoverflow.com/a/28619735
has comment: http://stackoverflow.com/comment/45541837
has comment: http://stackoverflow.com/comment/45541730
type: Question
has answer: http://stackoverflow.com/a/36019256
tagged with: language-construct
score: 0

http://stackoverflow.com/a/28671849
type: Answer
answers question: http://stackoverflow.com/q/28671536
has body: You can check it by your self just by writing debugger in your javascript code and then open it in browser with inspect element console screen and then refresh it and then debug your javascript code there in browser. you can simply check which functions gets call and which is not. you can also check value for all elements there. so, by that you might able to check that if function returns the value for born or not?
has comment: http://stackoverflow.com/comment/45637320
score: 0

http://stackoverflow.com/a/28679734
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45652751
has body: One possible workaround is to temporarily fix the input while mouse is over it: $("input[type=number]").on("mousewheel",function(e){ e.stopPropagation(); }).on("mouseenter", function() { $(this).css("position", "fixed"); }).on("mouseleave", function() { $(this).css("position", ""); }); div{ height:50px; overflow:auto; border: 1px solid black; }
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/28679271
downvote count: 0
answers question: http://stackoverflow.com/q/28679271
has comment: http://stackoverflow.com/comment/45652596
upvote count: 2

http://stackoverflow.com/q/28639645
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has title: How to add additional GET parameters in a mixed Form/HREF link that uses a modal box?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45578926
has body: I have an issue that is a little tricky. First, for folks who will run my snippet first -- when you run my example and click Generate, you will first see a modal box, which (on my backend) first reads the $_GET data. My submit mechanism uses A HREF method, to which I want to add more data via form, or otherwise, to be read by the receiving page. In HTML source below, observe: I have a link to portal.php, which includes query parameters clicking that link engages the modal_box mechanism my link is a button I need to have a way to add data (GET, or POST), that will submit upon the click of that button, and be received by the resulting page (portal.php in my example). I want, for example, to be able to print on my receiving page that the following are true: $_GET['p'] == 'select'; $_GET['coverpage'] == 'standard'; How? Snippet Follows: T standard more Generate
has comment: http://stackoverflow.com/comment/45578665
type: Question
has answer: http://stackoverflow.com/a/28639891
accepted answer: http://stackoverflow.com/a/28639891
tagged with: javascript
has comment: http://stackoverflow.com/comment/45578620
has comment: http://stackoverflow.com/comment/45578781
score: 0
has comment: http://stackoverflow.com/comment/45578836
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/45578803

http://stackoverflow.com/comment/45723310
type: Comment
has text: could you provide a jsfiddle with your example?
comment on: http://stackoverflow.com/a/28717401
type: AnswerComment
score: 0

http://stackoverflow.com/q/28717773
tagged with: javascript
upvote count: 3
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
has title: Select2 callback function when
tagged with: jquery-select2
type: UnansweredQuestion
downvote count: 0
duplicate of: http://stackoverflow.com/q/18615108
has answer: http://stackoverflow.com/a/28717815
linked to: http://stackoverflow.com/q/18615108
type: Question
has body: We are using Select2 for a tags input. We need to trigger autosave whenever a tag is selected. Is there a callback in Select2 for when a new or existing tag is selected? $(".tagstypeahead").select2({ tags: true, tokenSeparators: [','], createSearchChoice: function (term) { return { id: $.trim(term), text: $.trim(term) // + ' (new tag)' - Adds new tag to the end here }; }, ajax: { url: '/tags/typeahead.json', dataType: 'json', data: function(term, page) { return { q: term }; }, results: function(data, page) { return { results: data }; } }, // Take default tags from the input value initSelection: function (element, callback) { var data = []; function splitVal(string, separator) { var val, i, l; if (string === null || string.length &lt; 1) return []; val = string.split(separator); for (i = 0, l = val.length; i &lt; l; i = i + 1) val[i] = $.trim(val[i]); return val; } $(splitVal(element.val(), ",")).each(function () { data.push({ id: this, text: this }); }); callback(data); } });
score: 3

http://stackoverflow.com/a/28707290
score: 1
has comment: http://stackoverflow.com/comment/45775465
upvote count: 1
has comment: http://stackoverflow.com/comment/45744972
has comment: http://stackoverflow.com/comment/45747044
has comment: http://stackoverflow.com/comment/45745120
answers question: http://stackoverflow.com/q/28707217
has comment: http://stackoverflow.com/comment/45747436
downvote count: 0
has comment: http://stackoverflow.com/comment/45708456
has body: What you're inserting is a string. If you're inserting it into a DATE field, you'll need to convert it to a date. The syntax for this will vary depending on what database you're using. MySQL uses STR_TO_DATE for this, while Oracle uses TO_DATE. I can help you out with structuring your query if I know what type of database you're using. Edit: here's your code. You'll need to leverage the MySQL STR_TO_DATE function inside the query itself. $request = mysql_query("INSERT INTO messages (fromdate, todate) VALUES (STR_TO_DATE(\''.$fromdate.'\',\'%Y-%m-%d\'), STR_TO_DATE(\''.$todate.'\',\'%Y-%m-%d\')") or die(mysql_error()); Also, it's not really good practice to handle mysql errors with die() when you go to production. It could give a malicious user information you don't want them to have.
has comment: http://stackoverflow.com/comment/45703995
has comment: http://stackoverflow.com/comment/45704642
type: Answer

http://stackoverflow.com/comment/45723428
type: QuestionComment
has text: give the span an id or class then specify give it its properties in css
comment on: http://stackoverflow.com/q/28718166
score: 0
type: Comment

http://stackoverflow.com/a/28748078
has body: EDIT - This answer only applies if your radio button is on the same page If the elements you want data from are on the same page as the label then you shouldn't really be using ViewData.. that is more for passing something from the controller to the view jQuery is your best option here I think $('input:radio[name=nameofradiobutton]').on('change', function() { var selection = $(this).val(); if(selection == something) { $("label[for='CurrentManager_TextBox']").text("some text"); } });
score: 0
answers question: http://stackoverflow.com/q/28746490
type: Answer

http://stackoverflow.com/q/28627594
has title: How to ensure proper closing of backbone views
type: AnsweredQuestion
score: 2
has body: I have a close function attached to all of my views, Backbone.View.prototype.close = function() { this.remove(); this.unbind(); if (this.closeMe) this.closeMe(); }; And in closeMe() function inside views I call off() function of backbone to remove previously-bound callback function from models and collections. closeMe: function() { if(this.model) this.model.off(null, null, this); ... } Question is, If I have some variables attached to current view in initialize function, Do I need to handle them via closeMe() function? initialize : function(options) { ... this.myVar= options.something; }
type: Question
accepted answer: http://stackoverflow.com/a/28865178
downvote count: 0
tagged with: javascript
answer count: 1
favorite count: 0
tagged with: backbone.js
tagged with: memory-management
has answer: http://stackoverflow.com/a/28865178
upvote count: 2

http://stackoverflow.com/q/28616478
tagged with: javascript
has body: I want to show a modal loading gif while something is storing in a database. I can figure out a way: Then i can $('#loading').removeClass('hidden'); when saving starts and $('#loading').addClass('hidden'); when saving ends. Is this the best (easiest, best performance, most elegant) way of doing this? Regards,
has answer: http://stackoverflow.com/a/28616914
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28616523
type: UnansweredQuestion
tagged with: loading
score: 0
type: Question
has title: Javascript Easiest/Most Elegant way of using a loading gif
has comment: http://stackoverflow.com/comment/45536114

http://stackoverflow.com/q/28615575
tagged with: http://stackoverflow.com/tag/html
tagged with: pageload
tagged with: css
has comment: http://stackoverflow.com/comment/45534196
has comment: http://stackoverflow.com/comment/45534252
has title: Javascript Slide-In Onload
type: Question
tagged with: function
has answer: http://stackoverflow.com/a/28615662
tagged with: javascript
has comment: http://stackoverflow.com/comment/45534234
score: 0
answer count: 2
has body: So I'm trying to have a div slide in on pageload. It has an id of "#crazyslide" and is absolutely positioned to the right -800px in the css. So I used this code in the head: &lt;script type="text/javascript"&gt; $(document).ready(function() { $("#crazyslide").animate( { right: '0px' }, 2000 ); }); &lt;/script&gt; Shouldn't this work?
has comment: http://stackoverflow.com/comment/45534187
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28615648

http://stackoverflow.com/comment/45536342
has text: whole html code, and i see image in the response tab of firebug and html in html tab
comment on: http://stackoverflow.com/q/28616534
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28617633
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45538499
type: Question
has title: How to display json file without calling it directly?
has comment: http://stackoverflow.com/comment/45538387
tagged with: javascript
has body: I've been poking around a great website - http://beta.rallyinteractive.com/ trying to learn something new. Website uses a lot of Ajax in it, and also some interesting javascript - without any additional libraries. In this single javascript file a found a reference to ajax json get request. You can even easily access the the json file on this url http://beta.rallyinteractive.com/surrounding/studio/ , however I do not understand, why is this data being shown, without the "proper" path to the file. And by proper I meant "somedomain.com/surrounding/studio/data.json" Any ideas?
score: 0
has comment: http://stackoverflow.com/comment/45538431
has answer: http://stackoverflow.com/a/28617707
answer count: 1
favorite count: 0
tagged with: ajax

http://stackoverflow.com/q/28609923
tagged with: lungojs
score: 0
answer count: 1
type: UnansweredQuestion
has title: LungoJS error on .init()
has body: My code: My Project Your content Error (Chrome): http://prntscr.com/674lv0 Error (Firefox): http://prntscr.com/674pvr Result: Screen all black What am I doing wrong? I took this example here https://github.com/tapquo/Lungo.js/blob/master/README.md Already tested in other browsers but all give errors.
tagged with: javascript
has answer: http://stackoverflow.com/a/28894028
type: Question
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28692909
has answer: http://stackoverflow.com/a/28694027
tagged with: keydown
upvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/28694027
tagged with: javascript
tagged with: keylistener
has answer: http://stackoverflow.com/a/28693517
tagged with: keypress
answer count: 3
has answer: http://stackoverflow.com/a/28693041
downvote count: 0
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28693517
has body: I'm currently building a site which makes use of a custom quick navigation via JavaScript. If the user presses the Right Key, he'll be navigated to the next page in my page list, and by pressing ALT + Right or Left Key, he can navigate forward and backward through his browser history. This is my current code: var map = []; window.onkeydown = window.onkeyup = function(e){ e = e || event; // to deal with IE map[e.keyCode] = e.type == 'keydown'; if (map[18] &amp;&amp; map[39]) { // ALT + Right window.history.forward(); } else if (map[18] &amp;&amp; map[37]) { // ALT + Left window.history.back(); } else if (map[39]) { // Right Key window.location.href = "{{ path('sctn_findsong') }}"; } if (map[38]){ // Up Key // } if (map[40]){ // Down Key // } } It all works fine, except for one little issue: Let's say I want to go three pages back - if I'm a logically thinking human being, I'll first press ALT + Left to go back one site, then when I'm on the previous site just keep ALT pressed and press Left again to get back one more site. However, when I go back one site and keep ALT pressed, it doesn't register that ALT is still pressed, so I have to press ALT again each time I reach a previous site, which is pretty annoying. How do I get it to work the way I want it to? Help appreciated.
has title: Check if key is already pressed when loading new page (JavaScript)
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/45772238
type: Comment
has text: Not sure how _jQuery_ does it, but `this` in an _XMLHttpRequest's_ callback usually points to the request, not the Object which created the request
comment on: http://stackoverflow.com/q/28744835
score: 0
type: QuestionComment

http://stackoverflow.com/q/28659638
score: 0
has comment: http://stackoverflow.com/comment/45614901
has comment: http://stackoverflow.com/comment/45614819
tagged with: jquery
tagged with: ajax
has body: I have encountered another jQuery problem with my page to display a table of dates and prices. The relevant part of the page is &lt;table align="center" width="100%" style="margin-top:6px"&gt; &lt;tr&gt; &lt;td width="178"&gt; &lt;form name="StartDateCal" id="StartDateCal"&gt; &lt;input type="hidden" name="hid" id="hid" value="&lt;?php echo $hid ?&gt;"&gt; From &amp;nbsp;&amp;nbsp;&lt;input type="text" id="pricePicker" size="15" value="&lt;?php echo date("D, j M Y",strtotime($startdate)) ?&gt;"&gt; &lt;input type="hidden" name="StartDate" id="StartDate"&gt; &lt;input type="hidden" name="defaultdate" id="defaultdate" value="&lt;?php echo $startdate ?&gt;"&gt; &lt;input type="text" name="currency" id="currency"&gt; /*Change to "hidden" after debugging*/ &lt;/form&gt; &lt;/td&gt; &lt;td class="prev"&gt; &lt;a href="#" id="previous"&gt;&lt;&lt; Previous&lt;/a&gt; &lt;/td&gt; &lt;td style="padding:0 0 5px 0"&gt;&lt;/td&gt; &lt;td class="prev" style="text-align:right"&gt; &lt;a href="#" id="next"&gt;Next &gt;&gt;&lt;/a&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;div id="pricePickerResult"&gt;&lt;br&gt;&lt;img src="../images/ajax_loader_blue_64.gif" width="64" height="64" alt="Loading ..."&gt;&lt;br&gt;&lt;br&gt;&lt;/div&gt; &lt;div style="float:right; line-height:18px"&gt;Change currency: &lt;a href="#" id="euro"&gt;&lt;img src="/images/price.png"&gt;&lt;/a&gt; &lt;a href="#" id="pound"&gt;&lt;img src="/images/price_gbp.png"&gt;&lt;/a&gt; &lt;a href="#" id="dollar"&gt;&lt;img src="/images/price_usd.png"&gt;&lt;/a&gt;&lt;/div&gt; At the end of the body is this javascript (along with links to some other external javascripts). // Determines the currency according to language and timezone of browser. var langCode = navigator.language || navigator.systemLanguage; var lang = langCode.toLowerCase(); lang = lang.substr(0,2); var dateObject = new Date(); var timeOffset = - dateObject.getTimezoneOffset() / 60; if (lang == 'en') { if (timeOffset == 0) { curr = "GBP"; }else if ((t…
has title: Getting jQuery and Ajax to Update a Variable
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45615373
tagged with: javascript
type: Question

http://stackoverflow.com/q/28606119
has body: So I have no problem actually setting checkboxes as checked, however in my current case I need to actually add the "checked" property to the checkboxes, as the system I'm working in literally grabs the HTML from the DOM. I can set the checkbox to be checked, however as there's no identifying "checked" property when the HTML gets inserted again it doesn't hold the property so all checkboxes come back unchecked :( is there a way to add and remove 'checked' as a property so it will be apparent from the raw HTML what boxes are checked? e.g. unchecked box &lt;input type="checkbox" value="yes" /&gt; checked box &lt;input type="checkbox" checked value="yes" /&gt; Appreciate any help!!
upvote count: 3
has comment: http://stackoverflow.com/comment/45516545
has comment: http://stackoverflow.com/comment/45516583
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28606235
has answer: http://stackoverflow.com/a/28611128
favorite count: 0
has comment: http://stackoverflow.com/comment/45516582
has title: Add "checked' property to checkbox in jquery
has answer: http://stackoverflow.com/a/28606356
answer count: 5
has answer: http://stackoverflow.com/a/28606235
has answer: http://stackoverflow.com/a/28606956
tagged with: checkbox
has comment: http://stackoverflow.com/comment/45516616
type: AnsweredQuestion
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/45516778
type: Question
has comment: http://stackoverflow.com/comment/45516642
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45516530
accepted answer: http://stackoverflow.com/a/28611128
has answer: http://stackoverflow.com/a/28607772

http://stackoverflow.com/q/28691071
has answer: http://stackoverflow.com/a/28691105
tagged with: input
score: 0
answer count: 3
has title: i want value of input type in javascript
accepted answer: http://stackoverflow.com/a/28691105
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28691181
has body: my code is &lt;ul id="start"&gt; &lt;li&gt; &lt;input type="hidden" value="abc" &gt; &lt;/li&gt; &lt;/ul&gt; I don't id of Ii and Input Type I want value of input type in javascript in css we use #start li input{ //code } how to do same thing in javascript
tagged with: class
has answer: http://stackoverflow.com/a/28691216
has answer: http://stackoverflow.com/a/28691181
type: AnsweredQuestion
tagged with: html-lists
type: Question

http://stackoverflow.com/q/28670614
tagged with: tree
type: Question
tagged with: javascript
score: 0
answer count: 2
tagged with: visualization
has body: I am presently working on this example http://bl.ocks.org/mbostock/4339184 and am seeking advice on how to convert this tree into a double sided tree. The reason behind me using this tree structure is my texts/labels are very long and want to fit them in one single page. I also tried the option of radial tree but the long labels create overlaps with other labels. I tried to wrap some text according to a parameter called size but wasn't successful. My code for radial tree is available in this link http://jsfiddle.net/hv6wc7x5/ The actual labels which I want to use are very long as shown in the link. I cannot discuss the labels as this is a part of research work and cannot be shown publicly. Basically I wan't to ask two questions in this post. First, is there a way to transform the normal Reingold–Tilford tree into a double sided tree. And the second question is if there is a way to wrap the text for selected texts according to the size attribute given in the JSON. The code I want to change is given below but it doesn't work, if any one can help me in fixing this it would be great. In the last line of the code segment, I want to call the wrap function(an internal method in my code) based on the check that my attribute size equals to some value but I am unable to do it. Can anyone let me know how can I improve the last line? node.append("text") .attr("dx", function(d) { return d.x &lt; 180 ? 10 : -10; }) .attr("dy", ".31em") .attr("text-anchor", function(d) { return d.x &lt; 180 ? "start" : "end"; }) .attr("transform", function(d) { return d.x &lt; 180 ? null : "rotate(180)"; }) .text(function(d) { return d.name; }) .attr("wraper", function(d) { return d.size == "3534" ? node.call(wrap,0) : node.call(wrap,0); }); It would be great if anyone of the above questions are answered although I would love that my first question is answered.
has answer: http://stackoverflow.com/a/28678496
has answer: http://stackoverflow.com/a/32113741
tagged with: d3.js
type: UnansweredQuestion
tagged with: data-visualization
has title: How to turn Reingold–Tilford Tree into double sided tree in D3

http://stackoverflow.com/comment/45667864
score: 0
has text: @Claies I did read it, it does exactly the same thing as Defer, somehow, I'd like to call it a `sugar method`. Let's take a deep look at Q, Q.promise also returns methods: `resolve` and `reject` https://github.com/kriskowal/q/blob/v1/q.js#L634-L652 But it's slightly different from ES6 Promise, where it `resolve` performs strange. I'm struggling understanding the design purpose for this
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28687566

http://stackoverflow.com/comment/45564708
type: QuestionComment
comment on: http://stackoverflow.com/q/28632247
has text: can you add a rejection and see if that fires and why?
score: 0
type: Comment

http://stackoverflow.com/comment/45771483
type: QuestionComment
comment on: http://stackoverflow.com/q/28731417
score: 0
has text: @ Chris Pickford I tried change css and nothing happens because it is the javascript setting the distance.
type: Comment

http://stackoverflow.com/a/28739416
type: AcceptedAnswer
downvote count: 0
has body: One way could be a ray casting algorithm. The theory is to draw a virtual horizontally ray from outside the polygon to your point of interest and count how often it crosses any side of the polygon. If the number is even, your point is outside if it's odd it's inside the polygon. Look here http://alienryderflex.com/polygon/ for more information and C code sample.
type: Answer
answers question: http://stackoverflow.com/q/28738700
accepted answer of: http://stackoverflow.com/q/28738700
upvote count: 5
score: 5

http://stackoverflow.com/comment/45751969
type: Comment
score: 0
has text: chrome. I've added more above
comment on: http://stackoverflow.com/q/28733123
type: QuestionComment

http://stackoverflow.com/q/28631932
answer count: 8
has answer: http://stackoverflow.com/a/66851861
downvote count: 0
has answer: http://stackoverflow.com/a/33655087
tagged with: javascript
has body: I'm expanding an existing website. I have the site published (if you want to take a look click here). I have just added a very simple blog (made with php and mysql) and it works well, except for one thing. If I add an image to a new or post, the person that is writing the post is able resize it. The problem is that the image has static width and height, and then if I access the blog on a mobile device, the image is cut because it's bigger than the width of the device. I don't know how to solve it, I thaunght I could modify the plugin that allows to insert images to add this parameters (which makes an image responsive): max-width="['user selected width'], width=100%, height=auto I've been trying to modify the plugin but i find it very hard to understand, and i'm not very experienced on javascript. Here's the plugin. I'm using tinymce editor to edit or add posts. Anyone knows were I have to add this parameters? Thank you.
has answer: http://stackoverflow.com/a/70709031
favorite count: 0
tagged with: tinymce
has answer: http://stackoverflow.com/a/43938154
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Responsive image tinymce image link
has answer: http://stackoverflow.com/a/67560307
score: 3
upvote count: 3
has answer: http://stackoverflow.com/a/78430048
has answer: http://stackoverflow.com/a/28679319
has answer: http://stackoverflow.com/a/29349433
type: Question

http://stackoverflow.com/a/35928801
downvote count: 1
answers question: http://stackoverflow.com/q/28647492
has comment: http://stackoverflow.com/comment/65032279
type: Answer
score: 2
upvote count: 3
has body: You wanted to say: "colours" $scope.colours = ['#FD1F5E','#1EF9A1','#7FFD1F','#68F000']; Also we can see the other attributes That we can change , like : legend , series, hover . Next to each chart you can see an option called "settings ", that's all what you can change.

http://stackoverflow.com/comment/45516215
type: QuestionComment
has text: `var extractedUrl = originalUrl.replace( /&ReturnUrl=([^&#]+)(&#|$)/, "$1" )` would be the method by the book. However, that assumes that all occurrences of `&,#` in the ReturnUrl parameter are properly percent-encoded ( `%26`, `%23` ), but they typically aren't. Do you have more information about the structure of ReturnUrl and the embedding url?
comment on: http://stackoverflow.com/q/28605832
score: 1
type: Comment

http://stackoverflow.com/comment/45739504
type: Comment
type: QuestionComment
has text: you can't check it only in javascript and html. something server side mechanism needed to check whether login session exist or not to determine whether redirect to login page on pressing back button. other way to handle just using client side by using web api like indexedDb or local storage or cookie to determine whether on press of back button where to redirect.
score: 0
comment on: http://stackoverflow.com/q/28725622

http://stackoverflow.com/q/28724904
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/28802164
tagged with: angularjs
upvote count: 2
tagged with: sockets
tagged with: node.js
type: AnsweredQuestion
score: 2
type: Question
tagged with: sails.js
has answer: http://stackoverflow.com/a/28802164
downvote count: 0
tagged with: javascript
has body: Have a problem with Sails.js and sockets. For the most part they work great. I am able to subscribe to sockets on the client side (Sails Socket client and AngularJS) and receive messages from the server when updating records using Blueprint. However when I try and go for a more custom approach I cannot get the socket events to trigger. I am able to segregate clients by subscribing them as follows... // Listen for game model event io.socket.on('game', function(e) { console.log('Game Socket Event'); }); // Subscribe to model record io.socket.get('/game/' + gameId); Again, this works fine for the subscription, however for some more complex tasks I have to target a controller action. These generally involve numerous record look-ups, perhaps a call to a service, and finally writing a record (or more). At the end of the chain when everything is resolved I want to emit a socket message to only specific clients. I figured I might be able to use something like... Game.findOne({ id: data.gameId }).exec(function(err, gameData) { // Subscribe to the record Game.subscribe(req.socket, gameData, ['create', 'update', 'destroy']); // Various calls and updates to game model and others Game.publishUpdate(gameData.id); } The game ID in the publishUpdate() call is the same as in the subscription, the endpoint of the controller action is "/game/deal", so I guess my question is do I need to subscribe a second time to this URL with a socket call? I am altering the game record so I would have thought it would trigger a socket event anyway, but it does not. Any pointers would be most welcome. I was using v0.10.5, but upgraded to v0.11 and I have the same issue... so I guess it's me somewhere. I should also add that right now autoWatch is set to on as is the Blueprint mirror option. However I would prefer to get rid of autoWatch and only pick and choose which events should actually emit. Thanks.
has title: How can I trigger custom socket events in Sails.js v0.11?

http://stackoverflow.com/q/28630240
answer count: 0
has comment: http://stackoverflow.com/comment/45566652
type: Question
tagged with: javascript
score: 0
has title: AngularJS: Validation using directive (In some flavor), ngBlur or other?
tagged with: validation
has body: In my form there is an unique input named email, and I want to tell if it is available in the moment of the focus is lost. Here is the options I have studied so far: 1) Make a directive, and use element.bind('blur', function(event) in the link function, in that case I would inject the server to connect to the api and validate the email; 2) Make a directive, and use the ng-model-options="{ updateOn: 'blur' }" in the email form, in the directive would be injected the service to validate the email as in the case 1; 3) In the form use the directive ngBlur, there I would use a function in the controller to make the validation. Of these options what is the most standard and correct (or the angular way) to do it and why? Thanks in advance for the help.
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45561208
has comment: http://stackoverflow.com/comment/45561973

http://stackoverflow.com/comment/51023767
score: 2
type: AnswerComment
comment on: http://stackoverflow.com/a/31517695
type: Comment
has text: Whatever was being done in `envify-loader` was just a wrapper. Discussion [here](https://github.com/mjohnston/envify-loader/issues/1).

http://stackoverflow.com/q/28744805
has comment: http://stackoverflow.com/comment/45775360
answer count: 1
tagged with: javascript
tagged with: express
has comment: http://stackoverflow.com/comment/45777908
has answer: http://stackoverflow.com/a/28748322
score: 0
has body: I can't seem to understand why my custom route handler doesn't pickup the value set within a custom middleware. Here's what I'm working with: // my route router.post('/login', bodyParser.text({type: 'urlencoded'}), function(req, res, next) { if (!req.body) return res.sendStatus(400); console.log('access token is: ' + req.access_token); // This returns undefined var options = httpconn.httpOptions({ resource: 'uaa', resourcePath: '/uaa/authenticate', method: 'POST', headers: {'Content-Type': ' application/x-www-form-urlencoded', 'Authorization': 'Bearer ' + req.access_token} // @todo get from the middleware that sets it }); var httpRequest = application.httprequest(options, function(response) { response.on('data', function(chunk) { res.send(chunk); }); }); httpRequest.on('error', function(e) { res.status(500); res.send({'error': 'Authentication Failed: ' + e.message}); return; }); httpRequest.write(req.body); httpRequest.end(); }); // custom middleware router.use(function(req, res, next) { redisSessionStore.getAsync('active_session').then(function(data) { req.access_token = data.access_token; console.log('retrieved access_token: ' + req.access_token); }); next() }); If I remove bodyParser.text({type: 'urlencoded'}) from the route, I get a Bad request error. The custom middleware doesn't seem to run as seen in req.access_token returning undefined. Any pointers please?
has comment: http://stackoverflow.com/comment/45776288
tagged with: node.js
type: UnansweredQuestion
has title: Allow middleware and Route handlers to run together
has comment: http://stackoverflow.com/comment/45774134
has comment: http://stackoverflow.com/comment/45774431
has comment: http://stackoverflow.com/comment/45778172
type: Question

http://stackoverflow.com/a/28635599
type: Answer
has body: Your code references the id (jquery '#') instead of the class (jquery '.') AND it looks like the git info has some issues. The following works (notice the 'anyslider.goTo()' - not 'slider.goTo()') var slider = $('.slider').anyslider(); var anyslider = slider.data('anyslider'); anyslider.goTo(2); OR Slide 2
score: 0
answers question: http://stackoverflow.com/q/28632993

http://stackoverflow.com/q/28625615
score: 0
has body: When I check inputFieldDomNode.selectionStart it always returns some number, even if it does not have a text selection and there's no caret in it. So how can I tell if it doesn't have a text selection?
has answer: http://stackoverflow.com/a/28625830
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28639586
has answer: http://stackoverflow.com/a/28638322
answer count: 4
tagged with: dom-node
type: Question
has title: How can I tell if a text input field dom node does *not* have a selection with javascript?
tagged with: javascript
has answer: http://stackoverflow.com/a/28626036

http://stackoverflow.com/a/28608886
type: Answer
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/28608659
answers question: http://stackoverflow.com/q/28608659
has body: Try this: ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", " ", false);

http://stackoverflow.com/comment/45762754
type: QuestionComment
comment on: http://stackoverflow.com/q/28739198
has text: The object is filled out like i want it! but i can't seem to translate it into the li's that hold the data-category of the array names
score: 0
type: Comment

http://stackoverflow.com/q/28720310
tagged with: jquery
tagged with: ajax
has title: Ajax content load without refresh function
score: 0
has comment: http://stackoverflow.com/comment/45734158
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/28720444
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45727719
has body: New coder here looking for some help with getting ajax to load content into a div (content_area) without reload. So far only testing with the first two links home & about. my js file: $(document).ready(function() { //initial $('#content_area').load('content/home.php'); //handle menu clicks $('.sf-menu li a').click(function(){ var page = $(this).attr('href'); $('#content_area').load('content/' + page + '.php'); return false; }); }); My menu is: Home About Us By the way live test site is [link] http://www.newconstructionflorida.net [link] The initial content load works, but cant get the menu nav click to work.
has comment: http://stackoverflow.com/comment/45729718
type: Question
has comment: http://stackoverflow.com/comment/45727465
tagged with: javascript

http://stackoverflow.com/comment/45650255
type: Comment
has text: Bertrand, if i try to use Redis like you answered (i copy and paste), the passport.js and the express-session will stop and throw an error: Error: req.flash() requires sessions
score: 0
comment on: http://stackoverflow.com/a/28675986
type: AnswerComment

http://stackoverflow.com/q/28640246
has comment: http://stackoverflow.com/comment/45580002
has comment: http://stackoverflow.com/comment/45580096
has comment: http://stackoverflow.com/comment/45579656
type: Question
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/45580342
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/45580687
has comment: http://stackoverflow.com/comment/45580454
has comment: http://stackoverflow.com/comment/45579878
has body: I have this ajax call here in a script tag at the bottom of my page. Everything works fine! I can set a breakpoint inside the 'updatestatus' action method in my controller. My server gets posted too and the method gets called great! But when I put the javascript inside a js file the ajax call doesn't hit my server. All other code inside runs though, just not the ajax post call to the studentcontroller updatestatus method. &lt;script&gt; $(document).ready(function () { console.log("ready!"); alert("entered student profile page"); }); var statusdropdown = document.getElementById("enumstatus"); statusdropdown.addEventListener("change", function (event) { var id = "@Model.StudentId"; var url = '@Url.Action("UpdateStatus", "Student")'; var status = $(this).val(); $.post(url, { ID: id, Status: status }, function (data) { // do something with the returned value e.g. display a message? // for example - if(data) { // OK } else { // Oops } }); var e = document.getElementById("enumstatus"); if (e.selectedIndex == 0) { document.getElementById("statusbubble").style.backgroundColor = "#3fb34f"; } else { document.getElementById("statusbubble").style.backgroundColor = "#b23f42"; } }, false); &lt;/script&gt; Now I put this at the bottom of my page now. @section Scripts { @Scripts.Render("~/bundles/studentprofile") } and inside my bundle.config file it looks like this bundles.Add(new ScriptBundle("~/bundles/studentprofile").Include( "~/Scripts/submitstatus.js")); and submitstatus.js looks like this. I know it enters and runs this code because it I see the alert message and the background color changes. So the code is running. Its just not posting back to my server. $(document).ready(function () { console.log("ready!"); alert("submit status entered"); var statusdropdown = document.getElementById('enumstatus'); statusdropdown.addEventListener("change", function (event) { var id = "@Model.StudentId"; var url = '@Url.Action("UpdateStatus", "Student")'; var status = $(this).val(); $.post(…
linked to: http://stackoverflow.com/q/7902213
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28640965
has comment: http://stackoverflow.com/comment/45580549
accepted answer: http://stackoverflow.com/a/28640965
has comment: http://stackoverflow.com/comment/45580190
has title: asynchronous HTTP (ajax) request works in script tag but not in js file

http://stackoverflow.com/comment/47214649
has text: My bad, I misread the question. My preferred style is your example #3 by a long shot.
type: Comment
comment on: http://stackoverflow.com/a/28730840
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45776160
type: Comment
has text: which datepicker plugin are you using?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28744648

http://stackoverflow.com/comment/45704653
comment on: http://stackoverflow.com/a/28706187
has text: Thanks, perfect! Don't forget to add : add_action( 'wp_enqueue_scripts', 'theme_name_scripts' );
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/30084815
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28594295
score: 1
type: Answer
upvote count: 1
has body: Observer patterns notify subscribed objects by looping through and invoking listeners on each subscriber when a relevant change occurs. Because of that, you'd probably end up using $.each anyways. I think what you have is equally efficient. If you feel bad about iterating over the dom each time, consider this: there exists no such algorithm that can update each dom element without iterating through them. Caching the DOM array theoretically would improve performance, but my money says the browser's already doing that. Try it yourself on this jsperf...
answers question: http://stackoverflow.com/q/28594295

http://stackoverflow.com/q/28630432
has answer: http://stackoverflow.com/a/30082001
linked to: http://stackoverflow.com/q/24352975
score: 17
upvote count: 17
type: Question
tagged with: heroku
tagged with: javascript
has title: Missing scope error on Google authentication callback using Node.js/Passport
answer count: 2
downvote count: 0
has body: This error occurs on Heroku (production) only, not on local. I have tried both: passport.authenticate('google', { scope: 'https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/analytics.readonly' }) And, passport.authenticate('google', { scope: ['profile', 'email'] }) Whether the scope is an array, or a space-delimited string. When I go to the Google authentication link, scope IS in the URL. There is no difference in the one generated in my live production app. But I still get: Error 400 Error: invalid_request Missing required parameter: scope
tagged with: passport.js
has answer: http://stackoverflow.com/a/37446294
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45571144
tagged with: node.js

http://stackoverflow.com/comment/45580969
comment on: http://stackoverflow.com/a/28640888
type: AnswerComment
score: 0
type: Comment
has text: Hmm the OP states the height of '.slide-wrapper' should or will be static!!So I think it's the exact solution OP is looking for..

http://stackoverflow.com/comment/45666282
has text: This is a link to the demo the color picker so you know what I'm talking about a little more: http://jscolor.com/try.php
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28686933

http://stackoverflow.com/comment/45743548
has text: just pointing it out since browser will somewhat ignore function and open href, or in other words user won't see what function does likely
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28728323
type: AnswerComment

http://stackoverflow.com/q/28651870
score: 0
type: Question
has comment: http://stackoverflow.com/comment/45601109
tagged with: drm
tagged with: javascript
has body: I am trying to create a MediaKeySession but I can't figure out how to invoke the createSession() method in JavaScript. Does anyone know how can I do this?
has comment: http://stackoverflow.com/comment/45624285
has comment: http://stackoverflow.com/comment/45625985
has title: Invoke the createSession() method in JavaScript
type: UnansweredQuestion
answer count: 0

http://stackoverflow.com/comment/45553893
has text: Thanks I'll try again however when I used addmarker(lat, lon, filename, info) the map still displayed however the marker's weren't being added however I'll give it another go just wondering if there was anything wrong I was doing when echoing the marker within my for each loop.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28620446
type: Comment

http://stackoverflow.com/q/28679697
favorite count: 0
type: UnansweredQuestion
tagged with: gis
score: 3
tagged with: leaflet
has title: Leafletjs Cursor when hovering over WMS Layer
downvote count: 0
has body: I am using Leafletjs. Currently its pretty straight forward, I have a streets view from open maps. var streets = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'Map data &amp;copy; &lt;a href="http://openstreetmap.org"&gt;OpenStreetMap&lt;/a&gt; contributors' }); I also have a WMS layer that is coming from a geoserver. It has the standard getFeatureInfo and everything shows up correctly. L.tileLayer.wms("GEOSERVERURL", { layers: 'layers', format: 'image/png' ,transparent: true }).addTo(map); The wms layer is also clickable and I use getFeatureInfo to get the info for that layer. The issue is that the user doesn't know its clickable because the cursor never changes when they hover of the wms layer. My question is how do make the cursor change when hovering over the layer? Has anyone implemented this feature before or have an idea to implement it? The only research I have stumbled across so far has using mouseover on the map and calling getFeatureInfo to tell if its over a layer. However, that seems like it would cause a lot of chatter just to identify cursor area. EDIT: To clarify, I want the cursor to only change when its hovered over the wms layer that is populated. Although it technically gets applied to the whole map, it only has content on a part of it. Which kind of raises the question of 'Can I limit the wms layer to only the content area and then show a cursor?' Maybe a bounding area or something along those lines? EDIT 2: Below is an example of what it looks like. The street map parts I want to keep the normal cursor but I want a pointer when hovering over the colored wms map parts.
type: Question
tagged with: wms
tagged with: javascript
upvote count: 3
has answer: http://stackoverflow.com/a/28679931
answer count: 1

http://stackoverflow.com/comment/45728188
type: Comment
has text: Is it really necessary to dump such a huge wall of code to replicate the problem? You might want to read [this help page](http://stackoverflow.com/help/mcve) and see if you can trim this down to a shorted example that demonstrates the same behavior.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28720216

http://stackoverflow.com/comment/45745816
has text: If I unerstand I need to add this code function debounce(func, wait, immediate) { var timeout; return function() { var context = this, args = arguments; var later = function() { timeout = null; if (!immediate) func.apply(context, args); }; var callNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); if (callNow) func.apply(context, args); }; }; and then use this? debounce(function() { menu_scroll_to(elem); }, 250);
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28729201
type: Comment

http://stackoverflow.com/q/28658002
type: Question
answer count: 2
tagged with: testing
possible better answer: http://stackoverflow.com/a/28661265
tagged with: protractor
upvote count: 0
tagged with: javascript
tagged with: mocha.js
score: -1
accepted answer: http://stackoverflow.com/a/28658073
tagged with: performance-testing
favorite count: 0
has title: Unable to fail the test by timeout using the mocha with protractor
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28658073
has answer: http://stackoverflow.com/a/28661265
has body: I found on mocha web site then we can set the timeout fot it blocks, but looks like it doesn't work for me. describe('something', function () { this.timeout(500); it('should take less than 500', function (done) { setTimeout(done, 500); browser.get('#/dashboard'); }); }) Run result: something √ should take less than 500 &lt;9849&gt; Is it posible to get the actual test timeout and compare it? Or I should use expect() to fail the test? Thank you for any ideas in advance.
downvote count: 1

http://stackoverflow.com/comment/45557268
type: Comment
type: QuestionComment
has text: `document.body.appendChild(topBar);` ?
comment on: http://stackoverflow.com/q/28628456
score: 0

http://stackoverflow.com/comment/45651705
comment on: http://stackoverflow.com/a/28671149
has text: I have answered the second question here : http://stackoverflow.com/questions/28679156/removing-fixed-classes-does-not-properly-remove-them-from-the-presetation/28679220#28679220
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45689608
score: 0
has text: Is it necessary, when the function is inside the: in my HTML document?
comment on: http://stackoverflow.com/q/28699658
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28729857
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28729820
upvote count: 1
downvote count: 1
has body: Use bracket notation: $scope[model]

http://stackoverflow.com/a/28653160
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45621672
answers question: http://stackoverflow.com/q/28650399
has body: Please have a look at this jsFiddle and the demo below. It fires a bullet at every click, but fire angle is not correctly working yet. There is also the bullet handling in every bullet update interval it will check if the bullet is outside of the screen. Every bullet is added to an array to keep track of each. Each bullet in the array has the properties - DOM element, a speed and an angle. The game loop (setIntervall callback) is very basic and should be improved. There are many tutorials about it. e.g. check this page. $(function () { var box = $(".box"), screenWidth = $( window ).width(), screenHeight = $( window ).height(), $bullet = $('&lt;div/&gt;').addClass('bullet'), bulletSpeed=10, bulletList = [], angle = 0, boxCenter = [box.offset().left + box.width() / 2, box.offset().top + box.height() / 2]; console.log(screenWidth, screenHeight); $(document).mousemove(function (e) { angle = Math.atan2(e.pageX - boxCenter[0], -(e.pageY - boxCenter[1])) * (180 / Math.PI); //console.log(angle); box.css({ "-webkit-transform": 'translate(-50%,-50%) rotate(' + angle + 'deg)' }); box.css({ '-moz-transform': 'translate(-50%,-50%) rotate(' + angle + 'deg)' }); box.css({ 'transform': 'translate(-50%,-50%) rotate(' + angle + 'deg)' }); }); $(document).on('click', function() { console.log('fire bullet'); var $newBullet = $bullet.clone(); $(document.body).append($newBullet); bulletList.push({$el: $newBullet, speed: bulletSpeed, angle: parseInt(angle)}); }); var checkBullet = function() { if (bulletList.length &gt; 0) { $.each(bulletList, function(index, bullet) { if ( !bullet ) return; // tan = top/left = sin/cos var y = bullet.$el.position().top; var x = bullet.$el.position().left; x += Math.cos( (90-bullet.angle) * Math.PI / 180) * bullet.speed; // spped angle not correct yet. y += Math.sin( bullet.angle * Math.PI / 180) * bullet.speed; // speed angle not correct! bullet.$el.css({left: x, top: y}); //console.log(x); if ( x &gt; screenWidth || y &gt; screenHeight ){ // off-screen -…
has comment: http://stackoverflow.com/comment/45612755

http://stackoverflow.com/a/28748589
answers question: http://stackoverflow.com/q/28747864
type: Answer
has comment: http://stackoverflow.com/comment/45785025
accepted answer of: http://stackoverflow.com/q/28747864
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45789465
has body: The other question thread is slightly different, but points you in the right direction, in regards to using a confirmation dialog: First, I'm assuming that you have a form wrapped around all of these form elements in your table rows . . . you will have to give that form an onsubmit action to return the result of the confirmation function: &lt;form onSubmit="return confirmSubmit(this);"&gt; Then, use the following function to confirm the submission, based on the presence of any checked checkboxes: function confirmSubmit(theForm) { if (theForm.querySelectorAll('input:checked').length &gt; 0) { return confirm('Do you really want to **insert question criteria here**?') } else { return true; } } When the user submits the form, the code will check to see if there are any "checked" checkboxes in the form (I'm also assuming that there are no other checkboxes or radio buttons in the form, outside of the ones that you want to check in each row). If it finds at least one checked checkbox, it will ask the user to confirm that they want to submit. If they choose "Cancel", it will return false, stopping the form submission . . . in all other cases, it will return true, allowing the submission to continue. If there ARE other checkboxes or radio buttons in the form, the .querySelectorAll() parameter would need to be changed to accomodate for that, including (potentially) assigning a common class to all of the checkboxes that need to be included in the validation logic.

http://stackoverflow.com/q/28637417
has answer: http://stackoverflow.com/a/28638280
answer count: 2
tagged with: web-sql
possible better answer: http://stackoverflow.com/a/28638363
has comment: http://stackoverflow.com/comment/45574965
downvote count: 0
has answer: http://stackoverflow.com/a/28638363
favorite count: 0
tagged with: promise
has comment: http://stackoverflow.com/comment/45576380
accepted answer: http://stackoverflow.com/a/28638280
type: AnsweredQuestion
has title: Writing a promise to work with a callback that passes two arguments
has comment: http://stackoverflow.com/comment/45575051
score: 1
tagged with: babeljs
upvote count: 1
type: Question
tagged with: javascript
has body: In a recent cordova app at work, we used the WebSQL api, as it gave us the device support and functionality needed to store data locally. We're going to use it again for an upcoming project, so I started exploring promises with implemented in core.js, using BabelJS. edit added link to promises implementation. Here's what i have so far: function getConnection () { return window.openDatabase("cfa.db", "1.0", "CFA Database", 1000000); } function executeSql (transaction, query, args) { return new Promise((resolve, reject) =&gt; { console.log(query); transaction.executeSql(query, args, resolve, reject); }); } function transaction (connection) { return new Promise((resolve, reject) =&gt; { connection.transaction(resolve, reject); }); } class DataSource { executeSql (query, args) { var connection = getConnection(); transaction(connection).then((tx) =&gt; { return executeSql(tx, query, args); }).then((tx, res) =&gt; { console.log(tx, res.rows.length); }, (tx, e) =&gt; { console.log(e); }); } } And here's the barebones on doing a simple query with the api itself: var connection = getConnection(); connection.transaction(function (tx, res) { tx.executeSql("SELECT * FROM table", [], function (tx, res) { console.log(res.rows.length); }, function (tx, err) { console.log(err); }); }, function (err) { console.log(err); }); So the transaction simply passes the transaction instance, which i can use to execute a sql statement on. That was simple enough to wrap in a promise. The trickier part is the callbacks for the executeSql method. It passes the transaction, which is nice to use for additional queries. Then it passes the result data. How can I wrap this in a promise? In my DataSource class, the executeSql method there logs a transaction object, but no res object. The transaction then fires correctly, and returning the promise should work. But I respect that it only returns the first parameter. How can I get around this?

http://stackoverflow.com/q/28664517
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45722169
has answer: http://stackoverflow.com/a/28664577
type: Question
tagged with: jquery-animate
tagged with: javascript
has body: I am using this script for an automatic scrolling sidebar when scrolling on the page. This works fine, but I also want to achieve 2 things more: when mouseover over the sidebar, the animation must stop (moving up or down). How can I make this possible? the sidebar should start moving after 2 seconds when scrolling ( so a delay of 2 seconds before moving up or down) $(function() { var offset = $("aside.page-sidebar").offset(); var topPadding = 15; $(window).scroll(function() { if ($(window).scrollTop() &gt; offset.top) { $("aside.page-sidebar").stop().animate({ marginTop: $(window).scrollTop() - offset.top + topPadding },{ duration: 5000 }); } else { $("aside.page-sidebar").stop().animate({ marginTop: 0 },{ duration: 5000 }); }; }); });
score: 0
answer count: 1
has title: how to stop animation when mouseover

http://stackoverflow.com/comment/45772712
type: Comment
type: QuestionComment
has text: @PSL True, but I tried your Plunker and it worked with 1.4.0-beta.0 (unless I tested it wrong), so I assumed your issue got fixed in the large commit I posted, since it involved a lot of refactoring.
comment on: http://stackoverflow.com/q/28732796
score: 0

http://stackoverflow.com/q/28636522
has body: This is a problem from chapter 5 of Eloquent JS http://eloquentjavascript.net/05_higher_order.html function noisy(f) { return function(arg) { console.log("calling with", arg); var val = f(arg); console.log("called with", arg, "- got", val); return val; }; } noisy(Boolean)(12); // → calling with 0 // → called with 0 - got false Can someone please explain how f(arg) makes sense? I mean he is calling the argument f on another argument arg?? I am very confused. How about the part that has return val; Why does that have to be there? When I delete it, the code still runs like it should. Lastly, can some explain the code interpretation line by line? How does passing boolean make sense in the example? Thank you so much
type: Question
has answer: http://stackoverflow.com/a/29893718
has answer: http://stackoverflow.com/a/28636725
has answer: http://stackoverflow.com/a/28636548
tagged with: javascript
has title: Callbacks and Higher Order functions Javascript
score: 0
answer count: 3
linked to: http://stackoverflow.com/q/111102
tagged with: higher-order-functions
tagged with: callback
type: UnansweredQuestion

http://stackoverflow.com/comment/45514645
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28604946
has text: my expectation is what you have said in second part of your answer. Is it possible to achieve by answer of Rahul Desai?
score: 0

http://stackoverflow.com/q/28596756
downvote count: 0
tagged with: javascript
answer count: 3
score: 1
has comment: http://stackoverflow.com/comment/45526633
has comment: http://stackoverflow.com/comment/45528146
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45526432
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28596939
upvote count: 1
has body: I'm attempting to do an "infinite scroll" page with a nested data structure that has 4 levels, displayed via ng-repeats something like this: Category 1 - Item - Sub Item 1 - Activity A - Activity B - Activity C - Sub Item 2 - Activity D Category 2 I've been able to get an accurate index of a given item via the following function in my scope, but I'm not sure how to apply that to the filter on the various ng-repeats to cut off at say the 5th item (Activity B) in my list above. $scope.itemIndex = function(item) { var count = 0; if($scope.training[0] &amp;&amp; $scope.training[0].Assigned.length &gt; 0) { count++; if(item === $scope.training[0].Assigned) { return count; } for (var n = 0; n &lt; $scope.training[0].Assigned.length; n++) { count++; if(item === $scope.training[0].Assigned[n]) { return count; } for (var r = 0; r &lt; $scope.training[0].Assigned[n].requirements.length; r++) { count++; if(item === $scope.training[0].Assigned[n].requirements[r]) { return count; } for(var a = 0; a &lt; $scope.training[0].Assigned[n].requirements[r].activities.length; a++) { count ++; if(item === $scope.training[0].Assigned[n].requirements[r].activities[a]) { return count; } } } } } } I've tried various combinations of a global counter in the scope and passing $index down through the children but have been unable to find a working solution. What would be the best way to limit the nested repeats with a single total count in a way where I can change the count dynamically?
has comment: http://stackoverflow.com/comment/45500223
has title: Limiting nested Angular ng-repeat data structure
type: Question
has answer: http://stackoverflow.com/a/28635717
has answer: http://stackoverflow.com/a/28597164

http://stackoverflow.com/a/28627395
has body: There's no way to combine multiple HTML attribute assignment, you have to do them separately. Try: text_input('name', ' ', 'onkeyup="function()" onmousemove="function()"');
has comment: http://stackoverflow.com/comment/45556972
upvote count: 3
has comment: http://stackoverflow.com/comment/45556709
has comment: http://stackoverflow.com/comment/45556629
score: 3
has comment: http://stackoverflow.com/comment/45556921
has comment: http://stackoverflow.com/comment/45556341
has comment: http://stackoverflow.com/comment/45556778
has comment: http://stackoverflow.com/comment/45556680
has comment: http://stackoverflow.com/comment/45556320
downvote count: 0
has comment: http://stackoverflow.com/comment/45556294
answers question: http://stackoverflow.com/q/28627351
has comment: http://stackoverflow.com/comment/45556377
has comment: http://stackoverflow.com/comment/45556454
type: Answer

http://stackoverflow.com/comment/45613036
type: Comment
score: 0
has text: @JohnCarlRondesYmas, Nope that's logical, needs to be on your server :-). Updated it with a working image link.
type: AnswerComment
comment on: http://stackoverflow.com/a/28658304

http://stackoverflow.com/q/28631260
has answer: http://stackoverflow.com/a/47105238
has answer: http://stackoverflow.com/a/28631356
downvote count: 2
has title: How to get filename and line number of where a function is called in Node?
accepted answer: http://stackoverflow.com/a/47105238
upvote count: 23
answer count: 4
tagged with: node.js
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/70062659
has body: When working in Python I always have this simple utility function which returns the file name and line number from where the function is called: from inspect import getframeinfo, stack def d(): """ d stands for Debug. It returns the file name and line number from where this function is called.""" caller = getframeinfo(stack()[1][0]) return "%s:%d -" % (caller.filename, caller.lineno) So in my code I simply put a couple debug lines like this to see how far we get before some error occurs: print d() # Some buggy code here print d() # More buggy code here print d(), 'here is the result of some var: ', someVar This works really well for me because it really helps debugging quickly. I'm now looking for the equivalent in a node backend script. I was searching around but I can't find anything useful (maybe I'm looking for the wrong words?). Does anybody know how I can create a Javascript/nodejs function which outputs the file name and line number from where the function is called? All tips are welcome!
has comment: http://stackoverflow.com/comment/45562648
score: 21
has answer: http://stackoverflow.com/a/70062659
has comment: http://stackoverflow.com/comment/81161528
has comment: http://stackoverflow.com/comment/81161597
linked to: http://stackoverflow.com/q/13815640
type: Question
linked to: http://stackoverflow.com/q/13591785
has answer: http://stackoverflow.com/a/47120566
has comment: http://stackoverflow.com/comment/81161582
linked to: http://stackoverflow.com/q/1340872
tagged with: javascript
has comment: http://stackoverflow.com/comment/81161599
has comment: http://stackoverflow.com/comment/81165747
has comment: http://stackoverflow.com/comment/81221233
has comment: http://stackoverflow.com/comment/81161488
favorite count: 0
has comment: http://stackoverflow.com/comment/81161504

http://stackoverflow.com/comment/45612039
comment on: http://stackoverflow.com/q/28658020
type: Comment
type: QuestionComment
score: 0
has text: Can you check your console to see if it throws any errors or warnings?

http://stackoverflow.com/comment/45636653
comment on: http://stackoverflow.com/a/28670730
score: 0
type: Comment
has text: @LeuvenWang what is the problem with email ? tell me if you are facing anyproblem
type: AnswerComment

http://stackoverflow.com/comment/45676323
type: Comment
type: AnswerComment
has text: I want the length of the tree to get reduced and width to increase so that I can print it in one paper in landscape mode.
comment on: http://stackoverflow.com/a/28678496
score: 0

http://stackoverflow.com/q/28646574
has title: Javascript function does not work more specific? 654564654
has comment: http://stackoverflow.com/comment/45590883
has answer: http://stackoverflow.com/a/28646662
score: 2
has body: WHen user clicks on sumbit button, it should check if username value is empty, if it is empty, alert box should be displayed. It does not work, alert box is not displaying.. could u tell me what is wrong? thx Its not whole html code, only part of it html : &lt;script type="text/javascript" src="/js/checkForm.js"&gt;&lt;/script&gt; &lt;body&gt; &lt;form method = "post" name="registerForm" action="register.php" id= "register_form" &gt; &lt;input type="text" id="username" name="username" &gt; &lt;input type="submit" id="register_button1" onsumbit="return checkForm()" value="Sumbit" &gt; javascript: function checkForm() { var username = document.getElementById('username'); if(username.value == "") { alert("Name is not entered"); return false; } }
type: Question
has comment: http://stackoverflow.com/comment/45590919
tagged with: javascript
has comment: http://stackoverflow.com/comment/45590784
answer count: 3
has answer: http://stackoverflow.com/a/28646663
downvote count: 0
has comment: http://stackoverflow.com/comment/45590936
favorite count: 0
has comment: http://stackoverflow.com/comment/45590913
upvote count: 2
has comment: http://stackoverflow.com/comment/45590838
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28646842

http://stackoverflow.com/a/28616372
answers question: http://stackoverflow.com/q/28616055
score: 0
has body: Add a key to your payload, and use it in the {{#each}}: http://jsbin.com/loveci/1/edit?html,js,output
type: Answer

http://stackoverflow.com/q/28650570
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45598739
favorite count: 0
score: 8
upvote count: 8
has comment: http://stackoverflow.com/comment/45598554
accepted answer: http://stackoverflow.com/a/28650916
type: AnsweredQuestion
has title: Associate Data With HTML Element (without jQuery)
type: Question
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/28650781
tagged with: javascript
has answer: http://stackoverflow.com/a/28650916
has body: I need to associate some data with an HTML Element, hopefully avoiding any memory leaks. Obviously a simple solution would be to throw some kind of identifier on the element, and then create a dictionary mapping that identifier to the data I need. However, this is in a javascript library that users will add to their page, thus I don't have control over when elements are added or removed. What I'm looking to do is associate data with an HTML element while it's on the page, while allowing for that data to be GC'd when/if the element is removed. Is there a way to do this that doesn't involve writing my own periodic GC to clean up orphaned data? Is it safe to add properties to HTML elements?
possible better answer: http://stackoverflow.com/a/28650781

http://stackoverflow.com/comment/67877953
comment on: http://stackoverflow.com/a/28703648
has text: You can also extend Promise to have `.spread()` like Bluebird showing in this related answer: http://stackoverflow.com/a/22776850/1624862
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45759223
comment on: http://stackoverflow.com/q/28737441
has text: you want to execute controller into pageElements function ? I think its not impossible
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28700049
has body: Here is my test snippet ( vanillaJs ) regarding your problem: www.jsfiddle.net/40uovxgt/2/ Next you can read about this problem in general: HTML tag &lt;a&gt; want to add both href and onclick working In my opinion, if you use jQuery, you should bind events using jQuery built-in solutions
type: Answer
has comment: http://stackoverflow.com/comment/45690724
answers question: http://stackoverflow.com/q/28699658
has comment: http://stackoverflow.com/comment/45690533
score: 0

http://stackoverflow.com/q/28691774
answer count: 0
linked to: http://stackoverflow.com/q/18576419
type: UnansweredQuestion
tagged with: tumblr
has body: I'm developing a Tumblr theme, but I have a problem with jquery. When I use this bunch code outside of Tumbl it work like a charm, but when I use it on Tumblr nothing happen. How can I make it work on Tumblr too? How you can see in the fiddle I want to add the class .smaller to the header when the article reach the top of the window. thanks, Filippo // resize the header to small size $(document).on("scroll", function(){ if ($(document).scrollTop() > $(window).height()){ $("header").addClass("smaller"); updateSliderMargin(); } else { $("header").removeClass("smaller"); updateSliderMargin(); } }); body { text-align: center; margin: 0; padding: 0; } li { display: inline; } header { position: fixed; top: 0; width: 100%; height: 150px; background-color: red; z-index: 99; opacity: 0.8; } header.smaller { height: 50px; } header.smaller ul { display: none; } article { position: relative; top: 100vh; background-color: green; min-height: 1000px; z-index: 1; } This is the Header list 1 list 2 list 3 This is the Article Fiddle Demo http://jsfiddle.net/z3cqkt9a/
has comment: http://stackoverflow.com/comment/45674779
type: Question
has comment: http://stackoverflow.com/comment/45680098
has comment: http://stackoverflow.com/comment/45721554
has comment: http://stackoverflow.com/comment/45675276
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45676934
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Tumblr: jquery doesn't work

http://stackoverflow.com/q/28701157
favorite count: 0
accepted answer: http://stackoverflow.com/a/28701904
upvote count: 1
has body: this is my JSON structure: var json = { procedure: { id: "content", child: { 154: { class: "sequence nest", text: "LED Ausgeben", id: 154 } } } }; For some reason prop in for (var prop in scope.child){} is only a string instead of the object scope.child.154 as you can see below at Watch Expressions. any ideas why? i tried specifying JSON objects with "154" but it doesn't matter. do their names have to contain characters aswell? here is the fiddle: JSFiddle but you have to use the browsers console. to check it, press on the folder icon. cheers!
tagged with: pass-by-reference
has comment: http://stackoverflow.com/comment/45693921
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/921789
tagged with: http://stackoverflow.com/tag/json
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28701904
answer count: 1
score: 1
tagged with: string
has title: Function parameter turns into Object's Name instead of its reference

http://stackoverflow.com/comment/45726109
type: Comment
has text: Thank you very much, same to dhunt. This is EXACTLY what I was looking for. I didn't know about each() but it's perfect and works perfectly. You guys are brilliant!
comment on: http://stackoverflow.com/a/28719482
type: AnswerComment
score: 0

http://stackoverflow.com/q/28671684
tagged with: testing
has comment: http://stackoverflow.com/comment/45637110
tagged with: javascript
score: 0
has body: I need to test a method called scrollToBottom which does the following: this.getMainElem().scrollTop = this.getMainElem().scrollHeight; Since a new element has no scrollHeight or scrollTop value until it has been pasted onto the DOM, how can I test my method? At the moment, I have to create a new element with text, a height and overflow auto then append it directly to document.body. Can you suggest a cleaner way of testing this?
has title: Testing a scroll method
answer count: 0
type: UnansweredQuestion
tagged with: scroll
has comment: http://stackoverflow.com/comment/45637217
type: Question

http://stackoverflow.com/q/28622216
tagged with: javascript
type: UnansweredQuestion
has title: Getting/setting session cookie from Play Framework 2.2(Java) in Angular.js
tagged with: playframework
score: 2
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45574334
has body: I'm just starting to learn Angular and decided I would build the backend API using Play framework 2.2 in Java. I've written web apps before in Play, but I only used Jquery and now im facing some confusions with Angular. I am trying to write an authentication service where i pass a username and password and then save the cookie in the Angular app. Here is my code: Authentication.js: (function(){ var authentication = function($rootScope, $http, $cookieStore){ var service = {}; service.login = function(username, password, callback){ $http.post("http://localhost:9000/login", {userName: username, password: password}) .success(function(data, status, header){ console.log(data); console.log(status); console.log(Object.keys(header)); callback(data, status, header); }); }; service.setCredentials = function(data){ console.log("setting credentials"); } return service; }; var module = angular.module("listr"); module.factory("AuthenticationService", authentication); }()); LoginCtrl.js: (function(){ var module = angular.module("listr"); var LoginCtrl = function($scope, AuthenticationService){ $scope.login=function(){ console.log("Logging in"); AuthenticationService.login($scope.username, $scope.password, function(data, status, header){ if(status == 200){ AuthenticationService.setCredentials(data, status, header); } else{ alert("error logging in"); } }); }; }; module.controller("LoginCtrl", LoginCtrl); }()); when i submit the form in my app, I get back a 200 ok status, but im not sure how to get the cookie that play returns. I can see in the network request in the web console that the cookie. See the screen shot below: I feel like ive been googling forever and I cant seem to figure out how to access the cookie. Also i've set the httponly as false with the folloing: session.httpOnly=false in my application.conf Any help would be greatly appreciated. Thanks!
tagged with: angularjs
type: Question
upvote count: 2
tagged with: web-services
tagged with: java
answer count: 0

http://stackoverflow.com/comment/45540668
type: Comment
comment on: http://stackoverflow.com/q/28618755
score: 0
type: QuestionComment
has text: I see what you say, however my concern is more on the server side, why is it that I get a GET error when i set asynchronous to true? and why isn't the echo "Error" executed... I did try to execute a separate JS on the console directly, but I got the same answers

http://stackoverflow.com/comment/45667293
comment on: http://stackoverflow.com/q/28687483
score: 0
type: Comment
type: QuestionComment
has text: Have you tried debugging the javascript with either Google developer tools or Mozilla firebug?

performance
tags question: http://stackoverflow.com/q/28695769
tags question: http://stackoverflow.com/q/28668946
tags question: http://stackoverflow.com/q/28641362
tags question: http://stackoverflow.com/q/28622587
tags question: http://stackoverflow.com/q/28697807
tags question: http://stackoverflow.com/q/28612296
tags question: http://stackoverflow.com/q/28612737
tags question: http://stackoverflow.com/q/28696330
tags question: http://stackoverflow.com/q/28659268
tags question: http://stackoverflow.com/q/28673249
tags question: http://stackoverflow.com/q/28740214
tags question: http://stackoverflow.com/q/28707754
tags question: http://stackoverflow.com/q/28652563
tags question: http://stackoverflow.com/q/28616283
tags question: http://stackoverflow.com/q/28674943
tags question: http://stackoverflow.com/q/28738525
tags question: http://stackoverflow.com/q/28702171
tags question: http://stackoverflow.com/q/28646046
tags question: http://stackoverflow.com/q/28610663
tags question: http://stackoverflow.com/q/28713129
tags question: http://stackoverflow.com/q/28634286
tags question: http://stackoverflow.com/q/28735424
tags question: http://stackoverflow.com/q/28701318
tags question: http://stackoverflow.com/q/28670440
tag name: performance
tags question: http://stackoverflow.com/q/28721655
tags question: http://stackoverflow.com/q/28664363
type: Tag
tags question: http://stackoverflow.com/q/28660013

http://stackoverflow.com/a/28668304
score: 2
accepted answer of: http://stackoverflow.com/q/28668277
downvote count: 0
answers question: http://stackoverflow.com/q/28668277
has body: Take a look at nl2br on php.js which seems exactly what you're looking for. Basically, it's: function nl2br (str, is_xhtml) { var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '&lt;br /&gt;' : '&lt;br&gt;'; return (str + '').replace(/([^&gt;\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2'); } Demo : http://devilmaycode.altervista.org/jquery-convert-line-breaks-to-br-nl2br-equivalent/
upvote count: 2
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/45715218
score: 0
comment on: http://stackoverflow.com/q/28713704
type: Comment
type: QuestionComment
has text: [String methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#Methods_2) - which one would you use to get the first char?

http://stackoverflow.com/comment/45570503
has text: @JasonCochran sure, it would work - although a "more meteor" way would be `Meteor.wrapAsync` and use the code as if it is synchronous. The "promises response" to that is using generators and coroutines (Bluebird.coroutine). Personally I prefer the promises version but both are viable (as are plain callbacks). Just to be extra clear - it would work.
type: Comment
comment on: http://stackoverflow.com/a/28633650
score: 1
type: AnswerComment

http://stackoverflow.com/q/28734585
has comment: http://stackoverflow.com/comment/45754695
score: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45757661
has comment: http://stackoverflow.com/comment/45754757
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28734832
upvote count: 1
has comment: http://stackoverflow.com/comment/45754908
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45755043
tagged with: css
has comment: http://stackoverflow.com/comment/45754962
has comment: http://stackoverflow.com/comment/45754945
tagged with: http://stackoverflow.com/tag/svg
possible better answer: http://stackoverflow.com/a/28734832
has comment: http://stackoverflow.com/comment/45754720
has title: How to add stroke around whole circle and animate to rotate circle in svg?
has answer: http://stackoverflow.com/a/28736283
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28736283
has body: Here is my jsfiddle link: http://jsfiddle.net/q611wenr/4/ Now i need to add stroke around the whole green color circle. If i add like this: stroke ="#000" stroke-width="2" .. it shows text only having stroke.. I need like this one http://s23.postimg.org/w1yktgeuj/Untitled_1.png And also have to rotating dynamically, i mean not whole circle only rotate that 6 parts within the green color circle. I am new to using SVG, so can anyone help me? May i know how to do this? Thanks in advance.

http://stackoverflow.com/comment/45707289
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28708914
has text: thanks Alexander - been a long day - did not mean to add in PHP
score: 0

http://stackoverflow.com/comment/118540355
comment on: http://stackoverflow.com/a/28692538
has text: This comment shows a possible workaround: https://bugzilla.mozilla.org/show_bug.cgi?id=700533#c39
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/28670878
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer
has body: Since you are using Primefaces you could call the Javascript function from your Action Method at your ManagedBean itself using Primefaces RequestContext's execute method. String script = "chooseStoragePath('"+PATH_VAR+"')"; RequestContext.getCurrentInstance().execute(script);
accepted answer of: http://stackoverflow.com/q/28666848
type: Answer
answers question: http://stackoverflow.com/q/28666848

http://stackoverflow.com/comment/45664325
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28684040
has text: If you're developing something for your own use, and are willing to use a browser plugin, you can use something like Ignore X-Frame headers plugin for Chrome (https://chrome.google.com/webstore/detail/ignore-x-frame-headers/gleekbfjekiniecknbkamfmkohkpodhe?hl=en-US). That obviously doesn't help if you're trying to solve a problem for general-use or production code.
score: 0

http://stackoverflow.com/a/28641538
has comment: http://stackoverflow.com/comment/45583170
has comment: http://stackoverflow.com/comment/45582289
type: Answer
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/45738832
answers question: http://stackoverflow.com/q/28641443
has comment: http://stackoverflow.com/comment/45582917
score: 4
accepted answer of: http://stackoverflow.com/q/28641443
type: AcceptedAnswer
has body: JSON.parse() parses the string the same way whether or not you provide a reviver function (in other words, it does not switch to a "streaming parser" when a reviver is passed in). Providing a reviver function is just a convenience so as not to have to write the necessary loops yourself. There are some streaming JSON parsers on npm, for example: clarinet, JSONStream, and oboe. Here's a little test for those 3: var clarinet = require('clarinet').parser(); var JSONStream = require('JSONStream').parse('*', function (value, path) { return { key: path[path.length - 1], value: value, path: path } }); var rs = new (require('stream').Readable)(); rs._read = function(n) {}; var oboe = require('oboe')(rs); var content = '{"value": "a", "value": "b", "value": "c" }'; clarinet.onopenobject = clarinet.onkey = function(k) { console.log('clarinet key =', k); }; clarinet.onvalue = function(v) { console.log('clarinet value =', v); }; clarinet.write(content).close(); JSONStream.on('data', function(d) { console.log('JSONStream data:', arguments); }).end(content); oboe.on('node:*', function(n) { console.log('oboe node:', arguments); }); rs.push(content); rs.push(null); // output: // clarinet key = value // clarinet value = a // clarinet key = value // clarinet value = b // clarinet key = value // clarinet value = c // JSONStream data: { '0': { key: 'value', value: 'a', path: [ 'value' ] } } // JSONStream data: { '0': { key: 'value', value: 'b', path: [ 'value' ] } } // JSONStream data: { '0': { key: 'value', value: 'c', path: [ 'value' ] } } // oboe node: { '0': 'a', '1': [ 'value' ], '2': [ { value: 'a' }, 'a' ] } // oboe node: { '0': 'b', '1': [ 'value' ], '2': [ { value: 'b' }, 'b' ] } // oboe node: { '0': 'c', '1': [ 'value' ], '2': [ { value: 'c' }, 'c' ] } // oboe node: { '0': { value: 'c' }, '1': [], '2': [ { value: 'c' } ] }

http://stackoverflow.com/a/28994709
upvote count: 22
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28677335
type: Answer
has body: Returns a number between 0 to 100 relative to scroll position: document.onscroll = function(){ var pos = getVerticalScrollPercentage(document.body) document.body.innerHTML = "&lt;span&gt;" + Math.round(pos) + "%&lt;span&gt;" } function getVerticalScrollPercentage( elm ){ var p = elm.parentNode return (elm.scrollTop || p.scrollTop) / (p.scrollHeight - p.clientHeight ) * 100 } body{ height:2000px } span{ position:fixed; font:5em Arial; color:salmon; } ● Difference between scrollHeight &amp; clientHeight
accepted answer of: http://stackoverflow.com/q/28677335
score: 22

http://stackoverflow.com/comment/45725154
score: 0
type: AnswerComment
type: Comment
has text: update: $('html').html(data); gives blank page, and $("body").html($(data).find("body").html()); not (but the content is not replaced)
comment on: http://stackoverflow.com/a/28717581

http://stackoverflow.com/a/28743652
has comment: http://stackoverflow.com/comment/45801912
has comment: http://stackoverflow.com/comment/45801639
has comment: http://stackoverflow.com/comment/45800774
type: Answer
has comment: http://stackoverflow.com/comment/45799745
has comment: http://stackoverflow.com/comment/45801987
score: 2
accepted answer of: http://stackoverflow.com/q/28743095
downvote count: 0
has comment: http://stackoverflow.com/comment/45799278
answers question: http://stackoverflow.com/q/28743095
upvote count: 2
has body: You mean this (note I changed hospitails to hospitals and assume only one class on the TRs): FIDDLE $(function () { $(".hospitals").on("click",function (event) { var $elem = $(event.target), str = '', locs, len, i = 0, strArr = [], elemClass=$elem.prop("class"); if (elemClass.indexOf('_class') !=-1) { str = "."+elemClass.split("_class")[0]+'_loc ul li a'; $locs = $(str); len = $locs.length; for (; i < len; i++) { strArr.push($locs[i].text); } strArr = strArr.join('|'); } $("#output").html(strArr.length>0?strArr:""); }); $(".hospitals > td:first").click(); }); td { padding:3px; border-right: 1px dashed #f0F; border-bottom: 1px dashed #f00; } #output { padding:3px; } Locations Hospitals Clinics Home Care Information Centers Bangalore salem Goa Mangalore Visakhapatnam Vijawada jaipur Malaysia Lagos(Nigeria) Bangalore Jaipur Andhrapradesh Karnataka Goa Tamil Naidu
has comment: http://stackoverflow.com/comment/45801698
has comment: http://stackoverflow.com/comment/45800688
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45800063
has comment: http://stackoverflow.com/comment/45801712
has comment: http://stackoverflow.com/comment/45801620
has comment: http://stackoverflow.com/comment/45799114

http://stackoverflow.com/comment/45600139
has text: Can you provide a link?.. You can make also something like this : .picture{ width:100%; background-image:url(url_to_your_image); background-size:cover; background-repeat:no-repeat;} and then you can delete the img tag
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28651091

http://stackoverflow.com/comment/45688890
score: 1
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28699255
has text: @pearlescentcrescent [**Example Here**](http://www.maxdesign.com.au/articles/css3-media-queries/media-sample/) this is using media queries, as the window gets smaller the layout "moves".

http://stackoverflow.com/comment/45750055
comment on: http://stackoverflow.com/a/28731509
has text: No, you're thinking of `$_REQUEST` which covers both GET and POST. `$_GET` is only for GET. (Ok, maybe if you put params in the querystring like a GET while technically doing a POST it would work, but I wouldn't count on it in production)
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45528733
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28612517
score: 1
has text: `getElementById` selects an element by its **ID**, not a class.

http://stackoverflow.com/comment/45647064
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28675921
has text: the problem is you want to do it one-way but, you want to change the list. But in one-way you cant change it. One way is just to view it. And if you remove the :: it will called twice too. It is really hard to handle the cycles..

http://stackoverflow.com/comment/45562638
has text: when you type /api/users/userName in the address bar of your browser, do you get the correct json?
type: Comment
comment on: http://stackoverflow.com/q/28631006
score: 0
type: QuestionComment

http://stackoverflow.com/q/28653825
tagged with: javascript
upvote count: 4
has title: Sharing addon objects (content scripts) with Web content (page objects) in Firefox
tagged with: firefox-addon
type: AnsweredQuestion
tagged with: firefox
downvote count: 0
has body: I spent days trying to share one of my Firefox for Android extension objects with the webpages I also open from my extension (declared as resources). The thing is I have read a lot about the last year's changes about unsafewindow, so I tryed a very small example with the new functions but didn't work. I copied the examples and I also tryed my owns, but there is no way to copy existing objects with functionality. See, I have a VERY big object to clone in the content window, but I decided to test with a small one: //From addon var dog = { name: 'Spike', woof: function(){alert('woof woof!')} }; And after that I tryed to copy this object into the active window: //From addon var contentWindow = window.BrowserApp.selectedBrowser.contentWindow; contentWindow.dog = Components.utils.cloneInto( dog, contentWindow, {cloneFunctions: true} ); And after that, I tryed to check what was really copied: alert(contentWindow.dog); //Shows: [object Object] alert(contentWindow.dog.name); //Shows: Spike alert(contentWindow.dog.woof); //Shows: undefined So, I can clone the objects but no the functions, even when I declared "cloneFunctions: true". I also tryed to create an empty object and then assign the functions (a lot of work thinking in my so big original object), and didn't work: function greetme(user) { return "cheers " + user; } var foo = Components.utils.createObjectIn(contentWindow,{defineAs: "foo"}); Components.utils.exportFunction(greetme, foo, {defineAs: "greetme"}); //foo is not an object in current window So... Any idea is welcome, I really don't know what to do because theory and given examples doesn't work anymore. Thanks (A LOT) in advance!! https://blog.mozilla.org/addons/2014/04/10/changes-to-unsafewindow-for-the-add-on-sdk/
favorite count: 0
type: Question
tagged with: firefox-addon-sdk
score: 4
has answer: http://stackoverflow.com/a/28659056
answer count: 1
accepted answer: http://stackoverflow.com/a/28659056

http://stackoverflow.com/a/28688060
answers question: http://stackoverflow.com/q/28653378
has comment: http://stackoverflow.com/comment/45767829
has comment: http://stackoverflow.com/comment/45710635
has comment: http://stackoverflow.com/comment/45770719
has comment: http://stackoverflow.com/comment/45742471
score: 0
has body: When you post form data from ajax request to Servlet, the servlet send response with content from home.jsp but, it cannot redirect the browser to home.jsp as it is the ajax request. So you need to manually (using window.location.href attribute) redirect the browser to home.jsp. Setting request attributes only works per request basis. In your case it will work for first time when sending response to your ajax request, not when redirecting to home.jsp.So use session level attrbutes. I suggest following code changes: login.js $(document).ready(function (){ $("#log").click(function (){ var log = $("#login").val(); $.post("Test",{log:log},function(){ }).success(function (){ window.location.href="home.jsp" ; }); servlet:Test.java String l =request.getParameter("log"); request.getSession().setAttribute("l", l); home.jsp &lt;body&gt; &lt;%=session.getAttribute("l") %&gt; &lt;/body&gt;
type: Answer
has comment: http://stackoverflow.com/comment/45699488

timer
tag name: timer
type: Tag
tags question: http://stackoverflow.com/q/28609897
tags question: http://stackoverflow.com/q/28638061
tags question: http://stackoverflow.com/q/28624076

http://stackoverflow.com/comment/46386387
score: 0
type: Comment
type: QuestionComment
has text: My github repo is https://github.com/marcinwal/myownnode.git; code which I meant is in public/javascript/main folder; My idea was to learn how to solve such problems in different ways.
comment on: http://stackoverflow.com/q/28678092

http://stackoverflow.com/q/28638061
accepted answer: http://stackoverflow.com/a/28638123
tagged with: timer
has body: im trying to make a volume bar for a video. the concept is that when you click the volume button, a div appears, and you can control the volume level with it. when you hover out from the div a counter starts counting down from 7 and makes the div disappear. however, if the counter started and you hover back on the volume controler, the counter is stopped. I dont know how to interrupt the timer from counting down. any input? this is what i got so far. //event for volume bar volumeC.addEventListener("mouseover", function(){ volumeC.style.display = 'inline-block'; }); volumeC.addEventListener("mouseout", function(){ timer = setTimeout(function () { volumeC.style.display = 'none'; }, 7000); });
tagged with: volume
has title: start timer on mouse out interrupt timer on mouseover javascript
tagged with: http://stackoverflow.com/tag/html
tagged with: video
upvote count: 1
downvote count: 1
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28638123
tagged with: javascript
score: 0
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45575836

http://stackoverflow.com/q/28669114
tagged with: ecmascript-6
has answer: http://stackoverflow.com/a/28669591
has body: What es6 features can I use when I run a file with --harmony flag? Or where can I find any details about it? My versions: Cheers!
answer count: 1
linked to: http://stackoverflow.com/q/28388885
tagged with: koa
tagged with: javascript
has comment: http://stackoverflow.com/comment/45632489
duplicate of: http://stackoverflow.com/q/28388885
tagged with: node.js
favorite count: 0
accepted answer: http://stackoverflow.com/a/28669591
has title: es6 support in a current node version
downvote count: 2
upvote count: 1
type: Question
type: AnsweredQuestion
score: -1
has comment: http://stackoverflow.com/comment/45633290

http://stackoverflow.com/comment/45734400
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28723751
has text: JavaScript will, like almost any other language, interpret those numbers as **base 10** values.
type: Comment

http://stackoverflow.com/a/28623344
has comment: http://stackoverflow.com/comment/45700484
type: Answer
has comment: http://stackoverflow.com/comment/45983425
has comment: http://stackoverflow.com/comment/45616331
has comment: http://stackoverflow.com/comment/45908328
has comment: http://stackoverflow.com/comment/45777073
has comment: http://stackoverflow.com/comment/45655546
has comment: http://stackoverflow.com/comment/45653063
upvote count: 1
has comment: http://stackoverflow.com/comment/45563950
score: 1
has comment: http://stackoverflow.com/comment/45644305
has comment: http://stackoverflow.com/comment/45949037
has comment: http://stackoverflow.com/comment/45836845
has comment: http://stackoverflow.com/comment/45872229
has comment: http://stackoverflow.com/comment/45744999
downvote count: 0
answers question: http://stackoverflow.com/q/28615950
has comment: http://stackoverflow.com/comment/45563647
has body: You're applying endsWithSuffix on a json representation of lop.objects.all(). Shouldn't you test endsWithSuffix for {{lop.name}} instead?

http://stackoverflow.com/comment/45650645
has text: if you are using symfony2.4 the generation of token has changed use `security.csrf.token_manager` instead of `form.csrf_provider`
comment on: http://stackoverflow.com/q/28678307
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45513154
type: QuestionComment
has text: stick on scrolling down , unstick when user is scrolling up???
score: 0
comment on: http://stackoverflow.com/q/28604111
type: Comment

http://stackoverflow.com/q/28720553
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/29413159
tagged with: javascript
has comment: http://stackoverflow.com/comment/45732417
has comment: http://stackoverflow.com/comment/45730555
answer count: 1
downvote count: 0
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
has body: I'm attempting to generate a path around 2 circles that should follow them as I move them around. I've based this on an example that I found and built a prototype of what I'm expecting to achieve example I've started including this in my application, but for some reason I can't seem to get the green path to draw around the correct positions, and I can't figure out why. I've put together a code example to illustrate: function generatePath(planet, moon, join) { function distanceBetween(x1, y1, x2, y2) { var a = (x2 - x1) * (x2 - x1); var b = (y2 - y1) * (y2 - y1); return Math.sqrt(a + b); }; function circleYFromX(circle, x) { return Math.sqrt(Math.pow(circle.r, 2) - Math.pow(x - circle.x, 2)); }; function calculateAngle(origin, point) { var tan = (point.y - origin.y) / (point.x - origin.x); var angle = Math.atan(tan) / Math.PI * 180 + 90; if (point.x < origin.x) angle += 180; return angle; }; // Work out the distance between the moon and planet var distance = distanceBetween(planet.x, planet.y, moon.x, moon.y); var originDistance = planet.r - moon.r; var distanceDiff = distance - originDistance; if (distanceDiff < 1) { distanceDiff = 1; } console.log(distance); console.log(planet.r); console.log(moon.r); console.log(join.r); console.log(planet.r + moon.r + 2 * join.r); // Determine if the moon has moved out of the planet's gravitational pull if (distance > 2 * join.r + planet.r + moon.r) { return; } moon.h = 0; moon.k = 0 - planet.r + moon.r - distanceDiff; var triangleA = planet.r + join.r; // Side planet var triangleB = moon.r + join.r; // Side moon var triangleC = Math.abs(moon.k - 0); // Side c var triangleP = (triangleA + triangleB + triangleC) / 2; // Triangle half perimeter var triangleArea = Math.sqrt(triangleP * (triangleP - triangleA) * (triangleP - triangleB) * (triangleP - triangleC)); // Triangle area var triangleH; var triangleD; if (triangleC >= triangleA) { var triangleH = 2 * triangleArea / triangleC; // Triangle height var triangleD = Math.sqrt(Math.…
has answer: http://stackoverflow.com/a/29413159
type: AnsweredQuestion
has title: SVG path doesn't seem to orientate itself correctly
score: 1

http://stackoverflow.com/comment/45587217
type: Comment
comment on: http://stackoverflow.com/q/28644523
has text: Have you tried adding a space here: `$content.load(link + ' .last-news .content', function()` before `.last-news`?
score: 0
type: QuestionComment

http://stackoverflow.com/a/28697676
type: Answer
has comment: http://stackoverflow.com/comment/45686016
upvote count: 3
has comment: http://stackoverflow.com/comment/45685687
accepted answer of: http://stackoverflow.com/q/28683205
score: 3
has comment: http://stackoverflow.com/comment/70210408
answers question: http://stackoverflow.com/q/28683205
has comment: http://stackoverflow.com/comment/45689184
has body: I got it. I am using subscriptions and two way binding pretty extensively and all of that seems to still work properly. Basically, the KO infrastructure just goes through and syncs up the UI with the updated model binding on a UI or model update. Thus, it is setting every options' selected property on a UI update, and when it "re-selects" the last one, IE decides to scroll it into view. I took the debug version of Knockout 3.2.0 and edited lines 305-310 to NOT attempt to update the options' selected property if it is already equal to whatever is being set. I plan to submit a pull request for this when I get time, but here it is if anyone else runs into this. UPDATE: Thanks again, to @JamesThorpe, here is the source I edited. setOptionNodeSelectionState: function (optionNode, isSelected) { // IE6 sometimes throws "unknown error" if you try to write to .selected directly, whereas Firefox struggles with setAttribute. Pick one based on browser. if (ieVersion &lt; 7) optionNode.setAttribute("selected", isSelected); else if (optionNode.selected != isSelected) optionNode.selected = isSelected; },
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28611267
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46526947
downvote count: 0
tagged with: javascript
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/29208854
score: 5
tagged with: socket.io
answer count: 1
accepted answer: http://stackoverflow.com/a/29208854
has title: How to detect when socket.io transport changes? (event or something)
upvote count: 5
has body: I'm trying to connect to server io.js+socket.io with socket.io client. It starts with xhr polling requests, the connect event and even first message are receiving throught xhr, then it upgrades to websocket. How can i detect when the switch of the transport happens to log it (on both sides)? Simplified server code: io.on("connection",function(socket){ console.log("transport",socket.conn.transport.name); //will print "polling" socket.on("join",function(data){ console.log("transport",socket.conn.transport.name); //will print "polling" (usualy) console.log("userjoined",data.userInfo); }); socket.on("testMsg",function(data){ console.log("transport",socket.conn.transport.name); //will print "websocket" (if it supported and already switched) }); socket.emit("hello","hello"); }) Simplified client code: var socket = io.connect(); socket.on("hello",function(data){ socket.emit("join",{userInfo: {name:"someName"}}); setTimeout(function(){ socket.emit("testMsg",{}); },8000) });

http://stackoverflow.com/a/49684109
score: 86
has comment: http://stackoverflow.com/comment/114100546
has comment: http://stackoverflow.com/comment/87193376
type: AcceptedAnswer
upvote count: 86
accepted answer of: http://stackoverflow.com/q/28624763
type: Answer
has body: With Array.from() and e.target.selectedOptions you can perform a controlled select-multiple: handleChange = (e) =&gt; { let value = Array.from(e.target.selectedOptions, option =&gt; option.value); this.setState({values: value}); } target.selectedOptions return a HTMLCollection https://codepen.io/papawa/pen/XExeZY
answers question: http://stackoverflow.com/q/28624763
downvote count: 0

http://stackoverflow.com/a/28639291
downvote count: 0
answers question: http://stackoverflow.com/q/28638008
has comment: http://stackoverflow.com/comment/45750839
type: Answer
has body: So instead of exec which is for running a program without doing any complex stdio interaction, use child_process.spawn which will give you access to the npm process's stdio and you can call child.stdin.write(username + "\n") on the child's stdin file (and similar for the password). That might be sufficient to get things to proceed, but sometimes when a program expects user interactive input, emulating that programmatically can be tricky (thus the existence of things like expect). I think npm (via the "read" npm module) is reading from stdin without echoing, in which case this should work. If, however, it's directly reading from the tty device, writing to stdin won't work.
upvote count: 7
accepted answer of: http://stackoverflow.com/q/28638008
score: 7
type: AcceptedAnswer

http://stackoverflow.com/a/28732504
has comment: http://stackoverflow.com/comment/117248443
type: AcceptedAnswer
has body: I ended up using moment.js. It has validation and overflow calculations among other Date object enhancements. Thanks to Kevin Williams for
accepted answer of: http://stackoverflow.com/q/28705902
answers question: http://stackoverflow.com/q/28705902
type: Answer
score: 2
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/45634925
type: Comment
type: QuestionComment
has text: @ArunPJohny Thanks , i am more concerned about `if ($('button').data())` not working though .
score: 0
comment on: http://stackoverflow.com/q/28670222

http://stackoverflow.com/q/28745176
has answer: http://stackoverflow.com/a/28745480
tagged with: forms
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28745480
tagged with: angularjs-ng-include
has body: I have a screen built with a several stacks of ng-includes. The last one, in special, I build the screen based on user configuration. Sometimes, I have to show a Form in one of this included templates. And when my user click on save button, I have to validate if all fields in the form are valid. In the meantime, when a try to access form object, to check for $valid, my form is undefined. After a day fighting against it, I've discovered that ng-include process is not accepting my form object to be created. I've created this plunker to see if it's really happening on a simple project, making a working form and not working one: http://plnkr.co/edit/4oMZYLgaYHJPoSZdSctI?p=preview Basically, created a form, like this, with demanded angular attributes: &lt;form name="sampleForm"&gt; &lt;input type="text" name="aws" required ng-model="myValue"&gt; &lt;br/&gt;myValue: "{{ myValue }}" &lt;br/&gt; &lt;input type="text" name="aws" required ng-model="myValue"&gt; &lt;br/&gt;myValue: "{{ myValue }}" &lt;/form&gt; And trying to access form object like this: $scope.sampleForm.aws.$valid And the result is: $scope.sampleForm === undefined Someone know how to solve this problem?
answer count: 1
downvote count: 0
favorite count: 0
has title: Why I can't access a form object inside a ngInclude on angularJS?
tagged with: angularjs
upvote count: 2
score: 2
type: AnsweredQuestion

http://stackoverflow.com/comment/45749034
type: AnswerComment
score: 0
has text: Yes, but normally I did not need it. It's just that there is something missing and I do not know what.
type: Comment
comment on: http://stackoverflow.com/a/28730199

http://stackoverflow.com/comment/45842327
type: QuestionComment
score: 0
has text: So it works now with some small changes? Shall Icreate a real answer then
comment on: http://stackoverflow.com/q/28620519
type: Comment

http://stackoverflow.com/a/32795601
has body: Since v0.4 React autoBind for you. See https://facebook.github.io/react/blog/2013/07/02/react-v0-4-autobind-by-default.html So you dont need to bind your self
answers question: http://stackoverflow.com/q/28703820
score: 0
type: Answer

http://stackoverflow.com/comment/66232207
type: Comment
has text: I am using this in jquery and its not working properly
comment on: http://stackoverflow.com/a/28945669
score: 0
type: AnswerComment

google-tag-manager
tags question: http://stackoverflow.com/q/28673249
type: Tag
tag name: google-tag-manager

http://stackoverflow.com/a/28673169
type: Answer
score: 2
has body: Only thing is you need to return the getRandomAlphabet method (function() { var getAlphabet = function() { var alphabet = []; for ( var asciiCode = 97; asciiCode &lt; 123; asciiCode++ ) { alphabet.push(String.fromCharCode(asciiCode)); } return alphabet; }; var getRandomAlphabet = function(alphabet, randomAlphabet) { var alphabet = alphabet || getAlphabet(); var alphabetLength = alphabet.length; var randomAlphabet = randomAlphabet || []; if ( alphabetLength === 0 ) { return randomAlphabet; }; var getRandomIndex = function(min, max) { return Math.floor(Math.random() * (max - min) + min); }; // remove the random item from the original alphabet var randomIndex = getRandomIndex(0, alphabetLength); var randomItem = alphabet.splice(randomIndex, 1)[0]; // add the random item to the random alphabet randomAlphabet = randomAlphabet.concat(randomItem); return getRandomAlphabet(alphabet, randomAlphabet); }; // this returns undefined console.log(getRandomAlphabet()); })();
answers question: http://stackoverflow.com/q/28673069
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28673069
downvote count: 0
upvote count: 2

http://stackoverflow.com/q/28720555
answer count: 1
downvote count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28720942
favorite count: 0
has comment: http://stackoverflow.com/comment/45729317
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/45728256
has comment: http://stackoverflow.com/comment/45728150
has body: ive been looking in about for this exact script for a while and i cant get it to work. Im looking to use a fade in effect from left to right word by word. For example Lorem ipsum dolor sit amet, ne mel vero impetus voluptatibus I want this to fade in then enough line to fade in word by word slightly later using a delay. My current fade in works but it does it by the full container it looks like this .reveal { position: relative; overflow: hidden; } /*initial - hidden*/ .reveal .reveal__cover { position: absolute; top: 0; left: -250px; height: 100%; margin: 2px; width: calc(100% + 250px); } .reveal .reveal__cover.reveal__uncovered { position: absolute; top: 0; left: 100%; height: 100%; width: calc(100% + 250px); margin: 2px; transition: left 2500ms ease-out 0ms; } .reveal__cover-section { height: 100%; float: right; /* NOTE: Background must match existing background */ /*background: #000;*/ background: #fff; width: 2%; } .reveal__10 { opacity: 0.1; } .reveal__20 { opacity: 0.2; } .reveal__30 { opacity: 0.3; } .reveal__40 { opacity: 0.4; } .reveal__50 { opacity: 0.5; } .reveal__60 { opacity: 0.6; } .reveal__70 { opacity: 0.7; } .reveal__80 { opacity: 0.8; } .reveal__90 { opacity: 0.9; } .reveal__100 { opacity: 1; width: 82%; } Then JS function replaceAllInstances(source, search, replacement) { var regex = new RegExp(search, "g"); var result = source.replace(regex, replacement); return result; } $.fn.isOnScreen = function (x, y) { if (x == null || typeof x == 'undefined') x = 1; if (y == null || typeof y == 'undefined') y = 1; var win = $(window); var viewport = { top: win.scrollTop(), left: win.scrollLeft() }; viewport.right = viewport.left + win.width(); viewport.bottom = viewport.top + win.height(); var height = this.outerHeight(); var width = this.outerWidth(); if (!width || !height) { return false; } var bounds = this.offset(); bounds.right = bounds.left + width; bounds.bottom = bounds.top + height; var visible = (!(viewport.right < bounds.left || viewport.left > …
type: Question
has comment: http://stackoverflow.com/comment/45727969
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28720942
has title: Jquery word for word fade in effect
upvote count: 3

http://stackoverflow.com/comment/45631938
comment on: http://stackoverflow.com/q/28668883
score: 3
type: QuestionComment
has text: Where is `openModal()` defined exactly? What do you *think* `this` refers to? Also: this doesn't sound like the angular way to approach this task.
type: Comment

http://stackoverflow.com/q/28680318
has comment: http://stackoverflow.com/comment/45653573
score: 0
answer count: 2
has title: jQuery - hide/show footer navigation by cursor position
accepted answer: http://stackoverflow.com/a/28681256
has body: What I'm trying to do is have a small navigation menu at the bottom of the window that only displays when the cursor position is near the bottom. I'm able to get it to show, but not hide again. I've tried mouseleave, mouseout and an if, but can't quite get it to work. Here's what I have until I get stuck: $(document).mousemove(function(e) { var cursorPosition = e.pageY - $(window).scrollTop(); var windowHeight = $(window).height() - 60; if (cursorPosition >= windowHeight) { $('#thumbnail-nav').animate({ bottom: '-20px' }, 500); } }); #thumbnail-nav { position: fixed; height: 110px; bottom: -150px; padding: 10px 15px; width: 50%; left: calc(50% - 25%); background: rgba(0, 0, 0, .8); border-radius: 5px 5px 0 0; display: -webkit-flex; display: flex; } #thumbnail-nav li { display: inline-block; text-align: center; -webkit-flex: 1; -ms-flex: 1; flex: 1; } Here is a fiddle. Could someone give me a little direction on this?
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28680765
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28680765
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28681256
type: Question

http://stackoverflow.com/a/28720340
type: Answer
has comment: http://stackoverflow.com/comment/45730415
has comment: http://stackoverflow.com/comment/45883442
score: 1
upvote count: 1
has body: After the form has been submitted correctly run the following code: header("Location :contact.php?msg=success"); This will redirect the user back to the contact form with an condition allowing for a message to be displayed. if($_REQUEST['msg']){ echo "Contact Form Submitted Successfully!!"; } If they hit refresh it will just bring up a successful message while displaying the contact form again. Update: if(mail($address, $e_subject, $msg, "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n")) { header("Location: contact.php?msg=success"); }else{ header("Location: contact.php?msg=error"); } Then for displaying: &lt;?php if($_REQUEST['msg']=="success"){ echo "Success Message Here."; }elseif($_REQUEST['msg']=="error"){ echo "Error Message Here." } &lt;!--form--&gt; &lt;form method="post" action="" id="myform"&gt;
downvote count: 0
has comment: http://stackoverflow.com/comment/45729297
has comment: http://stackoverflow.com/comment/45729025
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28720216
has comment: http://stackoverflow.com/comment/45813270
answers question: http://stackoverflow.com/q/28720216
has comment: http://stackoverflow.com/comment/45769073

http://stackoverflow.com/a/28625275
has comment: http://stackoverflow.com/comment/45553942
has comment: http://stackoverflow.com/comment/45552664
answers question: http://stackoverflow.com/q/28624739
downvote count: 1
upvote count: 5
has comment: http://stackoverflow.com/comment/45551720
has comment: http://stackoverflow.com/comment/118312708
has comment: http://stackoverflow.com/comment/45551561
type: Answer
has body: Do you have GPS-dongle connected to PC ? Or geolocation source is any wrong IP-geo tool or Wifi/Cell. You can't get your exact physical coordinates by IP-address. If you use WiFi network accuracy can be 5-50 meters, but you are using LAN. Geolocation by IP is very very inaccurate, it's normaly to get wrong city or country.
score: 4

http://stackoverflow.com/comment/45655583
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28681168
has text: This discussion ignores that likelihood that the OP's "many variables" solution has a better solution. While it's true that memory exhaustion or some technical limitation of the size of the Javascript source code is technically the answer, I'd like to ask the OP - what problem are you trying to solve here? What about your application makes you want to create a boatload of variables?

http://stackoverflow.com/comment/45745239
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28729342
has text: Thanks @bevada for suggestion, `angular.isDefined(input)` would be more angular way,
score: 0

http://stackoverflow.com/q/28730147
has title: Show JSON data in datatable
has comment: http://stackoverflow.com/comment/45746981
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: datatables
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45746834
type: Question
has comment: http://stackoverflow.com/comment/45747065
has comment: http://stackoverflow.com/comment/45746769
has comment: http://stackoverflow.com/comment/45746958
has body: First I have proper JSON data in format: {"data":[{"ID":1,"aktivnost":"prodaja","vrsta":"Kultura","artikl":"psenica","6":222,"jmere":"Kg","7":290,"porez":20,"dobavljac":"M. Milic","datum":"2014-04-24","datum_dospeca":"0000-00-00","8":288,"nacin_placanja":"gotovinsko","skladiste":"Novo skladiste","opis":"Prodaja robe bla bla bla"},{"ID":2,"aktivnost":"prodaja","vrsta":"kultura","artikl":"kukuruz","6":777,"jmere":"kom","7":8000,"porez":20,"dobavljac":"milence","datum":"2014-04-19","datum_dospeca":"0000-00-00","8":8000,"nacin_placanja":"gotovinsko","skladiste":"nn","opis":"opis"},{"ID":3,"aktivnost":"investicija","vrsta":"parcela","artikl":"Nad gred","6":1,"jmere":"kom","7":2300,"porez":20,"dobavljac":"Nebojsa B.","datum":"2014-04-04","datum_dospeca":"0000-00-00","8":1200,"nacin_placanja":"gotovinsko","skladiste":"","opis":"opis"}]} I have HTML: ID Datum Dospece Akt Vrsta Artikl Kolicina Iznos Placeno Nacin Kome Skl ID Datum Dospece Akt Vrsta Artikl Kolicina Iznos Placeno Nacin Kome Skl and I try to run dataTable with this Javascript code: $(document).ready(function() { drawVisualization(); }); function drawVisualization() { $('#example').dataTable({ "ajax": { "url": 'getfinansije.php', "type": 'POST', "dataSrc": function (json) { if(!json.data){ //$('#tmeh').hide(); json.data = []; } return json.data; }, "error": function (data){ console.log(data); } }, paging: false, //"dom":' <"search"f><"top"l>rt<"bottom"ip><"clear">', "oLanguage": { "sInfo": 'Ukupno _END_ transakcija.', "sInfoEmpty": 'Nema zabelezenih transakcija', "sEmptyTable": "Nema transakcija, dodajte klikom na dugme 'Dodaj kupoprodaju'.", }, "columns": [{ "data": "ID" }, { "data": "datum" }, { "data": "datum_dospeca" },{ "data": "aktivnost" }, { "data": "vrsta" }, { "data": "artikl" }, { "data": "6" }, { "data": "7" },{ "data": "8" }, { "data": "dobavljac" }, { "data": "nacin_placanja" }, { "data": "skladiste" }, { "data": "jmere" }, { "data": "porez" }, { "data": "opis" }, { "data": "akcija" } ], "fnFooterC…
tagged with: html-table

http://stackoverflow.com/comment/45783595
type: AnswerComment
has text: Great! I tried this and it works. Two questions: (1) what is "listOfPrograms" : JSON.stringify(listOfPrograms) actually doing? It is converting the array to JSON format... then what? (2) Why does listOfPrograms need to be in quotes? Also, it returns "[\"chrome\",\"firefox\"]" not as individual items but as characters. For example myArray[2] = "c". I would like to be able to pull each item "chrome" and "firefox" to do some manipulation.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28749866

http://stackoverflow.com/a/28634925
has comment: http://stackoverflow.com/comment/45570572
has body: You can replace your entire code block with these 2 lines, and they will do what you want: var r = Math.floor(Math.random() * 4) + 1; window.location.replace(r+".html"); Explanation: Your code is actually working. The problem is that the number returned by Math.random() is a random number between 0 and 1 (it might be 0.5544718541204929 ), and will almost NEVER be exactly 0.48 or 0.49, but will almost always be between those two numbers. A better solution would be: var r = Math.floor(Math.random() * 4) + 1; and then test if number is 1, 2, 3 or 4. Example: jsFiddle Demo //jsFiddle temporarily not saving fiddles var r = Math.floor(Math.random() * 4) + 1; if(r ==1) { alert("1.html"); }else if(r==2){ alert("2.html"); }else if(r==3){ alert("3.html"); }else{ alert("4.html"); } BUT there is no need for the entire IF block. Just do this: var r = Math.floor(Math.random() * 4) + 1; window.location.replace(r+".html"); //alert( r + ".html" ); In response to the this question, submitted as a comment: I want it to be page 1 and page 2 has is almost 50/50, and the last 2 is pretty rare This would give odds of 1% for cases 3 and 4. var r = Math.floor(Math.random() * 100) + 1; //return number between 1 and 100 if(r &lt;=48) { alert("1.html"); }else if(r&lt;=98){ alert("2.html"); }else if(r==99){ alert("3.html"); }else{ //r==100 alert("4.html"); } If you desire slightly larger odds: if(r &lt;=40) { //40% chance alert("1.html"); }else if(r&lt;=80){ //40% chance alert("2.html"); }else if(r&lt;=90){ //10% chance alert("3.html"); }else{ //r is between 91 and 100, 10% chance alert("4.html"); }
has comment: http://stackoverflow.com/comment/45571150
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45570407
type: Answer
accepted answer of: http://stackoverflow.com/q/28634771
upvote count: 3
answers question: http://stackoverflow.com/q/28634771
score: 3

http://stackoverflow.com/comment/45763063
comment on: http://stackoverflow.com/a/28739529
type: Comment
has text: i dont know it is correct or not. i want to generate alert onblure textbox. the value of textbox validate from my php unique function which is above mentioned, but it should be dynamic.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45658739
has text: There is no `e.click`
comment on: http://stackoverflow.com/q/28682906
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45495339
type: Comment
comment on: http://stackoverflow.com/a/28594161
has text: @jfriend00 - I took 'how can we check a variable if it's not already declared?' to mean exactly that, as in, how does this actually work when we haven't actually done anything with that variable yet
score: 0
type: AnswerComment

http://stackoverflow.com/a/28684184
upvote count: 1
answers question: http://stackoverflow.com/q/28683910
has comment: http://stackoverflow.com/comment/45661188
downvote count: 0
has body: Assign different classes to your li elements like this: test 1 test 2 test 2 Note, that I closed your li and ul tags to have valid HTML. And then you can select an element with its own class: console.log($(".testClass2").attr("data-associateid")); I created a JSFiddle for you: http://jsfiddle.net/8rLpbk5m/
has comment: http://stackoverflow.com/comment/45663048
type: Answer
score: 1

http://stackoverflow.com/q/28725711
duplicate of: http://stackoverflow.com/q/20279484
answer count: 0
type: UnansweredQuestion
has body: I have the following code: var tradingInterface = function() { this.json = ''; this.init = function() { $.get( '/whatever',{}, function(data) { this.json = data; // Rebuilds Everything this.rebuildAll(); }); }; this.rebuildAll = function() { //whatever here }; }; Why am I getting in init function the following error? ReferenceError: this.rebuildAll is not defined this.rebuildAll(); Why can I access to this.json without scoping problems but not to this.rebuildAll? Regards,
has comment: http://stackoverflow.com/comment/45738000
has title: Javascript scope issue with objects
has comment: http://stackoverflow.com/comment/45737921
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/20279484
score: 0

http://stackoverflow.com/comment/45724286
score: 0
type: Comment
has text: No luck. returning this error ` (CONTENT_SCRIPT context for mpkijihfidfkhjdiomjeajfegbbdiide) try_catch has no message{TypeError: Cannot read property 'impl' of undefined at extensions::messaging:184:25} `
comment on: http://stackoverflow.com/a/28717455
type: AnswerComment

http://stackoverflow.com/a/28740564
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28740265
accepted answer of: http://stackoverflow.com/q/28740265
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45764721
downvote count: 0
has body: You should rename your function to audioHandler() for example which will handle whether to play or pause your audio. Create a boolean to remember if your audio was playing or was on pause. //initial status: audio is not playing var status = false; var audio = document.getElementById("myaudio"); function audioHandler(){ if(status == false || audio.paused){ audio.play(); status = true; }else{ audio.pause(); status = false; } }

http://stackoverflow.com/q/28605721
has answer: http://stackoverflow.com/a/28695284
has comment: http://stackoverflow.com/comment/45583114
tagged with: polymer
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/45588518
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28607697
downvote count: 0
tagged with: javascript
has body: I've noticed that two way binding only works when the expression is only the variable name itself (e.g., {{value}}). The two way binding breaks if the expression needs to act on the value, (e.g., {{value*5}}). Is this a limitation in Polymer, are there any workarounds for the use case of many values needing to be derived from an expression? Clicking the +/- buttons should increment all 3 numbers at the same time. {{value}} + - Hue: {{hue}} First: (this one works) Second: (this one does not work) http://plnkr.co/edit/KjQ9DusaFg2jp1BTFUde?p=preview Thanks for the help.
has comment: http://stackoverflow.com/comment/45581972
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/45520307
has title: Is two way binding with an attribute expression possible in Polymer?
type: UnansweredQuestion

http://stackoverflow.com/comment/45538582
comment on: http://stackoverflow.com/q/28593718
score: 0
type: Comment
has text: npm install -g protractor@1.6.1
type: QuestionComment

http://stackoverflow.com/comment/71895898
comment on: http://stackoverflow.com/a/42099859
type: Comment
has text: you sir, deserve a cookie. Thanks for your excelent explanation it solved my problem and ended two hours of searching!
type: AnswerComment
score: 0

alias
tags question: http://stackoverflow.com/q/28699913
type: Tag
tag name: alias

http://stackoverflow.com/comment/45751925
score: 0
type: Comment
type: QuestionComment
has text: I tried it in jsfiddle and it works just fine
comment on: http://stackoverflow.com/q/28733123

http://stackoverflow.com/a/28756459
upvote count: 3
has comment: http://stackoverflow.com/comment/45839613
has comment: http://stackoverflow.com/comment/45842165
has comment: http://stackoverflow.com/comment/45841923
type: Answer
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/28748792
has comment: http://stackoverflow.com/comment/45849635
has comment: http://stackoverflow.com/comment/46053552
has comment: http://stackoverflow.com/comment/45812587
has body: This (core idea minus details) passes your JSBin test: var consume = request .zip(abort.merge(produce), (r,x) =&gt; [r,x]) .filter(([r,x]) =&gt; isNotAbort(x)) .map(([r,p]) =&gt; p); And the JSBin code.

http://stackoverflow.com/comment/45732768
comment on: http://stackoverflow.com/q/28722979
type: Comment
type: QuestionComment
score: 1
has text: Have you tried taking a look at the jQuery source to see what it does behind the scenes?

http://stackoverflow.com/comment/45673917
type: Comment
type: QuestionComment
has text: [Console function](https://developer.mozilla.org/en-US/docs/Web/API/Console) will help you to start with... It has many tools to debug, profile, test, timing... Of course, this is a start, but if you find out `how they work`, I think you will be in the right direction to your objective.
comment on: http://stackoverflow.com/q/28689484
score: 0

http://stackoverflow.com/comment/82864729
type: AnswerComment
type: Comment
has text: This actually works, better than the answer flagged as correct. Thanks!
comment on: http://stackoverflow.com/a/28741819
score: 3

http://stackoverflow.com/comment/45767560
type: Comment
comment on: http://stackoverflow.com/q/28723939
type: QuestionComment
has text: I came across [this post](http://stackoverflow.com/questions/14650716/deallocating-object3d) which suggests to rather use `if (child.geometry !== undefined) {` instead of `if (child instanceof THREE.Mesh) {` as I do. When I do though, the commands get executed even after the geometry has been disposed beforehand. I check this by putting an `alert` function inside the if statement. I suppose this means the geometry still does not get disposed of correctly…
score: 0

http://stackoverflow.com/a/28621840
answers question: http://stackoverflow.com/q/28621688
has body: Make change in ajax call success function as follows: success: function(output){ $('#resultip').val(output); $('#MySelect option[value='+output+']').attr('selected','selected'); }
score: 0
type: Answer

http://stackoverflow.com/a/28727360
has comment: http://stackoverflow.com/comment/45741539
answers question: http://stackoverflow.com/q/28727173
has comment: http://stackoverflow.com/comment/45744652
type: Answer
has comment: http://stackoverflow.com/comment/45757944
has comment: http://stackoverflow.com/comment/45741616
has body: Do you mean: $stateProvider .state('index', { url: "/login", views: { "viewA": { templateUrl: "login.html", // THIS ? controller: "LoginController" } } }) }) Also remember to remove the ng-controller attribute from the view.
has comment: http://stackoverflow.com/comment/45753539
has comment: http://stackoverflow.com/comment/45755160
has comment: http://stackoverflow.com/comment/45742182
has comment: http://stackoverflow.com/comment/45741725
has comment: http://stackoverflow.com/comment/45741630
has comment: http://stackoverflow.com/comment/45744268
score: 0
has comment: http://stackoverflow.com/comment/45753397

http://stackoverflow.com/q/28707565
has comment: http://stackoverflow.com/comment/45706070
type: UnansweredQuestion
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45754572
type: Question
tagged with: fullcalendar
has comment: http://stackoverflow.com/comment/45774041
has body: To better understand my question, take a look at the JSFiddle Example. Basically there are tree kinds of unique items on the calendar that are all day events: Today, Completed, and Incomplete days. I need to figure a way to populate days that don't have anything on them (Today, or Incomplete), in this case they would be populated with "Completed". How can I figure out what these days are? Also any way to limit the calendar to a set months range? For instance Quarter 1 would be Dec 1st to Mar 31st. //Calendar $(document).ready(function() { // Figure out todays date and provide link to enter data var date = new Date(); var d = date.getDate(); var m = date.getMonth(); var y = date.getFullYear(); // Staff Data Calendar $('#calendar-staff').fullCalendar({ header: { left: '', center: 'title', }, businessHours: true, // display business hours handleWindowResize: true, // responsive layout editable: false, events: [ // red areas where no events can be dropped { title: 'No Data', start: '2015-02-03', url: '#', color: '#E64C65' }, { title: 'No Data', start: '2015-02-17', url: '#', color: '#E64C65' }, { // Display Today title: 'Enter Data for Today', url: 'staffing_data_edit.html', color: '#5E9EF3', start: new Date(y, m, d) } ] }); });
has comment: http://stackoverflow.com/comment/45718381
answer count: 1
downvote count: 0
has title: Add event to every day if the day is empty
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/53006803

http://stackoverflow.com/a/28613542
upvote count: 1
answers question: http://stackoverflow.com/q/28613452
type: Answer
has comment: http://stackoverflow.com/comment/45531022
downvote count: 0
has body: You have a typo in "url_aoi" declaration, should be "url_api" EDIT Look this: $.ajax({ type : "POST", url : req_url, data : {'page_url':url_api}, success : function(a) { location.reload(true); } }); Note the data is sent as object, so that way $_POST should work!!! EDIT 2 Are you using jQuery, if so then replace $.ajax with: $.post( req_url, {'page_url':url_api}, function(a){ location.reload(true); }); Also i have edited my previous edit, too weird you say it is not working, as i do a lot of ajax that way.
score: 1

http://stackoverflow.com/comment/45717124
type: AnswerComment
comment on: http://stackoverflow.com/a/28713223
has text: hey @Utkarsh i havent downvoted you it was some one else !!! and i dont even have that reputation to upvote you so soorry!
type: Comment
score: 0

http://stackoverflow.com/comment/45715513
type: Comment
has text: how to write dropdownlist 1.selectedvalue.tostring() in mvc??
comment on: http://stackoverflow.com/a/28713223
type: AnswerComment
score: 0

http://stackoverflow.com/q/28687937
has answer: http://stackoverflow.com/a/28688046
tagged with: ruby-on-rails
tagged with: javascript
type: Question
score: 0
answer count: 1
has title: w3cjs validate html file
type: UnansweredQuestion
has body: I have a Ruby on Rails project that need to use w3cjs lib. The lib is in link below https://www.npmjs.com/package/w3cjs Anyone can help me to add the lib into project by manual because i can not find out any gem for this lib. I need validate html file/html string that accords w3c standard. I am using RoR. Are there any client lib/gem (not use ruby code, just javascript) can do this. Thanks all,

http://stackoverflow.com/a/28676035
has comment: http://stackoverflow.com/comment/92986250
has comment: http://stackoverflow.com/comment/84759823
answers question: http://stackoverflow.com/q/28674946
has comment: http://stackoverflow.com/comment/81105403
type: AcceptedAnswer
upvote count: 206
has body: Google has a call back option for when the checkbox is checked. Add this to your form element: data-callback="XXX" Example: And a disable attribute to your submit button. Example: Submit Then a create a callback function and write whatever code you need. Example: function recaptchaCallback() { $('#submitBtn').removeAttr('disabled'); };
has comment: http://stackoverflow.com/comment/70628377
type: Answer
has comment: http://stackoverflow.com/comment/80646184
has comment: http://stackoverflow.com/comment/116528696
has comment: http://stackoverflow.com/comment/77010262
downvote count: 1
score: 205
has comment: http://stackoverflow.com/comment/94587717
has comment: http://stackoverflow.com/comment/70637856
has comment: http://stackoverflow.com/comment/76242987
has comment: http://stackoverflow.com/comment/116544621
accepted answer of: http://stackoverflow.com/q/28674946

http://stackoverflow.com/q/28724776
answer count: 5
has answer: http://stackoverflow.com/a/28725010
has comment: http://stackoverflow.com/comment/45737465
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28725672
tagged with: slider
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45737727
has comment: http://stackoverflow.com/comment/45736935
score: 0
has comment: http://stackoverflow.com/comment/45736489
has comment: http://stackoverflow.com/comment/45737513
type: Question
has answer: http://stackoverflow.com/a/28725291
has body: I'm trying to increase a javascript variable with a button but it's not working. This is my code - + Prev Next Thank you.
tagged with: javascript
has answer: http://stackoverflow.com/a/28725267
has title: Increase javascript variable with html button
tagged with: jquery
has answer: http://stackoverflow.com/a/28725230

http://stackoverflow.com/q/28743442
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45769813
has title: Angular nested state has to use $scope.parent from same controller, why?
type: Question
has comment: http://stackoverflow.com/comment/45769907
has body: I have a table, which loops over a scope called $scope.sites. I'm submitting a form which saves a new site to a DB, and then adds to the site scope. However, when I update $scope.sites, it doesn't update the table. The table is under the same SiteCtrl controller. The scope is definitely being appended to, as if I output {{ sites.length }} after the form has posted, its value increases (and the data appears in the DB). If I add {{ sites.length }} to the same part that the form is included (in the ui-view) it updates, outside of that and it doesn't. Here's some of the code: The Javascript Note, I'm using ui-router for nested states. myApp.config(function($stateProvider, $urlRouterProvider){ // The default route $urlRouterProvider.otherwise('/home'); $stateProvider .state('home', { url: '/home', templateUrl: 'app/partials/welcome.html', controller: 'WelcomeCtrl' }) .state('entity', { url: '/entity/:id', params: { id: "" }, templateUrl: 'app/partials/entity/index.html', controller: 'EntityCtrl' }) .state('entity.site', { url: '/site', templateUrl: 'app/partials/site/index.html', controller: 'SiteCtrl' }) .state('entity.site.create', { url: '/create', templateUrl: 'app/partials/site/create.html', controller: 'SiteCtrl' }) .... myApp.controller('SiteCtrl', ['$scope', '$http', '$stateParams', function($scope, $http, $stateParams) { $scope.entity_id = $stateParams.id; $scope.site_uuid = $stateParams.siteuuid; $scope.sites = {}; $scope.site = {}; $scope.errors = {}; $scope.result = {}; $scope.formData = {}; $http({ method: 'GET', url: 'siteurl' }). success(function (data, status, headers, config) { $scope.sites= data.data; }). error(function (data, status, headers, config) { console.log(data.result); console.log(data.code); }); $scope.submitForm = function() { $http.post('submiturl', $scope.formData).success(function(data) { //Clear the form $scope.formData = {}; $scope.site = data.data; $scope.sites.push($scope.site); }).error(function(data){ $scope.errors = data; }); } }])…
tagged with: javascript
score: 0
tagged with: angularjs
tagged with: angularjs-ng-repeat
answer count: 0

http://stackoverflow.com/comment/45732553
type: QuestionComment
has text: Without the exports line, the page stops working and I see errors such as "Failed to load resource: the server responded with a status of 404 (Not Found)", "Uncaught Error: Script error for: a.template"
comment on: http://stackoverflow.com/q/28716438
score: 0
type: Comment

http://stackoverflow.com/comment/45559898
type: AnswerComment
comment on: http://stackoverflow.com/a/28628769
score: 0
type: Comment
has text: wow - that was more complicated than I thought - see most recent edit for new jsFiddle

http://stackoverflow.com/comment/45691990
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28699691
has text: this is the initial https://jsfiddle.net/805ewv19/2/
score: 0

acrobat
type: Tag
tags question: http://stackoverflow.com/q/28710210
tags question: http://stackoverflow.com/q/28601350
tag name: acrobat

http://stackoverflow.com/a/28673712
accepted answer of: http://stackoverflow.com/q/28624707
type: Answer
has comment: http://stackoverflow.com/comment/45868020
answers question: http://stackoverflow.com/q/28624707
has comment: http://stackoverflow.com/comment/45642752
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45642410
has comment: http://stackoverflow.com/comment/45871197
has comment: http://stackoverflow.com/comment/45642192
has comment: http://stackoverflow.com/comment/45641679
has comment: http://stackoverflow.com/comment/45867935
has comment: http://stackoverflow.com/comment/45641927
has body: Here is a simple algorithm that should do quite efficiently, using a map from filepaths to their ids: var idcount = 0; var treeJSON = []; var idmap = {}; function add(dirs) { if (!dirs.length) return "#"; var name = dirs.join("/"); if (name in idmap) return idmap[name]; var dir = dirs.pop(); var parent = add(dirs); var id = "ajson" + ++idcount; treeJSON.push({id: id, parent: parent, text: dir}); return idmap[name] = id; } var files = e.target.files; // FileList for (var i=0; i&lt;files.length; ++i) { var name = files[i].webkitRelativePath; add(name.split("/")); } return treeJSON; (updated jsfiddle demo) This is how you might use it for dynamic updates: // initalise JStree here var idcount = 0; var treeJSON = []; var idmap = {}; function add(dirs, isfolder) { if (!dirs.length) return "#"; var name = dirs.join("/"); if (name in idmap) { if (isfolder &amp;&amp; idmap[name].icon) delete idmap[name].icon; return idmap[name]; } var dir = dirs.pop(); var parent = add(dirs, true); var id = "ajson" + ++idcount; var item = {id: id, parent: parent, text: dir} if (parent == "#") item.state = {opened:true, selected:true}; if (!isfolder &amp;&amp; dir.indexOf(".") &gt; 0) item.icon = fileICON; treeJSON.push(item); return idmap[name] = id; } input.onchange = function(e) { var files = e.target.files; // FileList for (var i=0; i&lt;files.length; ++i) { var name = files[i].webkitRelativePath; add(name.split("/"), false); } // refresh JStree };
has comment: http://stackoverflow.com/comment/45872986
has comment: http://stackoverflow.com/comment/45642809
has comment: http://stackoverflow.com/comment/45642713
has comment: http://stackoverflow.com/comment/45642736
has comment: http://stackoverflow.com/comment/45668978
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45641898
has comment: http://stackoverflow.com/comment/45642664

http://stackoverflow.com/a/28647165
answers question: http://stackoverflow.com/q/28647067
has body: You're using Ssls.list() with a callback inside your controller, there is no need to return the $http promise from your service, however your main problem is that you're invoking the callback incorrectly. When you execute the callback in your service, you don't pass the data to it! Do this instead: list:function (page, callback) { $http.get("/api/getSsls/" + page).success(function(data){ callback(data); }); }
score: 1
has comment: http://stackoverflow.com/comment/45602652
has comment: http://stackoverflow.com/comment/45599899
upvote count: 1
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28647067
downvote count: 0

http://stackoverflow.com/a/33695525
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28687940
has body: Try to put your ul inside a div

http://stackoverflow.com/comment/45833811
comment on: http://stackoverflow.com/a/28614084
has text: I pulled all html/javascript code into my answer. Could you please copy it and run it again? Thanks.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45501078
score: 2
type: AnswerComment
has text: I was going to suggest to him that he set b.style.top = "-" + a.offsetHeight + "px"; but I like the use of -Math.abs().
comment on: http://stackoverflow.com/a/28597291
type: Comment

http://stackoverflow.com/comment/45776976
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28747230
has text: @SteamDev why down vote, this is not exact answer as i don't know image url also i don't know image id so i written in start that i am supposing Img1 as id
type: Comment

http://stackoverflow.com/q/28662326
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/28662393
type: Question
has title: Odd CSS/div spacing issue with simple page
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28662393
has body: I have the following page: HTML: XXXX CSS: body {padding: 0; margin: 0; overflow: hidden; font-family: Helvetica;} .box { background-color: #FFFFFF; height:200px; width: 700px; border-top-style:solid; border-top-width: 2px; border-top-color: #EEEEEE; display: inline-block; } .spacer { background-color: #FFFFFF; height:40px; } .colorbox{ display: inline-block; height:120px; width:120px; border:1px solid #000; background-color:blue; } #message{ margin:5px; } JS Fiddle: http://jsfiddle.net/qtv4c10o/5/ I would like to be able to delete the XXX text without moving the line in that border box, but unfortunately that's not working. When I remove it the line moves to look like this: http://jsfiddle.net/qtv4c10o/6/ I am eventually going to be updating the XXX text using javascript and don't want the border line to move as well.
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
tagged with: css
type: AnsweredQuestion

http://stackoverflow.com/a/46120302
type: AcceptedAnswer
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28672505
accepted answer of: http://stackoverflow.com/q/28672505
has body: This behaviour has been caused by the changes to how Chrome treats enumerable properties of objects. Because Chrome updates silently, it's impossible to notice. It must have been causing me a lot of headache if I remembered the cause after all this time... (Also it's embarrassing how bad I was at writing questions, but I guess that I realise it means I have progressed since then somewhat).

http://stackoverflow.com/comment/45745398
score: 0
has text: few people use iframes for single page applications, ajax is the norm and typically done without modals. no idea whare idea that modals don't support remote content comes from though
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28729259

http://stackoverflow.com/comment/45533406
has text: I could point it to a free page like Tumblr or Blogger. However there is not much point in me doing that if I wish not to use the domain anymore.
type: Comment
comment on: http://stackoverflow.com/a/28611285
score: 0
type: AnswerComment

http://stackoverflow.com/q/28606222
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28606789
has comment: http://stackoverflow.com/comment/45517396
favorite count: 0
has comment: http://stackoverflow.com/comment/45516865
has answer: http://stackoverflow.com/a/28606360
tagged with: angularjs
has body: in every my controller i have such code, which i execute when i click on some link in view: $scope.logout = function() { authenticationService.logout(); $scope.isAuthUser = false; delete $localStorage.selectedModel; $location.path('/login').search('key', null); }; i'm new to angularJS and want to know: how is it better to do: to put logic in service or to put logic in directive? with directive: i know how to use controllers: $scope.isAuth = false; - with service: i didn't know hot to use it, except to write it as now in every controller, that it would be something like: $scope.logout = function() { authenticationService.logout(); myNewService.logout(); $scope.isAuthUser = false; }; view: Sign Out but seems that it is bad too... how is it right to do?
has comment: http://stackoverflow.com/comment/45516799
has comment: http://stackoverflow.com/comment/45516757
possible better answer: http://stackoverflow.com/a/28606360
type: AnsweredQuestion
score: 3
upvote count: 3
has title: angularJS: where is better to put signOut logic?
has comment: http://stackoverflow.com/comment/45517261
has answer: http://stackoverflow.com/a/28606789

http://stackoverflow.com/comment/45531726
has text: Well first issue is it is a cross domain call so JavaScript in the browser is not going to be able to fetch it.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28614194
score: 1

http://stackoverflow.com/q/28725431
has comment: http://stackoverflow.com/comment/45737827
favorite count: 0
has title: How to add transition effect in javascript?
has answer: http://stackoverflow.com/a/28732671
has comment: http://stackoverflow.com/comment/45737495
has comment: http://stackoverflow.com/comment/45737625
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45738171
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45737698
tagged with: css
upvote count: 0
has comment: http://stackoverflow.com/comment/45737514
has body: I want to add transition effect to my code. When error css appear it should be added transition but I could not apply it. I know how to add transition when hovering but I don't know how to this kind of situation? Here is my css .error{ width:300px; height:100px; background: red; -webkit-transition:all linear 0.5s; transition:all linear 0.5s; } Html userType: err Fiddle http://jsfiddle.net/8atm9bdb/1/
has comment: http://stackoverflow.com/comment/45737691
type: Question
has comment: http://stackoverflow.com/comment/45738276
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45737890
has comment: http://stackoverflow.com/comment/45738220
answer count: 1
downvote count: 1

http://stackoverflow.com/q/28646980
has title: Simulate different locale in JavaScript for type conversions?
has comment: http://stackoverflow.com/comment/45591636
has comment: http://stackoverflow.com/comment/45602030
has comment: http://stackoverflow.com/comment/45624266
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45601248
linked to: http://stackoverflow.com/q/934175
tagged with: locale
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28664070
score: 0
favorite count: 0
has body: Is there some way to simulate a different locale in JavaScript? Preferably without altering code (like a tool, perhaps part of a debugging tool letting me alter it). I am especially thinking of conversions between strings and floats. If I want to test a particular language, is it enough to install a browser using it? Or does it also depend on OS, or are browsers not consistent.
has comment: http://stackoverflow.com/comment/45622044
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/comment/45642603
type: AnswerComment
has text: @CayceK is truely right, to enable cross version compatibility, you need to use `.onclick = function() { /* process */ }`, and if this is an excercice you should not use `.addEventListener()` if it is not the aim.
comment on: http://stackoverflow.com/a/28674533
score: 0
type: Comment

http://stackoverflow.com/comment/45620437
type: AnswerComment
comment on: http://stackoverflow.com/a/28647235
type: Comment
has text: Yes -- that's exactly what I was after. II only have one file and it's already compressed but the 'createObjectUrlFromBlob' looks like exactly what I was after! Thanks!
score: 0

http://stackoverflow.com/q/28681691
has comment: http://stackoverflow.com/comment/45658006
type: Question
has comment: http://stackoverflow.com/comment/45656811
score: 1
has body: From database I get data in format like (let's suppose it's a string) 1974-07-05 How I need to pass the date in form with datepicker and make the date active there, so how can I do it? &lt;td&gt; &lt;script src="javascript/datepicker.js"&gt;&lt;/script&gt; &lt;input id="datepicker" type="text" name="dob" value="${person.bdate}"&gt; &lt;/td&gt; and ${person.bdate} is a string date
has comment: http://stackoverflow.com/comment/45656958
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45656618
tagged with: datepicker
has title: How fill up the datepicker form with string date?
has answer: http://stackoverflow.com/a/28682015
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/comment/45691387
comment on: http://stackoverflow.com/a/28700480
has text: But how about if the emit failed? For example, the server is closed when the client emit the msg to it, then the client won't receive any msg from the server because the server is not working.
score: 10
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28728298
answers question: http://stackoverflow.com/q/28727472
has comment: http://stackoverflow.com/comment/45746400
type: AcceptedAnswer
upvote count: 3
has comment: http://stackoverflow.com/comment/45746602
has body: The filter_function selector needs to match the column header class. In this example, we set the header class to "english" &lt;th class="english"&gt;English&lt;/th&gt; Add an external select (include an option value attribute because IE won't work otherwise); a data-column attribute is also required. English Scores: &lt;select class="search" data-column="3"&gt; &lt;option value=""&gt;All&lt;/option&gt; &lt;option value="less-than-50"&gt;&amp;lt; 50&lt;/option&gt; &lt;option value="between 50 &amp; 90"&gt;50 to 90&lt;/option&gt; &lt;option value="greater than 90"&gt;&amp;gt; 90&lt;/option&gt; &lt;/select&gt; Then set up the filter_functions to target the header class name, and include keys that match the option values: $(function () { $('table').tablesorter({ theme: 'blue', widgets: ['zebra', 'filter'], widgetOptions: { filter_columnFilters: false, filter_external: '.search', filter_functions : { '.english' : { 'less-than-50' : function(e, n) { return n &lt; 50; }, 'between 50 &amp; 90' : function(e, n) { return n &gt;= 50 &amp;&amp; n &lt;= 90; }, 'greater than 90' : function(e, n) { return n &gt; 90; } } } } }); });
has comment: http://stackoverflow.com/comment/45746295
has comment: http://stackoverflow.com/comment/45744382
type: Answer
has comment: http://stackoverflow.com/comment/45749007
accepted answer of: http://stackoverflow.com/q/28727472
score: 3
downvote count: 0

http://stackoverflow.com/comment/45674941
comment on: http://stackoverflow.com/q/28691146
score: 0
type: Comment
type: QuestionComment
has text: Perhaps a JSFiddle would be beneficial ?

http://stackoverflow.com/q/28746132
score: 0
has title: JavaScript window not opening on New server
tagged with: asp.net
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28771347
has comment: http://stackoverflow.com/comment/45775614
has comment: http://stackoverflow.com/comment/45821140
type: Question
has body: I have a Master page web application. In that application I have the need for a popup window to open displaying several links. The window should open when the user selects a value from a drop down list. Both the below methods work fine when running the site locally in VS2010 and on the Dev server. When moving to the UAT server it no longer fires and give no error. If I replace the web config file on UAT with the one from Dev it fires correctly. However when I update the web config file so it directs the connection strings to the UAT server it breaks. I have tried the below methods; This is code used in other parts of the site and continues to work correctly protected void ddCFPBCategories_SelectedIndexChanged(object sender, EventArgs e) { if (this.ddCFPBCategories.SelectedValue.ToString() == "3rd Party Bad Phone") { String csname1 = "myWindow"; System.Text.StringBuilder sb = new System.Text.StringBuilder("var winRef = window.open('BadPhone.aspx',null,'width=900,height=400, status=yes, resizeable=no, scrollbars=no,menubar=no');"); Type cType = this.GetType(); if (!Page.ClientScript.IsStartupScriptRegistered(cType, csname1)) { this.Page.ClientScript.RegisterStartupScript(cType, csname1, sb.ToString(), true); } } } Here I try to use javascript onchange this is in the &lt;asp:DropDownList ID="ddCFPBCategories" runat="server" DataSourceID="ComplaintType" DataTextField="Descriptoin" DataValueField="Descriptoin" onchange="javascript:dypopup(this,'3rd Party Bad Phone','BadPhone.aspx',700,300,'yes','no','no','no')" &gt; &lt;/asp:DropDownList&gt; This is in the Site.master: &lt;script type="text/javascript" src="../jquery-1.6.1.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function dypopup(ddl,testvalue,url,w,h,status,resize,scroll,menu) { if (ddl.value == testvalue) { window.open(url, null, 'width='+ w +',height='+ h +', status='+ status +', resizeable=' + resize +', scrollbars=' + scroll +',menubar=' + menu +"'") } }
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/28631290
type: Question
has comment: http://stackoverflow.com/comment/45562605
has body: My url mapping works great using angular ng-route module, until I hit refresh. Then I get a 404 error. I am using plain html on python SimpleHTTPServer directory Tree . └── test1 ├── html └── static ├── css └── js server is run inside test1 directory all html files inside html folder routing is done inside app.js var eclassApp = angular.module('eclassApp', ['ngRoute', 'eclassControllers' ] ); eclassApp.config(['$routeProvider','$locationProvider', function ($routeProvider, $locationProvider){ $routeProvider. when('/',{ templateUrl: '/html/student-list.html', controller: 'StudentsListCtrl', }). when('/students/:studentId',{ templateUrl: '/html/student-details.html', controller: 'StudentDetailsCtrl', }).otherwise({ redirectTo: '/' }); $locationProvider.html5Mode({ enabled:true }); }] ); I can navigate to my urls from within the app but when on a page and refresing I get a 404 error. Moving back (history) i get the same error. Why is that? Is it because I don't use the hash symbol?
has comment: http://stackoverflow.com/comment/45562708
has title: Refreshing Angular RouteProvider route causes a 404 error with Python
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: angularjs
favorite count: 0
type: UnansweredQuestion
upvote count: 1
score: 1
has answer: http://stackoverflow.com/a/28631580

http://stackoverflow.com/a/28703370
answers question: http://stackoverflow.com/q/28695814
type: Answer
upvote count: 4
downvote count: 0
score: 4
has body: Logging only shows error-level logs. You'd need to do: browser.executeScript("console.error('test')");
accepted answer of: http://stackoverflow.com/q/28695814
type: AcceptedAnswer

http://stackoverflow.com/comment/45597651
type: QuestionComment
has text: well the error message is *Cannot assign to read only property 'Apple' of true*
score: 0
comment on: http://stackoverflow.com/q/28650045
type: Comment

http://stackoverflow.com/comment/45562145
type: QuestionComment
score: 0
has text: @halfer yes it's a website.
type: Comment
comment on: http://stackoverflow.com/q/28631034

http://stackoverflow.com/a/28609009
score: 6
type: Answer
has body: Ok, here we go: Based on Lars' comment, we can specify event handler for mousewheel event. As shown in the answer, we start by mapping wheel.zoom event to a custom handler pan selection.call(zoomer) .on("wheel.zoom",pan) // handler function for mousewheel zoom Second, we need to define the pan gesture, which is basically a translate in x and/or y direction. function pan() { svg.attr("transform", "translate(" + [dx,dy] + ")"); } We also need to quantify the movement in both directions, and relate it to mousewheel movement. By inspecting the details of MouseWheel event, we find two useful attributes deltaX and deltaY, indicating how much the mousewheel moved in each direction. The final pan function is as follows function pan() { current_translate = d3.transform(svg.attr("transform")).translate; dx = d3.event.wheelDeltaX + current_translate[0]; dy = d3.event.wheelDeltaY + current_translate[1]; svg.attr("transform", "translate(" + [dx,dy] + ")"); d3.event.stopPropagation(); } Here is a working fiddle and bl.ock also modifying Mike's geometric zoom example. Cross-browser support: It seems that mousewheel events differs between browsers. For Safari and Firefox support, you need to add the following: selection.call(zoomer) .on("wheel.zoom",pan) .on("mousewheel.zoom", pan) .on("DOMMouseScroll.zoom", pan) Also, the interpretation of wheelDelta is reversed in Firefox. wheelDelta can be fixed by this function function crossWheelDelta() // cross-browser wheel delta var e = window.event || e; // old IE support return Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail))); }
answers question: http://stackoverflow.com/q/28603796
downvote count: 0
has comment: http://stackoverflow.com/comment/62388833
accepted answer of: http://stackoverflow.com/q/28603796
upvote count: 6
type: AcceptedAnswer

http://stackoverflow.com/comment/45649264
score: 0
comment on: http://stackoverflow.com/q/28675748
has text: put your code inside that checkDrink method you call from within the call back function.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45655206
comment on: http://stackoverflow.com/q/28680397
has text: Thanks, yes I'm aware that JS is generally not a good choice for time-sensitive applications. However, when working with the Web Audio API, getting timing as accurate as possible (given the circumstances) is important.
score: 0
type: Comment
type: QuestionComment

binary
tags question: http://stackoverflow.com/q/28623673
tags question: http://stackoverflow.com/q/28723751
tags question: http://stackoverflow.com/q/28714638
tag name: binary
type: Tag

http://stackoverflow.com/comment/45744197
has text: mmh, when I open your jsfiddle and check my console, I have `Uncaught SyntaxError: Unexpected identifier` and when I click on the line it shows me clearly the missing comma. Oh yeah and then a `no Module` error that is a side effect of the first one: always fix your errors in the order you get them.
comment on: http://stackoverflow.com/a/28728900
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/28601204
has answer: http://stackoverflow.com/a/28601241
type: Question
has title: How to access a JSON object in Javascript?
has answer: http://stackoverflow.com/a/28601249
tagged with: javascript
score: 4
upvote count: 4
answer count: 3
downvote count: 0
has body: How do i access the JSON object in javascript whena JSON object is something like this. {'':'my-first-Name'} The Name of the property is empty and i am not able to access it. Regards.
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28601249
possible better answer: http://stackoverflow.com/a/28601240
has answer: http://stackoverflow.com/a/28601240
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/q/28702990
tagged with: javascript
tagged with: lcov
favorite count: 0
has comment: http://stackoverflow.com/comment/45727721
has comment: http://stackoverflow.com/comment/45729218
type: Question
score: 3
has title: Sonarqube does not retrieve my JavaScript coverage from LCOV
accepted answer: http://stackoverflow.com/a/28722528
tagged with: code-coverage
upvote count: 3
has comment: http://stackoverflow.com/comment/45729410
linked to: http://stackoverflow.com/q/28806209
answer count: 1
tagged with: karma-coverage
tagged with: sonarqube
has body: I have an application with the following structure: my-application +- pom.xml +- app | +- scripts | | +- app.js | | +- **/*.js | +- 3rd-party-libs +- build +- node_modules +- test I've create the pom.xml only to run the SonarQube analysis. Otherwise, all the tasks are run by Grunt (tests are run with Karma). The content of the pom.xml is the following: <sonar.language>js</sonar.language> <sonar.sourceEncoding>UTF-8</sonar.sourceEncoding> <sonar.javascript.coveragePlugin>lcov</sonar.javascript.coveragePlugin> <sonar.javascript.lcov.reportPath>build/karma/coverage/lcov.info</sonar.javascript.lcov.reportPath> <sonar.exclusions>app/3rd-party-libs/**,node_modules/**</sonar.exclusions> <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis> app/scripts test When I run grunt test, it creates a build/karma/coverage/lcov.info that contains the following information: TN: SF:./app/scripts/app.js FN:16,(anonymous_1) FN:26,(anonymous_2) FNF:2 ... After the SonarQube analysis, the dashboard shows a 0% code coverage. I suspected that the path in the SF: was the source of the error. Thus, I've changed the sonar.javascript.lcov.reportPath property to use another lcov.info to test different values: app.js, ./app.js, app/scripts/app.js, ./app/scripts/app.js, but none worked, keeping the coverage to 0%. What I am missing? Just in case, I have the following configuration in my karma.conf.js: coverageReporter: { reporters: [ { type: 'lcov', dir: 'build/karma/coverage', subdir: '.' } ] }, ps: Sonar version is 3.7.2, but I also tried on a 4.3, with the same results... Edit: I've updated my configuration to use Sonar-runner directly, I'm using the latest version of Sonar (5.0.1) and JS plugin (2.3). I've also modified manually the lcov.info to have a "good" format (at least one format that matches the Sonar repo example): SF:./app/scripts/app.js DA:2,1 DA:20,1 DA:29,1 DA:34,1 end_of_record SF:./app/scripts/services/exampleService.js DA:1,1 DA:11,1 DA:12,0 end_of_record The sonar-project…
has answer: http://stackoverflow.com/a/28722528
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/45782792
comment on: http://stackoverflow.com/a/28750013
score: 0
type: AnswerComment
type: Comment
has text: Hmm.. Good point. Let me try writing the file synchronously and seeing if that makes a different

http://stackoverflow.com/q/28664573
tagged with: angularjs
has answer: http://stackoverflow.com/a/28664634
score: 2
possible better answer: http://stackoverflow.com/a/28664634
downvote count: 0
has body: I have to deal with an non angular library and need to create a comunication between them. &lt;div id="MoipWidget" data-token="{{personaltoken}}" callback-method-success="successCB" callback-method-error="errorCB"&gt;&lt;/div&gt; Every time that the page is loaded, I have to get a token from my server. $http.post('https://example.org', obj) .success(function(data){ $scope.personaltoken = data.token; //Here I call the non angular library and I get and error telling me that the token is undefined. //If I run the code from inside a $timeout works as I need... }) .error(function(data){ alert('error'); }); I've also tried to run inside $scope.$apply but I get an error telling that $digest already in progress The non angularjs library that I have to call is simple is just two lines. var settings = {} LibraryCall(settings); How can I update the model immediately?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28680820
accepted answer: http://stackoverflow.com/a/28680820
tagged with: javascript
tagged with: angularjs-scope
has answer: http://stackoverflow.com/a/28664942
type: Question
upvote count: 2
answer count: 3
has title: How to update $scope immediately when dealing with non angular code?
favorite count: 0

http://stackoverflow.com/a/28708454
answers question: http://stackoverflow.com/q/28707807
has comment: http://stackoverflow.com/comment/45706574
has comment: http://stackoverflow.com/comment/45706505
has body: You can just listen for the click event and you will get notified whenever the user changes the property, but not when it changes programmatically. I've tested this in Chrome and IE 9, 10, 11 and it works for a click on the checkbox, a click on the containing label and even a space bar to change the checkbox when it's focused. Working demo: http://jsfiddle.net/jfriend00/tdhpaqs8/ document.getElementById("test").addEventListener("click", function(e) { // checkbox was changed by the user });
downvote count: 0
has comment: http://stackoverflow.com/comment/45707093
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/45707921
upvote count: 1

http://stackoverflow.com/a/28598367
upvote count: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28595864
answers question: http://stackoverflow.com/q/28595864
score: 1
has comment: http://stackoverflow.com/comment/48928378
has body: You don't need localStorage plugin to use simple html localStorage.You can simply save and retrieve value without any plugin. For saving: localStorage.setItem("key",value); for retrieving: localStorage.getItem("key"); You can save upto 5mb per app with local storage. You can use web sql too. WEB SQL example link It also does not need any plugin. Then you can use a bit advanced SQL wrappers. This one needs plugin to be installed. Brodysoft SQLite with complete documentation

http://stackoverflow.com/comment/45694688
score: 3
comment on: http://stackoverflow.com/q/28702333
type: Comment
has text: Maybe it's just me, but one would think it would be pretty pertinent to show us where the `init` function is being called, not just the function ?
type: QuestionComment

http://stackoverflow.com/a/28728900
has body: You forgot some commas in your JSON definition. When angular fails to evaluate {{ curly brackets }}, be sure to check your dev console for errors. For instance: { name: 'XXX-1A' // &lt;-- here you don't have a comma (same for each item) brand: 'Brand A', material: 'tobacco', size: '00', type: 'water pipe', style: 'heady', feature: 'bent neck, coil condensor', percolator: 'dome', color: 'red' }, Also as pointed out by a comment, it should be {{p.name}} instead of {{name}} Here is a fixed fiddle: http://jsfiddle.net/a01g8wyp/
has comment: http://stackoverflow.com/comment/45744304
type: Answer
accepted answer of: http://stackoverflow.com/q/28728798
has comment: http://stackoverflow.com/comment/45744356
score: 1
has comment: http://stackoverflow.com/comment/45744138
has comment: http://stackoverflow.com/comment/45744318
upvote count: 1
has comment: http://stackoverflow.com/comment/45747105
answers question: http://stackoverflow.com/q/28728798
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45744197

http://stackoverflow.com/comment/45619621
type: QuestionComment
has text: Because you do `line = +" ";` instead of `line += " ";`
score: 2
comment on: http://stackoverflow.com/q/28662266
type: Comment

http://stackoverflow.com/a/28696333
answers question: http://stackoverflow.com/q/28695536
downvote count: 0
has body: var json_data = $.parseJSON(response); var table = $('&lt;table&gt;'); $.each(json_data,function(index,obj){ var tr = $('&lt;tr&gt;'); $.each(obj.Children,function(_index,_children){ var td = $('&lt;td&gt;'); $(td).text(_children.Name); $(tr).append(td); }) $('#records_table').append(tr); });
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/45713695
score: 0
comment on: http://stackoverflow.com/q/28694134
type: Comment
type: QuestionComment
has text: Here is the link : https://jsfiddle.net/92brs0qz/1/

http://stackoverflow.com/q/28617747
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28617833
downvote count: 0
answer count: 1
favorite count: 0
has title: How to resize div with CSS by the border
linked to: http://stackoverflow.com/q/8960193
tagged with: css
has body: How would I let a user resize a div? I would like them to be able to grab the side of it and pull it, I DO NOT want CSS Resize property. The Resize property makes the part you drag to make it bigger in the corner. So how would I let a user make a div bigger by grabbing the side?
upvote count: 6
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28617833
has comment: http://stackoverflow.com/comment/45538604
score: 6

http://stackoverflow.com/q/28704104
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/56177809
has comment: http://stackoverflow.com/comment/56178363
has comment: http://stackoverflow.com/comment/45699057
has body: i am new to jQuery and just learning . I can across the $.proxy function in jQuery and decided to make a small programme using it but my code's not working , heres the fiddle(the keyboard events seem to having an issue in the fiddle , don't know why !). now if instead of $(this) in the if else construct, I directly use $('body') . my code works (I.E. the body element turns red). also inside the function(e) if I console.log this , I get the html element , when instead the this should point to the $('body') . below is my Jquery code : $('body').on('keydown.bla.lalalal' , $.proxy(function(e) { if (e.which == 27) { $('body').addClass('red'); } else { $('body').removeClass('red'); } },this )); I was just digging a plugin code too and found a similar function : if (this.isShown &amp;&amp; this.options.keyboard) { this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) { e.which == 27 &amp;&amp; this.hide() }, this)) } else if (!this.isShown) { this.$element.off('keydown.dismiss.bs.modal') } I my syntax exactly almost matchs that of what I saw in that plugin code , but still my code , does't work , So what really am I missing ? I would appreciate any help or guidance.
has comment: http://stackoverflow.com/comment/45699193
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45698432
favorite count: 0
has comment: http://stackoverflow.com/comment/45698184
has title: issue with $.proxy function , this not being passed
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45699500
has comment: http://stackoverflow.com/comment/45699732
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/45698655

http://stackoverflow.com/q/28729797
tagged with: javascript
has comment: http://stackoverflow.com/comment/45745884
has comment: http://stackoverflow.com/comment/45745862
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28730404
has comment: http://stackoverflow.com/comment/45745860
has comment: http://stackoverflow.com/comment/45745861
has body: I could create an object with some methods, and later add a property to it as follows: var myObj = (function () { var my = {}; my.method1=function(){} my.method2=function(){} my.method3=function(){} return my; }()); myObj.myProperty=123; How could I create the object first and add a property, and then later add the methods afterwards? myObj={}; myObj.myProperty=123; //How do I add the above methods to myObj?
has title: Adding methods to an JavaScript object
has answer: http://stackoverflow.com/a/28729898
has comment: http://stackoverflow.com/comment/45745902
possible better answer: http://stackoverflow.com/a/28730044
type: AnsweredQuestion
tagged with: oop
has comment: http://stackoverflow.com/comment/45745933
has answer: http://stackoverflow.com/a/28730044
tagged with: methods
type: Question
tagged with: object
accepted answer: http://stackoverflow.com/a/28729898

http://stackoverflow.com/q/28675966
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28676113
upvote count: 3
has comment: http://stackoverflow.com/comment/45645357
downvote count: 1
type: Question
tagged with: javascript
has body: I'm facing an issue in nodejs when I try to execute and script file that I've created for testing purposes. I need to test it in my localhost (Windows OS) before I can implement webservice in webserver (Linux OS). I installed jsdom and jquery right after installing nodejs but still having the following message error: TypeError: Cannot read property 'document' of undefined This happened after I tried to rum this JS script named index.js: // Carrega a biblioteca HTTP do Node.js. var http = require('http'); var $ = require('jquery')(require("jsdom").jsdom().parentWindow); //var $ = require('jquery'); // Cria um serviço web para tratar a requisição de resposta da mensagem Hello World. var server = http.createServer(function (request, response) { // Define os parâmetros de cabeçalho de resposta. // usage response.writeHead(200, {'Content-Type': 'text/html'}); // Escreve uma mensagem de resposta do servidor. response.write(' Hello World '); // usage $("body").append(" TEST "); // Envia uma resposta para o cliente response.end(); }); // Define a porta e IP que serviço executado a aplicação. server.listen(3000); // Imprime mensagem no terminal do servidor. console.log('Servidor Node.js em execução.'); If It comment the following line, it gonna work without recognize jquery functions: var $ = require('jquery')(require("jsdom").jsdom().parentWindow); I need to use jquery with nodejs, but I've tried to google this problem but no success. Following bellow, there is an image in Command prompt when I rum node index.js: Is there anything else should I try to make node.js running successfully with jquery? If I need to post any further information, please, advise me. UPDATE I tried to rum the same script inside Node.js path from other Programmer's Computer. We faced another TypeError problem:
accepted answer: http://stackoverflow.com/a/28676113
answer count: 1
tagged with: jquery
favorite count: 0
has title: Node.js - TypeError: Cannot read property 'document' of undefined
has comment: http://stackoverflow.com/comment/45645309
tagged with: node.js

http://stackoverflow.com/q/28674866
has comment: http://stackoverflow.com/comment/45645273
tagged with: javascript
linked to: http://stackoverflow.com/q/21294790
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45642965
answer count: 0
tagged with: localization
type: Question
tagged with: sails.js
has title: Sails.js - how to add locale in url
score: 0
has body: I am just started with SailsJS. I added two locales to my app. I confirmed both worked. I would like to allow manual choice via url. Found this topic Sailsjs change localization and attempted second scenario implementation - adding api/policies/localize.js file and adding '*' : 'localize' to config/policies.js file. BTW - this is the only line in my policies.js file (all the rest are comments). However, when I type http://localhost:1337/en I receive SailsJS standard 404 page. Same goes when I tried with the second locale http://localhost:1337/bg.

http://stackoverflow.com/comment/45901264
comment on: http://stackoverflow.com/a/28753101
type: AnswerComment
score: 0
type: Comment
has text: I actually think $timeout was the answer in conjunction with your other suggestions, so thanks for that. Check out an updated plunk: http://plnkr.co/edit/BmM1YgvpT2kioSg5smq4?p=preview

http://stackoverflow.com/comment/91489904
has text: yeah ... but it was necessary, in my case... perhaps that was a bug... nothing is perfect .... and that makes it much more fun
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/47788279

http://stackoverflow.com/comment/45701008
has text: @RaySuelzer - The debugger only gives me script.js:3505:0 in the script.js file that Firefox uses.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28705562
score: 0

http://stackoverflow.com/comment/45676804
comment on: http://stackoverflow.com/a/28685634
has text: Thats a hack not a solution
type: AnswerComment
score: 3
type: Comment

http://stackoverflow.com/comment/45871197
has text: I fixed that. I seemed to have run into another problem. When the browser is chrome, the input selection of files is different. 'isFolder' doesnt work. Any modifications that will let me use this on ff too?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28673712

http://stackoverflow.com/comment/124126880
score: 0
type: Comment
comment on: http://stackoverflow.com/a/31263588
has text: I also have a very weird behaviour in my socket.io nodejs chat app,i have sidebar which is filled on "user join" event,and after some time event triiggers at his own,and make double users in sidebar,why thats happen i havent idea,does heroku doing something on server or my bad internet connection doing that.Really weird.
type: AnswerComment

http://stackoverflow.com/comment/45594971
has text: thanks for the performance tool! really helpfull!
comment on: http://stackoverflow.com/q/28648162
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28672505
accepted answer: http://stackoverflow.com/a/46120302
has comment: http://stackoverflow.com/comment/45639737
linked to: http://stackoverflow.com/q/23392111
has comment: http://stackoverflow.com/comment/45641212
has comment: http://stackoverflow.com/comment/45639316
score: 0
has comment: http://stackoverflow.com/comment/45640369
linked to: http://stackoverflow.com/q/4057440
answer count: 1
tagged with: arrays
tagged with: javascript
has title: [possible bug]Values in array as attribute of object set to undefined
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45641239
has body: I have encountered one of the most bizzare and frustrating behaviours yet. I have sample data: var nodes = [ //Sample data { ID: 1, Chart: 1, x: 50, y: 50, width: 100, height: 80, color: "#167ee5", text: "Start", label: "Start", targets: [2] }, { ID: 2, Chart: 1, x: 500, y: 170, width: 100, height: 80, color: "#167ee5", text: "End", label: "End", targets: [3] }, { ID: 3, Chart: 1, x: 270, y: 350, width: 100, height: 80, color: "#167ee5", text: "Mid", label: "Mid", targets: [] } ]; for my web application. The issue is with the targets attribute. As you can see it is array. However when I do console.log(nodes[0]); and inspect the result in the browser it shows that the value for targets at index 0 is undefined. Same for every other targets that has some values in them (whether 1 or more). However if I do console.log(nodes.[0].targets); it prints out [2]. If I do Array.isArray(nodes[0].targets) it returns false, yet if I do console.log(nodes[0]) and inspect the result in the browser console, it shows that the object prototype is in fact Array and simply the value at index 0 is undefined. It worked the day before and now it doesn't. The only thing I did was I restructured the object that uses this variable later. But the console log is being called before the object is even instantiated for the first time (and it doesn't change the nodes var anyway, only reads it). Does anyone have any clues as to what might be causing this behaviour. If it helps I am using Paperscript and this code runs in the paperscript scope (as it did before when everything worked fine). UPDATE Ok after more blind debugging I have determined the block of code that causes the issue, how or why is completely beyond me. Basically I define an object constructor beflow. The constructor loops through the nodes, makes Paperscript shapes and adds the targets to the arbitrary data attribute of the paperJS path object: function Flowchart(nodes, chartdata) { //Member vars. They are only used internally var co…
has comment: http://stackoverflow.com/comment/45638629
has answer: http://stackoverflow.com/a/46120302
type: Question

http://stackoverflow.com/a/28725686
has body: draggable is a jQuery object on which you can call the regular jQuery methods that you are familiar with. to get the value, you can simply use: ui.draggable.val() or ui.draggable.attr('value')
accepted answer of: http://stackoverflow.com/q/28725467
type: AcceptedAnswer
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28725467

http://stackoverflow.com/a/28684789
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45663927
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45663403
has body: You were close, syntax was a little off: (ng-repeat="thing in filteredThings = (things | orderBy:'name' | filter: search")) li(ng-if="filteredThings.length === 0") It looks like we don't have any things.
has comment: http://stackoverflow.com/comment/45662644
accepted answer of: http://stackoverflow.com/q/28684735
answers question: http://stackoverflow.com/q/28684735
upvote count: 2

http://stackoverflow.com/comment/58816085
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/31059035
type: Comment
has text: @zipzit phantom is not a node module; it's a driver that you install externally and export the path of if you wish to use it with x-ray.

http://stackoverflow.com/comment/45778006
type: Comment
type: QuestionComment
has text: It's unclear what type of events you want to disable - [Backbone](http://backbonejs.org/#Events-catalog) or DOM events? BTW, `stopListening` is applicable to Backbone events only.
score: 0
comment on: http://stackoverflow.com/q/28747768

http://stackoverflow.com/a/28651594
type: Answer
downvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/51452476
upvote count: 2
answers question: http://stackoverflow.com/q/28624800
has body: I believe you can just use Ember.Handlebars.helper which is what is in the latest emberjs guides. This jsbin uses htmlbars and it works. This is the helper in the jsbin AppLogItHelper = Ember.Handlebars.helper("logIt", function(something){ console.log(something); }); If you are using ember-cli it will auto generate one for you but that uses Ember.Handlebars.makeBoundHelper which doesn't work in the jsbin but works in my ember-cli app.

http://stackoverflow.com/comment/45723919
has text: the code I posted must work on windows, linux and macOS
type: Comment
comment on: http://stackoverflow.com/a/28718383
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45601882
score: 1
type: AnswerComment
has text: @JamieHutber Yes, and that's exactly it. The fact that you have to JSON stringify means that the browser doesn't support Storage objects (at least that's what I'm thinking)
type: Comment
comment on: http://stackoverflow.com/a/28651653

http://stackoverflow.com/comment/45774851
has text: Without `require('../app/models/user.server.model');`, `app/models/user.server.model[.js]` will never run and register a model with mongoose.
comment on: http://stackoverflow.com/q/28746229
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28652563
has body: Nested helper functions can be useful for making your code more understandable. Google even recommends using nested functions in their style guide. I'm wondering about the instantiation of these nested functions and performance. For example, work(1); work(2); function work(a) { // do some stuff log(); // do some more stuff function log() { console.log(a); } } work is instantiated once, but is log instantiated twice? If log is instantiated every time work is executed, would it generally be recommended not to nest functions? Instead, write code like the following work(1); work(2); function work(a) { // do some stuff log(a); // do some more stuff } function log(a) { console.log(a); } These examples are overly trivial and the question is more about the general case.
type: AnsweredQuestion
tagged with: performance
has answer: http://stackoverflow.com/a/28652947
has answer: http://stackoverflow.com/a/28652804
upvote count: 18
type: Question
accepted answer: http://stackoverflow.com/a/28652642
possible better answer: http://stackoverflow.com/a/28652947
tagged with: function
downvote count: 0
score: 18
tagged with: javascript
answer count: 4
favorite count: 0
has title: Nested helper functions and performance
has answer: http://stackoverflow.com/a/28653106
has answer: http://stackoverflow.com/a/28652642

http://stackoverflow.com/q/28621042
type: Question
score: 1
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has title: Nav Bar Fading Out and back In
has answer: http://stackoverflow.com/a/28621508
tagged with: css
favorite count: 0
downvote count: 0
has body: I am trying to create and effect with the nav bar. Right now I have a cover photo covering the entire page and when scrolling it will create a parallax effect revealing the content of the page. I would like the nav bar to lower in opacity as you scroll down, still remaining static, and once the cover photo is fully scrolled over and content covers the whole page, the nav bar (almost different looking too) fades back in and remains static again. Unfortunately I cannot find an example website to show. If anyone can help with this effect, Id be greatly appreciated. This is what I have so far. $(document).on('scroll', function(e) { $('#nav').css('opacity', ($(document).scrollTop() / 50000)); var st = $(window).scrollTop(); $('header').css({ 'background-position-y': 0 + (st * .77) + "px" }); }); body { margin: 0; background: #F9F9F9; } #page-wrap { position: relative; min-width: 1366px; max-width: 2048px; margin: 0px auto; width: 100%; } header { background: url('../images/cover6.jpg') no-repeat; background-size: 100% 100%; width: 95%; margin: 0px auto; height: 1000px; } .nav_container { margin: 0 auto; width: 100%; } .nav_container nav { display: inline-block; position: fixed; background: #fff; width: 2048px; height: 85px; opacity: 0; } Nav CONTENT
type: UnansweredQuestion
tagged with: navbar

http://stackoverflow.com/q/28609623
tagged with: google-maps
has comment: http://stackoverflow.com/comment/45524153
linked to: http://stackoverflow.com/q/5202296
has comment: http://stackoverflow.com/comment/45523490
linked to: http://stackoverflow.com/q/3596583
has body: My goal After I've executed a function like setCenter or setZoom on the Map, I want to know when the map is done loading tiles so I can add my markers without distractions to the user. The "obvious" solution Listen to the tilesloaded events, it will fire when the map is done loading tiles. The problem If the map doesn't move, or moves so little that no new tiles are loaded, the event never fires. There doesn't seem to be a way to know beforehand if a move is going to cause new tiles to be loaded, and there is no property or method on the Map class to indicate whether or not tiles are currently being fetched. So my question is, after I've executed a map.setCenter or setZoom function, how do I know for sure when the map has stopped moving (in the case of an animated move) and all tiles are loaded?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45524464
has comment: http://stackoverflow.com/comment/45524508
answer count: 0
has comment: http://stackoverflow.com/comment/45525495
has comment: http://stackoverflow.com/comment/45524304
type: Question
has comment: http://stackoverflow.com/comment/45524914
has title: How do I know for sure that the map is idle and all tiles are loaded?
tagged with: javascript
tagged with: google-maps-api-3
has comment: http://stackoverflow.com/comment/45523281
score: 0
has comment: http://stackoverflow.com/comment/45524969

http://stackoverflow.com/comment/45716850
type: Comment
score: 1
has text: Your marquee has a fixed height of 474px
type: QuestionComment
comment on: http://stackoverflow.com/q/28714544

http://stackoverflow.com/comment/45521219
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28608282
has text: thanks for replying, this still doesn't work. In element inspection I now got ngSrc and src, both pointing to same url and get changed when I choose a different post, but still same video and still continues to play when I inject different html
type: Comment

list
type: Tag
tag name: list
tags question: http://stackoverflow.com/q/28684796

http://stackoverflow.com/a/28641937
accepted answer of: http://stackoverflow.com/q/28641875
answers question: http://stackoverflow.com/q/28641875
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45603513
has body: Your syntax is incorrect, the end of string $ anchor should be placed inside of the delimiters. You also need to precede your character class with a quantifier and anchor the entire pattern. The following regular expression will allow the specified characters. /^[a-zA-Z0-9\s.,!?()$%*]+$/
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/q/28613730
tagged with: jquery
score: 0
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28613951
has comment: http://stackoverflow.com/comment/45530824
has comment: http://stackoverflow.com/comment/45530828
has title: best way to load scripts dynamically
type: Question
has comment: http://stackoverflow.com/comment/45530937
has body: I'm working on a project where I've had to greatly widgetize my code. As such, I'm loading 5 pages of JS dynamically into the DOM. The problem I'm having though is that I don't have a way to check and wait for these scripts to be loaded. If it takes them a second to get pushed up into the DOM, then my script tries to run, but fails when it calls on them. Here's an example of how I'm embedding my scripts. var script_tag2 = document.createElement('script'); script_tag2.setAttribute("type","text/javascript"); script_tag2.setAttribute("src","http://www.freeptools.com/mapster/js/three.min.js"); (document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_tag2); This inserts it into the DOM, but I dont' have a way to pause my code until it's done. Has anyone run into this before? I'm trying to come up with a best practices for this, but coming up short.
has comment: http://stackoverflow.com/comment/45530860
tagged with: javascript

dreamweaver
type: Tag
tag name: dreamweaver
tags question: http://stackoverflow.com/q/28652595
tags question: http://stackoverflow.com/q/28669948
tags question: http://stackoverflow.com/q/28662111

http://stackoverflow.com/a/28728334
has comment: http://stackoverflow.com/comment/45743142
has body: It's because you are using Computed Property Names in the literal object: { ['c']: C, ['r']: R } An es5 compatible replacement might be: var TheCellRef = LeadImport2ExcelLibrary['utils']['encode_cell']({ "c": C, "r": R });
type: Answer
has comment: http://stackoverflow.com/comment/45749554
upvote count: 5
has comment: http://stackoverflow.com/comment/45749520
score: 5
accepted answer of: http://stackoverflow.com/q/28728216
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28728216

http://stackoverflow.com/comment/45612561
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28657432
has text: I don't know if onblur event is available for ` `.
score: 0

http://stackoverflow.com/a/54831658
upvote count: 1
downvote count: 1
score: 0
answers question: http://stackoverflow.com/q/28665160
has body: The above answers are not correct. The console.log() will run before the loop finishes and that is why you get undefiend. You can find your answer here. you have to think sync like this piece of code: function delay() { return new Promise(resolve =&gt; setTimeout(resolve, 300)); } async function delayedLog(item) { // notice that we can await a function // that returns a promise await delay(); console.log(item); } async function processArray(array) { for (const item of array) { await delayedLog(item); } console.log('Done!'); } processArray([1, 2, 3]); this will give you 1,2,3,done which means the console.log is happening at the end of loop!
has comment: http://stackoverflow.com/comment/131965787
type: Answer

http://stackoverflow.com/a/28743610
has comment: http://stackoverflow.com/comment/45771896
has body: User Array.prototype.filter method to find objects satisfying criteria: $scope.user = $scope.users.filter(function(user) { return user.id === userId; })[0]; This is the most natural way to solve it. If however your users array is very large (like millions, for example (hope it's not)) then for-loop-break solution of juunas is preffered as more effective.
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28743501
score: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45772010
answers question: http://stackoverflow.com/q/28743501
has comment: http://stackoverflow.com/comment/45772127
has comment: http://stackoverflow.com/comment/45772148
type: Answer

http://stackoverflow.com/q/28730901
has answer: http://stackoverflow.com/a/28731013
tagged with: prototype
type: Question
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28730999
accepted answer: http://stackoverflow.com/a/28730999
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28731013
has title: Unwanted Javascript effect: Prototype is sharing closure between instances
type: AnsweredQuestion
has body: I'm making a game with timed levels. A level is 2 minutes long, and a countdown timer is displayed in the upper right corner. Mario style. One way to keep track of the elapsed time would be to have my Level object have elapsed as a member variable. Level.init = function(){ this.elapsed = 0; //member variable! return this; }; Level.update = function(){ this.countdown(); }; Level.countdown = function(){ this.elapsed += 1; var remaining = (GAME_LENGTH*60) - (this.elapsed/TICKS); var minutes = Math.floor(remaining/60); var seconds = Math.floor(remaining%60); this.countdown.html(minutes + ":" + ("0"+seconds).slice(-2)); if (this.elapsed/TICKS &gt;= GAME_LENGTH*60) { this.level_end(); } }; When the game engine needs a fresh level, it creates one in this way: NewLevel = Object.create(Level).init(); However, I thought it might be nice to use a closure; elapsed is ONLY used by the countdown function, so it doesn't need to be a member variable of Level. Level doesn't need to know that elapsed exists. //member variable this.elapsed has been removed Level.init = function(){ return this; }; Level.update = function(){ this.countdown(); }; //a closure is used to keep track of elapsed time Level.countdown = (function(){ var elapsed = 0; return function() { elapsed += 1; var remaining = (GAME_LENGTH*60) - (elapsed/TICKS); var minutes = Math.floor(remaining/60); var seconds = Math.floor(remaining%60); this.countdown.html(minutes + ":" + ("0"+seconds).slice(-2)); if (elapsed/TICKS &gt;= GAME_LENGTH*60) { elapsed = 0; this.end_level(); } }; })(); But now I have a different problem. All copies of Level that are created share that countdown closure, because it is in the prototype chain. When a user quits the level early, and then starts a new level (trashing the old Level object instantiating a new Level object), the elapsed variable in the closure is not reset. To say it in another way, the user quits the level early with 30 seconds left. Then the user starts the level again, but now, i…
tagged with: closures

http://stackoverflow.com/a/28614069
has comment: http://stackoverflow.com/comment/45531510
answers question: http://stackoverflow.com/q/28614019
score: 0
has comment: http://stackoverflow.com/comment/45531413
type: Answer
upvote count: 1
has body: Why don't you just use changeColor('white') for onmouseout?
downvote count: 1

http://stackoverflow.com/q/28690661
downvote count: 0
has body: I am trying to access jquery object ($) from inside a action handler in ember controller. But it says $ is undefined. How do you get access to jQuery object from an action handler? Take this app for example: JS App = Ember.Application.create({ rootElement: '#main' }); App.IndexController = Ember.ArrayController.extend({ actions: { findHeight: function(){ console.log(this.$('#scroll-div').height); } } }); JS fiddle: http://jsfiddle.net/sisir/5ammt2fv/
favorite count: 0
has title: Using jQuery with Ember action handler
has answer: http://stackoverflow.com/a/28690856
upvote count: 1
type: AnsweredQuestion
score: 1
type: Question
has answer: http://stackoverflow.com/a/28690771
has comment: http://stackoverflow.com/comment/45672890
answer count: 2
accepted answer: http://stackoverflow.com/a/28690856
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28690771
has comment: http://stackoverflow.com/comment/45673202
tagged with: ember.js

http://stackoverflow.com/comment/45639824
type: QuestionComment
score: 0
has text: can you provide demo please?
type: Comment
comment on: http://stackoverflow.com/q/28673217

http://stackoverflow.com/a/28699386
has comment: http://stackoverflow.com/comment/45689067
answers question: http://stackoverflow.com/q/28698702
has comment: http://stackoverflow.com/comment/45689261
has comment: http://stackoverflow.com/comment/45689624
type: Answer
score: 0
upvote count: 1
downvote count: 1
has body: Well my servers are both node servers. In both I have a similar configurations: // Add headers app.use(function (req, res, next) { // Website you wish to allow to connect res.setHeader('Access-Control-Allow-Origin', 'http://192.168.0.105:3011'); // THE OTHER ONE IS CONFIGURED SIMILAR res.setHeader('Access-Control-Allow-Origin', 'http://192.168.0.105:3001'); // Request methods you wish to allow res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE'); // Request headers you wish to allow res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type'); // Set to true if you need the website to include cookies in the requests sent // to the API (e.g. in case you use sessions) res.setHeader('Access-Control-Allow-Credentials', true); next(); }); This doesn't seem to help a bit.
has comment: http://stackoverflow.com/comment/45689669

http://stackoverflow.com/comment/45763946
type: AnswerComment
comment on: http://stackoverflow.com/a/28718113
has text: Code i used.....WebElement weblinktab = driver.findElement(By.linkText("WEB LINK AND CARD COPY")); weblinktab.click(); Thread.sleep(10000); WebElement webelement= driver.findElement(By.xpath("//*[@id='txttab_2']")); Actions act = new Actions(driver); act.moveToElement(webelement).perform();//This opens menu list Thread.sleep(15000);//Holds menu //This web element is the option you have to click WebElement webelement1 = driver.findElement(By.cssSelector("span.icon_edit.ClsUpdate")); Actions act1 = new Actions(driver); act1.moveToElement(webelement1).perform(); webelement1.click();
score: 0
type: Comment

http://stackoverflow.com/comment/45511790
comment on: http://stackoverflow.com/q/28603377
type: Comment
has text: You mean, you want an Object from that array?
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45699305
type: Comment
comment on: http://stackoverflow.com/a/28679836
type: AnswerComment
has text: Agreed! Not sure why I used that way originally; absent-mindedness? I've updated my example for posterity.
score: 0

http://stackoverflow.com/comment/45605064
has text: Thanks for the reply but I can't make this work... should I put that code between <&# &>? Like this: <%# var labeler = { labels: {EN: 'Enfermedad', RE: 'Reglamentaria', ES: 'Estudio'}, label: function(value) { return this.labels[value] ? this.labels[value] : 'Default Label'; } }; labeler.label(Container.Value); %>
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28654038
type: Comment

http://stackoverflow.com/comment/45734623
type: AnswerComment
type: Comment
has text: Oh sorry, I guess my mind inserted a "to" there. Btw, `this.id` would be a simpler way to get the value.
comment on: http://stackoverflow.com/a/28722657
score: 0

http://stackoverflow.com/q/28599957
has answer: http://stackoverflow.com/a/28607799
type: Question
tagged with: properties-file
answer count: 2
downvote count: 0
tagged with: javascript
has body: In my index.html page, a variable in the script is hard coded. I want to get it from application.properties file but have no idea how to. It would helpful if anyone could provide me a solution.
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: Getting a value in application.properties file using javascript in spring boot
upvote count: 6
type: UnansweredQuestion
score: 6
has answer: http://stackoverflow.com/a/28604457
tagged with: spring-boot

http://stackoverflow.com/a/63768467
score: 17
upvote count: 18
downvote count: 1
has comment: http://stackoverflow.com/comment/139774455
has body: for this you can simply add two line spaces instead of one for example: this /** * decription * modes: * I am foo * I am bar */ results to : decription modes: I am foo I am bar But this /** * decription * * modes: * * I am foo * * I am bar * */ results to : decription modes: I am foo I am bar
answers question: http://stackoverflow.com/q/28733282
has comment: http://stackoverflow.com/comment/127118665
type: Answer

http://stackoverflow.com/comment/45593924
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28640274
has text: @GJK I'm afraid not, too much code needed to reproduce this. I hope someone ran into such issue and may explain. For now I'll left this attribute defined as string `selected: DS.attr("string")`

http://stackoverflow.com/comment/45554473
type: QuestionComment
has text: I'm sorry, but you have never connected to couchDB. server.get is NOT connecting to your instance of couch, it is creating a route. Give min a minute and i'll post an attempted answer
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28619262

http://stackoverflow.com/a/28745004
type: Answer
answers question: http://stackoverflow.com/q/28744944
score: 1
upvote count: 1
downvote count: 0
has body: You can do this quickly for known keys with Array.prototype.map var arr = [{"key": "54ce3bef2d1ce6a82c90ccc3"}, {"key": "54d290a23eff5da01d05fe53"}]; arr = arr.map(function (e) {return e.key;}); // ["54ce3bef2d1ce6a82c90ccc3", "54d290a23eff5da01d05fe53"] If the key is unknown but you know there is only one per item, combine with a for..in arr = arr.map(function (e) { var key; for (key in e) // may also want to Object.prototype.hasOwnProperty here return e[key]; }); // ["54ce3bef2d1ce6a82c90ccc3", "54d290a23eff5da01d05fe53"]

http://stackoverflow.com/a/28657132
has comment: http://stackoverflow.com/comment/45610749
has body: There's different ways you can select the src attribute in your code, I'd recommend you first give it an id like this: &lt;script id="myscript" src="http://testing.com/javascript.js"&gt;&lt;/script&gt; You can then select that element by its id using $("#myscript"). The code for getting the src attribute is var source = $("#myscript").attr('src'); If you don't want to add an id attribute, you can use a different selector, for example, you can select the second script tag in the head like this: $("head script:nth-child(2)"). Be careful though, because if someone adds another script element in the head above this element, this will no longer work.
answers question: http://stackoverflow.com/q/28656944
has comment: http://stackoverflow.com/comment/45610758
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45610789
has comment: http://stackoverflow.com/comment/45610550

http://stackoverflow.com/comment/45571457
score: 0
type: AnswerComment
has text: Does elem.click() fire even on clicks that are outside the element but inside the body? At this point I'd suggest building a Plunker that reproduces your problem.
type: Comment
comment on: http://stackoverflow.com/a/28620653

http://stackoverflow.com/comment/45531858
type: AnswerComment
has text: That depends entirely on your HTML structure. It would best to start a new question for that, including all the relevant HTML and JS code.
type: Comment
comment on: http://stackoverflow.com/a/28603563
score: 0

http://stackoverflow.com/q/28604610
has answer: http://stackoverflow.com/a/28605037
tagged with: asp.net-mvc
tagged with: javascript
tagged with: jquery
has title: Display a popup message or a view, depending on model validation
tagged with: ajax
score: 0
has answer: http://stackoverflow.com/a/28604789
answer count: 3
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28604725
has body: Imagine a webshop with several steps (views) during checkout. When the customer presses the 'next' button, the corresponding 'Action' method is called. In that method some validation is done, checking if the customer is free to proceed, or if there's something wrong with the order. Depending of the validation result, I'd like one of two things to happen: A) The next view is generated and displayed. B) The customer stays in the current page, but a modal dialog pops up, containing an error message. I've tried several approaches found around the web, but nothing has worked so far. The last thing I tried was using AJAX, but I've actually got no clue if this is the right approach. public ActionResult SomeAction() { if (ModelState.IsValid) { return View(); } // If not valid return errorMessage } $(document).ready(function () { $("#btn").click(function () { $.ajax({ url: "/Home/SomeAction", async: true, success: function (result) { if (!result.success) { alert(result.error); } // Else display view } });
type: Question

http://stackoverflow.com/comment/45635728
type: QuestionComment
type: Comment
has text: I think the idea behind hiding the number is so that you cannot scrape it. Do you have any good reasons we should help you to crack their protection? Moreso, if they did their job right, it should be very difficult.
score: 0
comment on: http://stackoverflow.com/q/28670896

http://stackoverflow.com/comment/45511986
type: QuestionComment
comment on: http://stackoverflow.com/q/28603505
score: 1
has text: Escape your "s like this: \", or if you think that is dirty you can replace your "s with 's in your JS code.
type: Comment

http://stackoverflow.com/a/28677610
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45648389
has comment: http://stackoverflow.com/comment/45648564
has body: You have to find the class named .auto-complete in jquery-ui.css. There you can add min-height and max height which will fix the height for minimum height and maximum height of the autocomplete box. Give it a try.
answers question: http://stackoverflow.com/q/28676872

http://stackoverflow.com/a/28605366
has comment: http://stackoverflow.com/comment/45515898
answers question: http://stackoverflow.com/q/28605198
has comment: http://stackoverflow.com/comment/45515747
downvote count: 0
has comment: http://stackoverflow.com/comment/45515459
type: Answer
has comment: http://stackoverflow.com/comment/45515336
score: 1
upvote count: 1
has body: In your code modCatList and flowCatList should be constructed outside of the JS. If I remember correctly Html.DropDownList returns a MvcHtmlString so you could add the following in your JS: var html = ' İçerik Kategorisi '+ '@Html.DropDownList("ModCategoryId_"+Html.Raw("counter"), modCatList, new { @class = "select2-select-00 col-md-12 full-width-fix required", @data_rule_required = "true", @data_msg_required = ModerationWEB.ErrorMessages.NOTVALID_MODCAT_EMPTY }).ToHtmlString().Replace(Environment.NewLine, "") ' +' Süreç Kategorisi '+ '@Html.DropDownList("FlowCatId_" +Html.Raw("counter"), flowCatList, new { @class = "select2-select-00 col-md-12 full-width-fix required", @data_rule_required = "true", @data_msg_required = ModerationWEB.ErrorMessages.NOTVALID_MODCAT_EMPTY, @multiple = "multiple", @size = "5" }).ToHtmlString().Replace(Environment.NewLine, "") '; You may need to unescape the rendered code so, $("#modFlowCatGroupDiv").html(unescape(html));

http://stackoverflow.com/a/28636092
has comment: http://stackoverflow.com/comment/45572775
has comment: http://stackoverflow.com/comment/45572843
has comment: http://stackoverflow.com/comment/45572266
has comment: http://stackoverflow.com/comment/45572805
score: 1
has body: There is a scope problem, which I'm having difficulties with to explain. The object vm gets assigned a b and c. (and the functions). But the functions update the local variables var a,b,c. Not the variables located in the vm object. (like I said.. hard time explaining) But this is how it works.. function Obj(){ var vm = this; //Or var vm = {}; vm.a = {}; vm.b = { prop1: 1, prop2: 2 }; vm.c = { prop1: 1, prop2: 2 }; vm.f1 = function(){ vm.a = { prop1: 1, prop2: 2 }; // in real life this calls a function that returns an object // a = someOtherFunctionThatReturnsAnObject(); }; vm.f2 = function(){ vm.b = { prop1: 100, prop2: 200 }; }; return vm; } var obj = new Obj(); obj.f1(); obj.f2();
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28635934
type: Answer
has comment: http://stackoverflow.com/comment/45572969

http://stackoverflow.com/a/28659117
upvote count: 1
answers question: http://stackoverflow.com/q/28658522
type: AcceptedAnswer
has body: You could write your own range function: var range = function(start, stop, step){ step = step || 1; var arr = []; for (var i=start;i&lt;stop;i+=step){ arr.push(i); } return arr; };
has comment: http://stackoverflow.com/comment/45614057
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45613890
accepted answer of: http://stackoverflow.com/q/28658522

http://stackoverflow.com/q/28696540
downvote count: 1
has comment: http://stackoverflow.com/comment/45684207
type: Question
has title: Prevent user from submit button click
tagged with: asp.net-mvc
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/45683357
has comment: http://stackoverflow.com/comment/45683578
has body: I have got one Kendo UI dropdown box and combobox both are cascading and loading items from DB... and then few more textbox controls and then submit button also.... I made required validation for two textboxes and dropdownList and we can edit items that we are selected in combobox(we can remove also). Some times user clicks the submit button with out properly loading the items in Combobox then I am getting error like Required validation error .... Is there any way to prevent the user from button click until the all the controls are fully loaded ... I tried two ways .. Approach 1 : i have put button property as hidden and then in combobox Databound event made visible the button ... But this approach didn't work.. Approach 2 : I have tried the suggestions given in this link $("#submit").prop("disabled", false) this approach didn't worked for me.. Is there any other approach to prevent user from clicking the submit button until all controls are loaded... Many thanks in advance...
linked to: http://stackoverflow.com/q/6890136
answer count: 3
has comment: http://stackoverflow.com/comment/45683591
has comment: http://stackoverflow.com/comment/45683542
upvote count: 0
has comment: http://stackoverflow.com/comment/45683433
favorite count: 0
has comment: http://stackoverflow.com/comment/45683577
tagged with: kendo-ui
has answer: http://stackoverflow.com/a/28696642
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45683501
has comment: http://stackoverflow.com/comment/45683388
has answer: http://stackoverflow.com/a/28696766
has comment: http://stackoverflow.com/comment/45683621
has comment: http://stackoverflow.com/comment/45683741
has answer: http://stackoverflow.com/a/28696614

http://stackoverflow.com/a/28730070
downvote count: 0
has comment: http://stackoverflow.com/comment/45746977
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28729990
score: 1
has body: Without the context of your specific code, it's hard to answer well, but you should look into using the window.sessionStorage or window.localStorage to temporarily store data for persistence between pages in javascript.

http://stackoverflow.com/a/28638814
type: AcceptedAnswer
has body: Angular copy is what you are looking for. https://docs.angularjs.org/api/ng/function/angular.copy There are a couple methods to use this that you will see in the docs, but my coworkers and I have found better use out using the optional 'destination' option. So this is how it works First setup your new target array. var newArray = []; Then you use that as the destination in angular copy angular.copy(firstArray, newArray); There you go, it is just that easy! Now your new array will no longer be connected to the original array. I would also look into using factories as services for your code instead of using rootScope. Learning that will increase your productivity a ton and make your code a lot more readable and user friendly. Here is a good article about it. http://tylermcginnis.com/angularjs-factory-vs-service-vs-provider/ Edit And as someone mentioned in the comments, it is indeed a deep copy. That means it will copy all children objects and arrays inside of an array.
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28638392
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28638392

http://stackoverflow.com/a/28667953
type: Answer
answers question: http://stackoverflow.com/q/28667616
has body: This component should hold the product of the two numbers as state. You can hold the values of the two numbers within the DOM, since you have your form. You would need an html form in the render of the react component. The render might look something like this: render: function() { var product = ''; if (this.state.product) { product = {this.state.product} ; } return ( {product} Delete Cancel ); }, Then, you need a function on your react class called submit() that gets the form values like this: var num1 = this.refs.num1.getDOMNode().value.trim(); var num2 = this.refs.num2.getDOMNode().value.trim(); And then you should just multiply them and store them as state: this.setState({ product: num1 * num2 }); Make sure you use getInitialState() and initialize the product to null: getInitialState: function() { return { product: null }; },
score: 4
upvote count: 4
downvote count: 0

http://stackoverflow.com/comment/45639637
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28673068
has text: there is no need to make it lower or upper case. it would even work without that.
score: 0

http://stackoverflow.com/comment/45724361
type: QuestionComment
type: Comment
has text: it seems to me that #2 should do #3 as well
score: 0
comment on: http://stackoverflow.com/q/28718733

http://stackoverflow.com/comment/45650169
type: AnswerComment
comment on: http://stackoverflow.com/a/28624117
type: Comment
has text: To make it would be against the concept of js.
score: 0

http://stackoverflow.com/comment/45676277
score: 0
comment on: http://stackoverflow.com/q/28691592
has text: @CBroe: I'm not so sure about that, Hatul prefers a CSS solution.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28674747
tagged with: treemap
upvote count: 4
tagged with: highcharts
downvote count: 0
tagged with: javascript
score: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/45643869
has comment: http://stackoverflow.com/comment/45644334
answer count: 0
type: UnansweredQuestion
type: Question
has title: Data Label Formatting HighCharts Tree Map
has comment: http://stackoverflow.com/comment/45725523
has body: I am using tree map but the problem is my data label are not formatting properly. As you can see the text in the last area is cropped. how can i fix this issue ? HTML : SCRIPT : $('#divHeatMap').highcharts({ colorAxis: { minColor: '#FA0404', // red maxColor: '#08F718' // green }, series: [returnJson.Series], title: { text: '' }, plotOptions: { treemap: { // area: { cropThreshold: 500 }, dataLabels: { // overflow: 'right', // crop: true, formatter: function () { return 'Name : ' + this.point.name + ' ' + ' ' + 'Price : ' + this.point.CurrentPrice + ' ' + ' ' + 'Net Change : ' + this.point.NetChange + '' + ' % Change :' + this.point.PercentageChange + '' + ' ' + 'Value :' + this.point.value + ' ' + ' '; // return '$' + this.point.name }, color: 'white' } } } });

http://stackoverflow.com/comment/45690639
comment on: http://stackoverflow.com/q/28684845
has text: basically yes, but think about it from a developer's point of view - you'd like to allow the user to send as many invitations as possible. If he wants to, why not 1000 instead of 50?
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/q/28691931
score: -2
has body: I am stuck with a regexp to test that a string contains only: letters lowercase or uppercase "." (dot sign) digits "_" (underscore sign) any other character except above will need to be an invalid input 1dx.tex - OK Ted_upcD.t3 - OK $tex._ce - FAIL(invalid char$) Thank you !
accepted answer: http://stackoverflow.com/a/28691962
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45675103
tagged with: regex
type: AnsweredQuestion
has title: Javascript Regexp
has answer: http://stackoverflow.com/a/28691962
downvote count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/45675097
type: Question

http://stackoverflow.com/comment/45603197
type: QuestionComment
comment on: http://stackoverflow.com/q/28653062
score: 0
has text: your code seems to work fine: http://jsfiddle.net/4sfdegrm/
type: Comment

http://stackoverflow.com/comment/45634153
has text: so should i have to do setting of the browser in Ipad?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28670093
type: Comment

http://stackoverflow.com/comment/45642965
score: 0
comment on: http://stackoverflow.com/q/28674866
type: Comment
type: QuestionComment
has text: Please check this out http://stackoverflow.com/questions/21294790/sailsjs-change-localization

http://stackoverflow.com/q/28603796
has comment: http://stackoverflow.com/comment/45513137
downvote count: 0
tagged with: javascript
favorite count: 0
score: 2
linked to: http://stackoverflow.com/q/13713528
upvote count: 2
tagged with: d3.js
has body: By default, when you create a new zoom behavior in D3, it maps the mousewheel to control zoom level. You can also click and drag to pan the chart if it's larger than the chart area. I'd like to remap the mousewheel gesture to instead pan on the vertical axis (mousewheel up pans up, mousewheel down pans down). Anyone have any clue how to accomplish this?
has title: D3: remap mousewheel to be panning gesture instead of zoom gesture
type: Question
possible better answer: http://stackoverflow.com/a/35213966
has answer: http://stackoverflow.com/a/28609009
has comment: http://stackoverflow.com/comment/45512909
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/35213966
accepted answer: http://stackoverflow.com/a/28609009
answer count: 2

http://stackoverflow.com/comment/45762423
type: Comment
type: QuestionComment
has text: You are supposed to remove the JSF noise as this is not a JSF/RichFaces problem.
comment on: http://stackoverflow.com/q/28738916
score: 0

http://stackoverflow.com/q/28674946
downvote count: 0
has comment: http://stackoverflow.com/comment/45643365
type: Question
score: 99
has comment: http://stackoverflow.com/comment/45643330
accepted answer: http://stackoverflow.com/a/28676035
has answer: http://stackoverflow.com/a/69203521
has answer: http://stackoverflow.com/a/71278691
has body: I have added the following before end of head I have added this before end of form I can see the recaptcha similar to https://developers.google.com/recaptcha/ HOwever, when user presses data without checking the checkbox, the data is submitted. Is there any other code I need to add to check if user has pressed the checkbox? Hopefully in js?
has answer: http://stackoverflow.com/a/46873433
answer count: 7
has answer: http://stackoverflow.com/a/28676035
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/50940715
has title: How to check in js that user has checked the checkbox in Google recaptcha?
favorite count: 0
has comment: http://stackoverflow.com/comment/45643224
has answer: http://stackoverflow.com/a/45018025
upvote count: 99
tagged with: checkbox
tagged with: recaptcha
possible better answer: http://stackoverflow.com/a/30591741
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/30591741
has comment: http://stackoverflow.com/comment/45643470

http://stackoverflow.com/comment/45774589
type: QuestionComment
has text: So what's the question?
type: Comment
comment on: http://stackoverflow.com/q/28745940
score: 0

http://stackoverflow.com/comment/45702528
comment on: http://stackoverflow.com/q/28706389
score: 0
type: QuestionComment
has text: @MarcB I wanted to display the message on the page then redirect.
type: Comment

http://stackoverflow.com/comment/45527203
has text: I don't think that an html control like that exists. Maybe you want to give your user an input instead of the select and then toggle auto-complete, or just add an option (none of the above) and right next to the select put an input where the user can add his own value.
score: 0
comment on: http://stackoverflow.com/q/28611502
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45610612
type: Comment
comment on: http://stackoverflow.com/a/28653668
has text: That is working great for a single video but when I want to videos of the same code it only works on the first one. When trying to change to work on classes and not id's its messes up completely. I am wanting the code to work indepdently on that div that was clicked so it does affect other divs with the same classes/ids until that one is clicked. Here is my example https://jsfiddle.net/tvyfxey6/7/
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47140817
score: 0
comment on: http://stackoverflow.com/q/28619731
type: QuestionComment
type: Comment
has text: dumb question:the regex variable shouldn't be places above the wc variable?

http://stackoverflow.com/comment/45627023
score: 0
type: Comment
type: AnswerComment
has text: The line in my html is will the td tag affect anything?
comment on: http://stackoverflow.com/a/28666049

http://stackoverflow.com/comment/45751259
type: Comment
comment on: http://stackoverflow.com/a/28732683
score: 0
type: AnswerComment
has text: Thank you! I forgot you can do that with jquery. Much appreciated!

http://stackoverflow.com/q/28703457
score: 1
has answer: http://stackoverflow.com/a/28704123
upvote count: 1
type: Question
tagged with: bookshelf.js
tagged with: javascript
has body: I would like to update a junction table, to add/remove appropriate records (with bookshelfjs). I thought this was possible with updatePivot, but that didn't work. Now I am just trying heavy-handed approach of deleting relevant junction records, yet that doesn't even work. Here are some snippets. First, the table structure: resources table -(id) -(url) tags table -(id) -(name) resource_has_tags -(resource_id) -(tag_id) For example, A resource is associated with zero or more tags. The junction table has a record for each relationship. Specifically, Initial case (create): Create new resource (id:1), has relation to tag #100, 101. Result: resource_has_tags table has 2 records (1 - 100, and 1 - 101). Second case (update): resource should now be associated with tag 102, 103. resource_has_tags should be (1 - 102, 1 - 103). The resource model file tags: function () { return this.belongsToMany('Tag', 'resource_has_tags', 'resource_id', 'tag_id'); }, getTags: function() { return this.related('tags'); }, getTagsJSON: function() { return this.getTags().map(function(i){ return {id: i.id, name: i.get('name')}; }); }, An example of resource controller's create method (this works). 'create': function(req, res) { var data = clean(req.body), tags = [], topics = []; if (data.tags) { tags = data.tags; delete data.tags; } if (data.topics) { topics = data.topics; delete data.topics; } Resource.forge(data).save() .then(function(model) { Promise.all([ model.getTags().attach(tags), model.getTopics().attach(tags) ]) .then(function(){ res.json(model); }) .catch(function(err) { res.json(err); }); }) .catch(function(err) { res.json(err); }); My resource controller's update method (this does not delete or refresh the junction table). 'update': function(req, res) { var data = clean(req.body), tags = [], topics = []; if (data.tags) { tags = data.tags; delete data.tags; } if (data.topics) { topics = data.topics; delete data.topics; } req.resource.save(data, {patch: 'true'}) .then(function(model) { …
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/50748080
type: UnansweredQuestion
tagged with: node.js
has title: Updating a junction table with bookshelfjs

http://stackoverflow.com/comment/45698218
type: Comment
score: 0
has text: Yes. `getValues()` returns a two dimensional array. A two dimensional array is an array, of other arrays: `[ ["one", "two", "three"], ["value one", "value two", "value three"] ]` If you wanted to get "value two" out of the second array, you need to use two indexes. `array[1][1]` That gets the second array and the second value in the second array.
type: AnswerComment
comment on: http://stackoverflow.com/a/28632495

http://stackoverflow.com/comment/45681805
comment on: http://stackoverflow.com/q/28695593
score: 0
type: Comment
has text: That doesn't make sense? `str` doesn't contain any numbers, nor does it have 8 characters, and you don't seem to have a `<StrNum>` element ?
type: QuestionComment

http://stackoverflow.com/comment/45554768
has text: @MarkoTopolnik Theories are good. But if there is only one thing I learned from the university - people cannot write parallel code.
comment on: http://stackoverflow.com/a/28626362
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45916625
comment on: http://stackoverflow.com/a/28639225
score: 0
type: Comment
has text: What do you mean by "you will have to interpolate the touch screen event positions with a constant displacement" could you please be more specific so I can accept your answer? How does ``circle.prev_pos``belongs to ``prev.x``?
type: AnswerComment

http://stackoverflow.com/comment/45746463
type: QuestionComment
type: Comment
has text: Maybe you should change the front-end app? Leaking globals isn't exactly a best-practice.
score: 0
comment on: http://stackoverflow.com/q/28727762

http://stackoverflow.com/comment/45633784
type: AnswerComment
has text: Sorry, forgot that line in my paste. I have it inside my source but it's not working. that's the strange thing about it
type: Comment
comment on: http://stackoverflow.com/a/28669111
score: 0

http://stackoverflow.com/comment/45813035
type: Comment
comment on: http://stackoverflow.com/a/28765204
has text: This is great, and works much better than my attempt! My only confusion is that you're swapped out `templateUrl` for `template`...is this just to show us what appears without having to populate those files? So the only real change is that my name for the main state was `"@mage.detail"` when it should have been `""`..why is that?
type: AnswerComment
score: 0

http://stackoverflow.com/q/28698207
tagged with: javascript
has answer: http://stackoverflow.com/a/28698556
accepted answer: http://stackoverflow.com/a/28698556
score: 0
answer count: 1
tagged with: angularjs
type: AnsweredQuestion
has title: How to dynamically insert items from a Array on one page
type: Question
has body: I would like to direct the pages of templateUrl , en route, to the wizard.html page. To filter fixed items to their respective pages , I use: | filterBy: ['href']:'/sound-waves' , for example. How could insert the items dynamically on one page ? angular.module('tareasApp') .controller('NatureCtrl', function ($scope, $routeParams, $sce, $location, $anchorScroll) { $scope.items =[ { href:'/sound-waves', img:'waves.jpg', video:'//www.youtube.com/watch?v=OG2eGVt6v2o', description:'Those Relaxing Sounds of Waves' }, { href:'/nature-relaxing-sound', img:'ocean.jpg', video:'//www.youtube.com/watch?v=SWR0GdC7_40', description:'Nature Sounds Relaxing Ocean Sounds' } ]; }); Page wizard.html &lt;div ng-controller="NatureCtrl"&gt; &lt;div ng-repeat="item in items | filterBy: ['href']: ''" &gt; &lt;img ng-src="images/{{ item.img }}" width="400" height="200" &gt; &lt;p&gt;{{item.description}}&lt;/p&gt; &lt;iframe width="655" height="400" ng-src="{{ item.video }}" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt; &lt;/div&gt; &lt;/div&gt; Route angular.module('tareasApp') .config(function ($routeProvider, $locationProvider) { $locationProvider.html5Mode(true); $routeProvider .when('/sound-waves', { templateUrl: 'views/wizard.html', controller: 'NatureCtrl' }) .when('/nature-relaxing-sound', { templateUrl: 'views/wizard.html', controller: 'NatureCtrl' }) .otherwise({ redirectTo: '/' }); }); The goal is to avoid having multiple pages with the same structure. Edited: The names of the pages are not in sequence so no . I had put to make it easier to understand . ( Had written as: page-one , page-two changed to sound-waves, nature-relaxing-sound ) Edited: Put the ...controller('NatureCtrl', function... involving the items array for better understanding.

http://stackoverflow.com/comment/45543418
has text: What changes isCollapsed, then? And where?
score: 2
comment on: http://stackoverflow.com/q/28620092
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28674560
answer count: 3
upvote count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28675260
favorite count: 0
has body: I have the following HTML : &lt;table&gt; ... some other rows &lt;tr&gt; &lt;td&gt; &lt;input id="Products_0__Quantity" class="product-quantity" type="text" /&gt; &lt;/td&gt; &lt;td&gt; ...Some other columns &lt;/td&gt; &lt;/tr&gt; ... some other rows &lt;/table&gt; I have attached an event handler to a link contained in every row. I know it works,because other parts of the event handler function simply work fine. However this part doesn't : var tr = $(this).closest('tr'); var productQuantity = tr.children('input.product-quantity').val(); After this line, productQuantity is still undefined. What's the problem ?
has title: Value of input field not retrieved : undefined object
has answer: http://stackoverflow.com/a/28674577
accepted answer: http://stackoverflow.com/a/28674577
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
possible better answer: http://stackoverflow.com/a/28675260
has answer: http://stackoverflow.com/a/28674695
type: Question
type: AnsweredQuestion
tagged with: javascript

http://stackoverflow.com/comment/45601995
type: AnswerComment
has text: Nice one, nearly there so there is something missing. For example: write "Mihai" after `123` and hit **a**. The `a` char should be inserted right after your name however it gets inserted before your name instead. Expected result is `123Mihaia` not `123aMihai`.
type: Comment
comment on: http://stackoverflow.com/a/28652316
score: 0

http://stackoverflow.com/comment/45652025
type: Comment
has text: Thank you for the prompt reply. I was hoping to keep it in a script tag that gets bundled up in our minify/uglify process. Instead of using ng-message-include="app/module/feature1/errorMessages.html" I wanted it to be simple ng-message-include="error-messages" just the id of the template.
score: 0
comment on: http://stackoverflow.com/q/28678878
type: QuestionComment

http://stackoverflow.com/comment/45593157
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28647607
score: 0
has text: http://petoknm.github.io/

http://stackoverflow.com/a/28691027
score: 1
has comment: http://stackoverflow.com/comment/45800721
has body: Nice question , this will work.. var isRequestDone = true; jQuery('#mybutton').click(function () { var requestParams = { url: '....', beforeSend: function () { isRequestDone = false; }, success: function () { isRequestDone = true; console.debug('do something'); }, error: function () { isRequestDone = true; } } if (!isRequestDone) { requestParams.success = function () { console.log('please wait for a while!'); }; } jQuery.ajax(requestParams); }); beforeSend will fire just before the request will go to server , so when request in on the server isRequestDone will be false and hence will change success handler . on success callback from the first request it will again back to original.
answers question: http://stackoverflow.com/q/28690056
has comment: http://stackoverflow.com/comment/45756617
upvote count: 1
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45741637

http://stackoverflow.com/comment/50850440
type: QuestionComment
comment on: http://stackoverflow.com/q/28648255
score: 1
has text: Angular itself works perfectly out of the box with webpack - `var angular = require('angular')`. You can also require your modules with the `name` property on each module - `var myModule = require('./myModule'); angular.module('foo', [myModule.name])`. There are a few exceptions - ui router being a notable one doesn't export the module object but the module name itself.
type: Comment

http://stackoverflow.com/comment/45741130
score: 0
type: QuestionComment
type: Comment
has text: @ZachSadler I'm looking in to that, thank you for pointing me in the right direction.
comment on: http://stackoverflow.com/q/28726193

http://stackoverflow.com/comment/45646250
score: 0
type: QuestionComment
type: Comment
has text: Glup is just a tool to automate your workflow. If you should concat all your js files to one file or just certain ones, is up to you and depends on your use case.
comment on: http://stackoverflow.com/q/28676345

http://stackoverflow.com/a/41673248
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28716464
score: 1
has body: This worked for me with Chartjs v2.4.0 The idea is to set backDropColor to full transparent. 255,255,255 is white, but 0 sets it to transparent. Then the userCallback returns always an emptry string. The end result is hidden y-axis labels. ticks: { backdropColor : "rgba(255,255,255,0)", userCallback: function(value, index, values) { return ""; } }
downvote count: 0

http://stackoverflow.com/q/28744992
has answer: http://stackoverflow.com/a/28745108
score: 0
answer count: 3
has title: calling a web service with multiple data using angular js
has answer: http://stackoverflow.com/a/28746000
tagged with: angularjs
has answer: http://stackoverflow.com/a/28745177
tagged with: spring
linked to: http://stackoverflow.com/q/21344352
tagged with: spring-mvc
type: UnansweredQuestion
type: Question
has body: I'm newer in angular js and I would like to call the web-service (implemented with Spring REST ) which use multiple data in his request body but i didn't now how the parsing can be done. Can someone help me please ? This is my Spring method in controller: @RequestMapping(value = "/addpost", method = RequestMethod.POST, headers = "Accept=application/json") public @ResponseBody String addpost(@RequestBody PostDto post, @RequestBody UserDto user) { postservice.addPost(post, user); return "post inserted"; } This is how i tried to call this method $scope.addPost=function(x,y){ $http.post('http://localhost:8080/wall/addpost',[x,y]). success(function(data, status, headers, config) { $scope.persons.push(data); $scope.user=""; $scope.post=""; }). error(function(data, status, headers, config) { alert("erreur"); })
linked to: http://stackoverflow.com/q/11442632
tagged with: javascript

http://stackoverflow.com/comment/45756079
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28735309
has text: 00 means id, it'll replace the previous html in there. You better use jquery for these things. It's nice and clean. Easy to implement!
score: 0

http://stackoverflow.com/comment/45559308
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28627605
has text: @CrowbarKZ aparently that solved the issue, please write that as an answer... now I'll take a look at chrome's bugtracker :)
score: 0

http://stackoverflow.com/q/28625522
has body: I have been building a third party javascript widget which renders a recommendation engine type widget on host sites. I have successfully deployed my widget on 4 websites before hitting this strange issue with this website. This website uses a floating.menu.js for their navigation buttons and this particular script is also calling my javascript apart from host's html markup so my widget gets rendered twice and it completely messes up my styling. Upon inspecting in console in chrome developer tools, it shows that VMxx type script is also running on the page apart from my own third party script. Does anyone know how to prevent these type of script from interefering with my script or how should I debug this issue at all. I
tagged with: javascript
has comment: http://stackoverflow.com/comment/45552189
has comment: http://stackoverflow.com/comment/45552055
accepted answer: http://stackoverflow.com/a/28625724
upvote count: 0
has comment: http://stackoverflow.com/comment/45552283
answer count: 1
favorite count: 0
has title: Issues with third party javascript
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28625724
downvote count: 2
has comment: http://stackoverflow.com/comment/45552278
type: Question
linked to: http://stackoverflow.com/q/1479319
score: -2

http://stackoverflow.com/a/28706974
has body: After hiding the content, store the top offset of each option-heading: $('.option-content,.arrow-up, .arrow-down:first').hide(); $('.option-heading').each(function() { $(this).data('top', $(this).offset().top - 10); }); You can then animate the scrollTop to that position: $('html,body').animate({scrollTop: $(this).data('top')}, 'fast'); Working Fiddle
upvote count: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28706319
type: Answer
accepted answer of: http://stackoverflow.com/q/28706319
has comment: http://stackoverflow.com/comment/45703347
score: 1

http://stackoverflow.com/a/28860265
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28749989
has body: I think this was caused by my not using a path relative to the root, but to the current view dir. Which is weird in my opinion because I didn't think refreshing the page would change the active directory. Fix: add "~/" to the beginning of paths FYI: I figured this out shortly after posting this, just wanted to clarify that this stupid mistake did not take me a week to figure out.
answers question: http://stackoverflow.com/q/28749989
type: AcceptedAnswer

http://stackoverflow.com/comment/45748961
type: QuestionComment
has text: Is there no way to just change the type to quickly test this theory? I understand your point but I think babel probably makes a request to that script using the src and takes it as string and runs it.
comment on: http://stackoverflow.com/q/28731256
score: 0
type: Comment

http://stackoverflow.com/comment/45762540
comment on: http://stackoverflow.com/a/28738681
score: 0
type: AnswerComment
type: Comment
has text: Oh jeeze! You simply add `<?php include 'assets/HTML/header.html';?>`?!!! I thought this included ready to implement somewhere... All working! =D

http://stackoverflow.com/q/28702684
has answer: http://stackoverflow.com/a/34763585
score: 0
has title: Google Charts: Uncaught Error: Row 0 has 1 columns, but must have 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28702776
type: Question
answer count: 2
tagged with: javascript
has body: I have the following javascript code: google.load("visualization", "1", {packages:["corechart"]}); google.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable([ [' ', 'Systol','Diastol'], [' ', &lt;?php echo "$present_sys" ?&gt;,&lt;?php echo "$present_dia" ?&gt;] ]); var data2 = google.visualization.arrayToDataTable([ [' ', 'weight'], [' ', &lt;?php echo "$present_wt" ?&gt;] ]); var data3 = google.visualization.arrayToDataTable([ [' ', 'SpO2'], [' ', &lt;?php echo "$pulse_rate" ?&gt;] ]); var data4 = google.visualization.arrayToDataTable([ [' ', 'PEF','FEV1'], [' ', &lt;?php echo "$PEF" ?&gt;,&lt;?php echo "$FEV1" ?&gt;] ]); The problem is an odd problem.. What is happening is that I choose certain types of data, the chart does work, however I choose another record, I get the following error: Uncaught Error: Row 0 has 1 columns, but must have 2. Is the reason why Google chart will work with some data and some data will not work. Thanks

http://stackoverflow.com/q/28616635
tagged with: javascript
has body: I have a kendoGrid with a column that uses a command that looks like this: command: { text: "View Details", click: showDetails } The command calls the showDetails method which opens a kendoWindow: function showDetails(e) { e.preventDefault(); var dataItem = this.dataItem($(e.currentTarget).closest("tr")); wnd.content(detailsTemplate(dataItem)); wnd.center().open(); } This works as expected. Now I want to have another column that is a url that does the same thing when you click it. So far this is what I have for the template of that column: template: '&lt;a href="javascript:void(0)" onclick=showDetails&gt;#=CourseTitle#&lt;/a&gt;' I basically followed the example from the Kendo website for the command: http://demos.telerik.com/kendo-ui/grid/custom-command. The command has a click property, but the template does not and trying to set the onclick attribute of the url to the same value I use for the click property of the command doesn't work and I'm not sure how to modify this so that it works as I intend.
tagged with: kendo-ui
score: 0
tagged with: templates
accepted answer: http://stackoverflow.com/a/28625672
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28625672
has title: How to show a window with template from a url column in Kendo Grid
answer count: 1

http://stackoverflow.com/comment/45512853
type: Comment
type: QuestionComment
has text: Does your fake JSON comes from a file? Maybe that file is not properly encoded.
score: 0
comment on: http://stackoverflow.com/q/28603699

http://stackoverflow.com/a/28629714
accepted answer of: http://stackoverflow.com/q/28629432
answers question: http://stackoverflow.com/q/28629432
has comment: http://stackoverflow.com/comment/45561773
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45560650
type: Answer
has body: Please note that ng-repeat creates it's own scope for every template which means you'll have to use $parent in ng-model for the input. ng-model="$parent.selectedFoo" Also a working fiddle with your code example: http://jsfiddle.net/hpeinar/5gj9y6k4/
score: 2
upvote count: 2

instant
tags question: http://stackoverflow.com/q/28737974
tag name: instant
type: Tag

http://stackoverflow.com/q/28610192
has answer: http://stackoverflow.com/a/28610426
has body: I accept Hello I'm trying to add a checkbox that you have to check in order to continue. It pops op correctly when you click on the button without checking the box; however, it is still take you to the website. I want to keep asking to check the box before taking the user to the website. Could you guys give me a hand? I try adding it after the return true between { } but it doesn't seems to work. My knowledge in javascript is very basic. Thanks
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28610509
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28611162
score: 1
favorite count: 0
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/45524395
has comment: http://stackoverflow.com/comment/45524576
has title: Checkbox in Javascript/Html
has answer: http://stackoverflow.com/a/28610509
answer count: 3
has comment: http://stackoverflow.com/comment/45524476
possible better answer: http://stackoverflow.com/a/28610426

http://stackoverflow.com/a/28747895
upvote count: 1
score: 1
has body: At chromium / chrome browsers , try adjusting launcher to chromium /path/to/chromium-browser --allow-access-from-files chrome /path/to/google-chrome --allow-file-access-from-files See How do I make the Google Chrome flag “--allow-file-access-from-files” permanent? List of Chromium Command Line Switches
accepted answer of: http://stackoverflow.com/q/28746979
answers question: http://stackoverflow.com/q/28746979
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/45748728
comment on: http://stackoverflow.com/q/28731256
score: 1
type: Comment
type: QuestionComment
has text: you can't use a custom _type_ attrib with a _src_ attrib on a script tag, and still have it load; and the _src_'s url must contain real javascript. you can however rip the attrib values and feed to to a script loader manually, just use _elm.src_ and _elm.type_ to get the values from the tag.

http://stackoverflow.com/a/28706412
has body: Thanks guys, You're the best. I ended up using a combination of both answers. I'm not a programmer, and just started out with Jquery, so my solution will probably not be the best, but it works for me.... This is the end result : Thanks again, Hans
answers question: http://stackoverflow.com/q/28700377
score: 0
type: Answer

http://stackoverflow.com/q/28705099
has body: I'm helping developing improvements on a client website. In one of those improvements, there is the Login form. I want to add a checkbox that when the user logs in after selecting this checkbox, it remember his login data. The login form I have: <!-- action="telaInicial"> --> {label_index_user} {label_index_password} {label_index_lembrardados} {label_index_esquecisenha} So I think I need to put on my JS file something like: $("#lembrar").click(function() { if document.getElementById("lembrar").checked = true { // CODE FOR REMEMBERING DATA FOR FUTURE LOGINS } }); I don't know if I made myself clear on this question. But I think it can be simple to put on the page. Thanks for any help.
has answer: http://stackoverflow.com/a/28705497
type: UnansweredQuestion
has title: javascript - remember user data after loggin in and checkbox selected
tagged with: checkbox
tagged with: authentication
tagged with: forms
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28705395
linked to: http://stackoverflow.com/q/8508999
has answer: http://stackoverflow.com/a/28705264
score: 0
answer count: 3

http://stackoverflow.com/comment/45554821
comment on: http://stackoverflow.com/q/28626959
has text: you can add third promise and resolve or reject it
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/a/28594968
accepted answer of: http://stackoverflow.com/q/28594890
upvote count: 3
type: AcceptedAnswer
type: Answer
has body: You could try "B": function() {return b(p);}
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/28594890

request
tags question: http://stackoverflow.com/q/28660918
tag name: request
type: Tag
tags question: http://stackoverflow.com/q/28625147
tags question: http://stackoverflow.com/q/28618755

http://stackoverflow.com/q/28730516
tagged with: javascript-objects
has comment: http://stackoverflow.com/comment/45757538
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45747280
type: Question
upvote count: 4
has body: I am making a mobile application(Using Ionic Framework) of a news website which is made of wordpress . The json file is fetched from the site. I have to fetch same duplicate json data with some new posts from wordpress site for my app to show new news if a user continue to scroll. So I have to add/append these new several posts objects into the previous "posts" array of objects. Here is the conventional wordpress posts json file object looks like. { "status": "ok", "count": 2, "count_total": 4231, "pages": 2116, "posts": [ { "id": 62296, "type": "post", "slug": "any slug", "url": "any url", "status": "publish", "title": "any title", "title_plain": "any title", "content": "any content", "excerpt": "any excerpt", "date": "2015-02-26 02:08:57", "modified": "2015-02-26 02:09:59", "categories": [ { "id": 1015, "slug": "any slug", "title": "any title", "description": "", "parent": 0, "post_count": 7 } ], "tags": [ { "id": 1180, "slug": "any slug", "title": "any title", "description": "", "post_count": 6 }, { "id": 1179, "slug": "religion", "title": "religion", "description": "", "post_count": 5 }, { "id": 1209, "slug": "any slug", "title": "any title", "description": "", "post_count": 4 } ], "author": { "id": 1, "slug": "newsdesk", "name": "NewsDesk", "first_name": "", "last_name": "", "nickname": "NewsDesk", "url": "", "description": "" }, "comments": [], "attachments": [ { "id": 44930, "url": "anything appropriate", "slug": "anything appropriate", "title": "anything appropriate", "description": "", "caption": "", "parent": 62296, "mime_type": "image/jpeg", "images": { "full": { "url": "anything appropriate", "width": 290, "height": 147 }, "thumbnail": { "url": "anything appropriate", "width": 150, "height": 147 }, "medium": { "url": "anything appropriate", "width": 290, "height": 147 }, "large": { "url": "anything appropriate", "width": 290, "height": 147 }, "tie-small": { "url": "anything appropriate", "width": 55, "height": 55 }, "tie-medium": { "url": "anything appro…
has answer: http://stackoverflow.com/a/28759483
tagged with: arrays
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45747451
answer count: 3
has title: How to append several new objects, after the last object of an array of objects in Javascript?
has answer: http://stackoverflow.com/a/28730612
has comment: http://stackoverflow.com/comment/45747251
favorite count: 0
score: 4
possible better answer: http://stackoverflow.com/a/28730654
accepted answer: http://stackoverflow.com/a/28759483
has answer: http://stackoverflow.com/a/28730654

http://stackoverflow.com/q/28745511
score: 1
has title: Change the in array functions context and pass the array to $.when
type: Question
has comment: http://stackoverflow.com/comment/45775171
tagged with: arrays
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45805972
has body: Hi all I have this working method to call an array of functions at recurring intervals. Here you can see the object with the methods to add/remove functions in the array and the functions to start/stop the calling interval. (You have to focus only to the start method but I put them all for clarification) function updateEngine() { var _callRecurringFunctions = null, _functionsToCall = [], _functionIds = [], _functionApps = []; updateEngine.prototype.addFunction = function (appCode, funcId, func) { if ($.isFunction(func) &amp;&amp; $.inArray('_' + appCode + '_' + funcId, _functionIds) == -1) { _functionApps.push(appCode); _functionIds.push('_' + appCode + '_' + funcId); _functionsToCall.push(func); } } updateEngine.prototype.removeFunction = function (appCode, funcId) { if (funcId == null) { // remove all functions relative to an app for (var x = 0; x &lt; _functionApps.length; x++) { if (_functionApps[x] == appCode) { _functionApps.splice(x, 1); _functionIds.splice(x, 1); _functionsToCall.splice(x, 1); } } } else { // remove the single app function var pos = $.inArray('_' + appCode + '_' + funcId, _functionIds); if (pos &gt;= 0) { _functionApps.splice(pos, 1); _functionIds.splice(pos, 1); _functionsToCall.splice(pos, 1); } } } updateEngine.prototype.start = function () { _callRecurringFunctions = setInterval(function () { for (var x = 0; x &lt; _functionsToCall.length; x++) { var frame = null; // id == -1: local function // id == 0: function defined in home iframe // id &gt; 0: function defined in an app iframe if (_functionApps[x] &gt;= 0) frame = _portalContent.find("iframe[id='" + _functionApps[x] + "']"); if (frame != null &amp;&amp; frame.get(0) != null) { var iframeContent = frame.get(0).contentWindow || frame.get(0).contentDocument; _functionsToCall[x].apply(iframeContent); } else _functionsToCall[x](); } }, _updateFrequence); // tick every 5 seconds } updateEngine.prototype.stop = function () { clearInterval(_callRecurringFunctions); _callRecurringFunctions =…
has comment: http://stackoverflow.com/comment/45807953
has comment: http://stackoverflow.com/comment/45807539
has answer: http://stackoverflow.com/a/28799269
answer count: 1
has comment: http://stackoverflow.com/comment/45807269
favorite count: 0
has comment: http://stackoverflow.com/comment/45807778
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45807183
upvote count: 1
has comment: http://stackoverflow.com/comment/45774468
tagged with: .when
tagged with: settimeout

http://stackoverflow.com/q/28635191
score: 1
accepted answer: http://stackoverflow.com/a/28635223
has title: Finding elements using __utils__.getElementsByXPath in CasperJS
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28635223
tagged with: xpath
has body: A snippet from my casper.js test script is given below; var refObject = undefined; casper.then(function() { refObject = this.evaluate(function() { return __utils__.getElementsByXPath('//div[contains(concat(" ", @class, " "), " refObject ")]//a[contains(normalize-space(text()), normalize-space("SampleTest"))]//../../../..'); }); require('utils').dump(refObject); this.echo(refObject); test.assertTruthy(refObject); }); Here inside evaluate function I am trying to get reference to a html element which looks as follows; SampleTest In Google Chrome (Ctrl+F), I tested the xpath and found to be referencing correctly. But when I execute the casperjs script I am getting output of require('utils').dump(eobject) as [] and this.echo(eobject) as blank. Does anyone has an idea about what could be the issue?
tagged with: casperjs
downvote count: 0
type: Question
tagged with: phantomjs
type: AnsweredQuestion

http://stackoverflow.com/q/28685400
tagged with: vim
has comment: http://stackoverflow.com/comment/45666695
tagged with: homebrew
has title: Vim YouCompleteMe Pattern Not Found Error
upvote count: 1
answer count: 1
has body: I'm getting the following error in MacVim on Yosemite from YouCompleteMe whenever I write Javascript. It happens almost every line. Can someone please help me silence this message? I know I am running the latest version of MacVim w/ homebrew. I have tried this patch but it didn't work.
tagged with: javascript
tagged with: macvim
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/28688537
favorite count: 0
type: Question
accepted answer: http://stackoverflow.com/a/28688537
tagged with: plugins

http://stackoverflow.com/a/28730468
answers question: http://stackoverflow.com/q/28730078
type: Answer
score: 0
has body: Your selectors were a bit off, and you probably want to in initialize the modals first. $('.socialModal').modal({show:false}); $('.social-button').click(function () { $(this).closest('.social-button-container').next('.socialModal').modal('show'); }); Demo

http://stackoverflow.com/q/28665484
tagged with: javascript
score: 0
tagged with: openstreetmap
tagged with: overpass-api
has comment: http://stackoverflow.com/comment/45635162
has comment: http://stackoverflow.com/comment/45633271
tagged with: postgresql
tagged with: rest
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45657440
answer count: 0
type: Question
has title: Using a rest API to query OSM data in Postgres DB
has body: I have been trying to use a rest API to query my OSM data that I have already uploaded in my postgres DB. I have been trying to write a small javascript program, which makes use of a restful API (Like API 0.7 of OSM, XAPI, Overpass API - I do not know which is the best of these 3). I would want to make queries to my postgres DB via an XHR from Javascript using some thin API on the server (which is either one among those 3). I have searched high and low on the internet, but there are no tutorials on this. I have been thinking of using the overpass API, but I guess I might have to use the Overpass query language for this. How about using XPath for parsing these postgres queries? Edit - I do not want to use any of the mapping libraries like leaflet, mapnik, etc. that already can produce tiled information. I am trying to produce map tiles on my own. Hence, as a first step,I need to know how to use a rest API to query for osm data on my postgres db. Edit 2- My queries are something like getting all the places of interest within a bounding box. For example, i wrote a select query for postgres that returns the places through which a particular highway passes through, within a bounding box of lat and long. Also, how can i use javascript to plot these points on a web browser?
has comment: http://stackoverflow.com/comment/45673841

http://stackoverflow.com/comment/45736992
has text: Thanks ... Your answer definitely was the first big pointer for me. After reading some more into the link above I now understand what is going on here. First time I run into this tricky trap ;-)
comment on: http://stackoverflow.com/a/28712892
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/q/28633187
tagged with: meteor
tagged with: asynchronous
favorite count: 0
score: 8
has answer: http://stackoverflow.com/a/28633650
tagged with: promise
has title: Avoiding Callback Hell with Multiple Meteor Method calls on Client
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28633650
has body: I have multiple Meteor.calls, where each methods depends on the response of another Meteor method. Client Meteor.call('methodOne', function(err, resOne){ if(!err){ Meteor.call('methodTwo', resOne, function(err, resTwo){ if(!err){ Meteor.call('methodThree', resTwo, function(err, resThree){ if(err){ console.log(err); } }) } }); } }); From Meteor's documentation I know "Methods called on the client run asynchronously, so you need to pass a callback in order to observe the result of the call." I know I can create yet another Meteor Method on the server to execute methods 'methodOne', 'MethodTwo', 'MethodThree' wrapped using Meteor.async, or sequentially without the callback all together. But I am worried this path will cause my meteor methods to get bloated and entangled, leading to spaghetti code. I would rather keep each Meteor method simple with one job to do and find a more elegant way of chaining the calls on the client. Any ideas, is there any way to use Promises on the client?
type: Question
possible better answer: http://stackoverflow.com/a/28633352
has answer: http://stackoverflow.com/a/28633352
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28634035
upvote count: 8
answer count: 3

http://stackoverflow.com/comment/45652590
has text: Do you mean catching the event of saving the resources file? Or do you mean when the external file was saved somewhere else? Or if the page itself was saved?
score: 0
comment on: http://stackoverflow.com/q/28676976
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45541297
type: QuestionComment
comment on: http://stackoverflow.com/q/28619214
has text: You'll have to look at whatever response your PHP actually returned (leading/trailing garbage/HTML). And `if(0){` probably doesn't help.
score: 0
type: Comment

http://stackoverflow.com/comment/86519636
score: 2
has text: Why do you want to get rid of me :(?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28619193

http://stackoverflow.com/q/28618154
has title: issues upgrading Ember 1.8.1 to Ember 1.9.1 with Handlebars 2.0 and emblem
type: UnansweredQuestion
type: Question
tagged with: emblem.js
tagged with: javascript
has answer: http://stackoverflow.com/a/29633112
score: 0
answer count: 1
has body: Im wondering if anyone came across this issue with upgrading Emberjs from 1.8.1 to 1.9.1 I am getting this error in my dev console This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid. Besides upgrading to Ember 1.9.1 and Handlebars 2.0 I am also using gulp-auto-emblem I have checked https://github.com/machty/emblem.js/ and it seems like no support for Handlebars 2.0 yet.. I have found a solution to fix the link-to issue by doing this: link-to 'report.index' report but i need to have class names in my link-top helper link-to 'report.index' report id class='button button--viewReport' but this doesnt work.. any feedback would be appreciated.. thanks
tagged with: handlebars.js
tagged with: ember.js

http://stackoverflow.com/a/28602460
has body: I'll do it like this :D var arrayOfIds = [1,2,3,4,5]; var results = []; var mySingleDeferred = new $.Deferred(); var arrayOfDeferreds = $.map(arrayOfIds, function(campaignID){ var deferredForThisOperation = Tools.remove(campaignID); deferredForThisOperation.done(function(result) { results.push(result.id); }).catch(function (response) { results.push(response) }); return deferredForThisOperation; }); $.when(arrayOfDeferreds).then(function(){ mySingleDeferred.resolve(results); }); return mySingleDeferred.promise();
type: Answer
answers question: http://stackoverflow.com/q/28601985
has comment: http://stackoverflow.com/comment/45511467
score: -1
downvote count: 2
has comment: http://stackoverflow.com/comment/45510993
upvote count: 1
has comment: http://stackoverflow.com/comment/45511415

http://stackoverflow.com/q/28642750
tagged with: facebook
accepted answer: http://stackoverflow.com/a/28642777
type: AnsweredQuestion
has body: I'm trying to use Facebook share button on a list of photos where each photo has its own button with a different URL. Unfortunately I can't make this work. I get all the testing strings except the facebook button string. To test whether the facebook SDK works I removed the string from the webmethod and add it directly on my aspx page. Then it worked! But I want to have it in the Webmethod as follows... page.aspx (in the body section) &lt;div id="fb-root"&gt;&lt;/div&gt; &lt;script&gt; (function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src= "//connect.facebook.net/fr_FR/sdk.js#xfbml=1&amp;appId=**************&amp;version=v2.0"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); &lt;/script&gt; [WebMethod] public static string photo() { StringBuilder photo_sb = new StringBuilder(); var photo_query = db.Query("SELECT * FROM [photos]); foreach (var item in photo_query ) { photo_sb.Append("Testing"); // I get this string photo_sb.Append("&lt;div class=\"fb-share-button\" data-href=\"http://********.com/photos.aspx?IDphoto=" + item.IDphoto + "\" data-layout=\"icon\"&gt;&lt;/div&gt;&lt;br /&gt;"); // I don't get this string photo_sb.Append("Testing2"); // I get this string } return photo_sb.ToString(); } Script function Load() { $.ajax({ type: "POST", url: "UserControls.aspx/photo", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { if (data.d != "") { $('.photoList').append(data.d);} ...
type: Question
tagged with: javascript
has title: Facebook share button doesn't seem to work in a Webmethod with Javascript and Ajax
has answer: http://stackoverflow.com/a/28642777
score: 0
answer count: 1
tagged with: facebook-javascript-sdk
tagged with: asp.net
tagged with: ajax

http://stackoverflow.com/comment/45633780
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28667094
type: Comment
has text: hey one issue is there, say when I select from and to date as `02/02/2015 12:00 AM - 02/03/2015 11:59 PM`, the model value is showing `{"start":"2015-02-02T06:00:00.000Z","end":"2015-02-04T05:59:59.000Z"} `. Instead of `2015-02-03` it is showing `2015-02-04` for end date

http://stackoverflow.com/a/28668114
downvote count: 0
answers question: http://stackoverflow.com/q/28668053
type: Answer
has body: $("div").css("background-size", w+"px " + h + "px"); ^ (Space Here)
score: 1
upvote count: 1

http://stackoverflow.com/comment/45666368
comment on: http://stackoverflow.com/a/28685970
has text: Thanks! I got it working now. Yeah I think I was confusing the {{text}} inside the html file as referencing the database but really its what is returned from the helper method in the js file. I just called this.text in the return and I can see my sample characters.
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/45672453
comment on: http://stackoverflow.com/q/28690056
type: Comment
type: QuestionComment
has text: Let me describe my use case - if I click the button, a jQuery.ajax request gets fired. If you click a second, third, 4th, 5th, .. time, the current request (if present) should get an empty success handler ( function() {} ), so only the last request should have the right success handler. I will update my code above to explain what I mean.
score: 0

http://stackoverflow.com/comment/60511642
type: AnswerComment
comment on: http://stackoverflow.com/a/36431131
has text: Ah true, it seems like IE still does not support this
type: Comment
score: 1

http://stackoverflow.com/comment/45705362
has text: @gibberish I've added the whole page to my post
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28707799

http://stackoverflow.com/comment/45709347
has text: It doesn't make sense... you just said the FB button overrides ng-click... so then how would you "backpropogate"
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28710127
score: 0

http://stackoverflow.com/comment/45603871
type: QuestionComment
comment on: http://stackoverflow.com/q/28653336
has text: Make a fiddle, but this is probably due to missing `display: block;` on the `<month>` element.
score: 0
type: Comment

http://stackoverflow.com/comment/82637788
comment on: http://stackoverflow.com/a/28678939
score: 0
type: Comment
has text: Side note: to close window after you have printed the output, use driver.close()
type: AnswerComment

http://stackoverflow.com/q/28715451
type: Question
tagged with: mongodb
tagged with: javascript
tagged with: express
has title: Elasticsearch pagination with MongoDB and ExpressJS
has body: I tried to search online for a solution but to be honest I still didn't found anything that help me to achieve this. It is the first time I use ElasticSearch and I'm also pretty new with Node and MongoDB. So, I followed a kind of tutorial and implemented Mongooastic from NPM to let ElasticSearch work with Node. It seems to work fine even if on a total of 12 users indexed, if I type in the search "user" in the search list view I can find 12 records, it show 10 in a for each and the first one has missing values... But the main problem for me is the pagination... or a sort of... it will be also nice to implement infinite scroll on it but I don't really know how to handle it. So, the controller that handle it is the following at the moment: exports.searchUsers = function(req, res) { User.search({ query_string: { query: req.query.q } }, { hydrate: true }, function(err, results) { if (err) res.send(err); res.render('search-results', { results: results, users: results.hits.hits }); }); }; I don't really know where to put size and from in here... and after understanding this I also would like to know how to implement, if possible, a sort of infinite scroll... And also how to handle link for the pagination... i.e.: prev, 1, 2, 3, 4, ..., next The view has a simple input text for the search, after pressing submit it open a new page with the list of hits, so it should be nothing complex... I hope you may help. Thanks
tagged with: elasticsearch
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/28715728
favorite count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: node.js
score: 1

http://stackoverflow.com/a/31273285
type: Answer
answers question: http://stackoverflow.com/q/28615768
has comment: http://stackoverflow.com/comment/50541698
score: 0
has body: Snap.svg recently added support for svg symbols (as of version 0.4).

http://stackoverflow.com/a/28712110
score: 0
has body: Answered on IRC by one very helpful "locks". Some problems remain, but the big question has been answered with this JSBin. My biggest confusion came from misunderstanding how URLs are handled, and what the role of link-to helper was. What I needed most was the change in the ItemsController: App.ItemsController = Ember.ArrayController.extend({ needs: ['shop'], shop: Ember.computed.alias('controllers.shop.model') }); which would make shop accessible, and a mistake in a template saying items instead of model.
answers question: http://stackoverflow.com/q/28692470
type: Answer

http://stackoverflow.com/q/28721834
has answer: http://stackoverflow.com/a/28721975
has body: it works on my last test but now its giving me hard time.. basically i have this code : var myOBJ = {}; for (var i = 0; i &lt; myitems.length; i++) { myOBJ[i].itemtype = myitems.type; myOBJ[i].name = myitems.name; } inside myitems is a data that I need to rewrite to another object for some reason. but I'm stock with the error im having Error: myOBJ[i] is undefined could anyone tell my what im missing?
possible better answer: http://stackoverflow.com/a/28722041
downvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/28722041
favorite count: 0
has comment: http://stackoverflow.com/comment/45730459
has comment: http://stackoverflow.com/comment/45730419
answer count: 4
has comment: http://stackoverflow.com/comment/45730433
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28721926
has title: Javascript : Adding Key Value pair literal giving undefined result
score: 1
upvote count: 1
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28721926
has answer: http://stackoverflow.com/a/28722172
has comment: http://stackoverflow.com/comment/45730422

http://stackoverflow.com/q/28698193
has answer: http://stackoverflow.com/a/28700522
answer count: 2
has title: Three.js : Can i create mesh to replace lot of object
has comment: http://stackoverflow.com/comment/45687816
has comment: http://stackoverflow.com/comment/45689015
favorite count: 0
has comment: http://stackoverflow.com/comment/45689147
type: UnansweredQuestion
tagged with: three.js
has comment: http://stackoverflow.com/comment/45687053
has answer: http://stackoverflow.com/a/28700549
score: 1
has comment: http://stackoverflow.com/comment/45690791
upvote count: 1
has body: this is the link of my work : maison.whiteplay.fr What i am trying to do is a 3D PacMan, but look at th code, i'm using mesh to build my level, except for bubbles (yellow circle), that you need to eat to win. They are all different objects, but because they are a lot, it's lagging, can i use the same technologie (mesh i think) to the bubbles ? If yes, how ? code: var geometrySphere = new THREE.SphereGeometry( 5, 32, 32 ); var bille = function(x,z){ this.bille = new THREE.Mesh( geometrySphere, new THREE.MeshBasicMaterial( {color: 0xffff00} ) ); this.bille.position.x = (x-15.5)*100; this.bille.position.y = 100; this.bille.position.z = (z-15.5)*100; scene.add(this.bille); } Thank your for reading, and if you have any suggestions about my code, don't hesistate :D
type: Question
has comment: http://stackoverflow.com/comment/45688387
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/28740828
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28741058
accepted answer: http://stackoverflow.com/a/28741058
type: AnsweredQuestion
downvote count: 0
has title: Transition for js height change
score: 1
tagged with: transition
type: Question
has body: Hey guys I hope you can help me with my following problem. Here is the relevant fragment of the js-code : var layone = document.getElementById('lone'); ... if(layone &amp;&amp; layone.style) { layone.style.height = 'auto'; layone.style.width = '120%'; layone.style.marginLeft = '-40px'; } ... Now I want to give it a smooth transition. Any help ? Thank you very much so far
tagged with: javascript
upvote count: 1

http://stackoverflow.com/q/28671611
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45637039
tagged with: php
has title: $.post JQuery not working
upvote count: 0
has comment: http://stackoverflow.com/comment/45636996
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45636949
tagged with: jquery
score: -1
tagged with: ajax
has answer: http://stackoverflow.com/a/28671917
has comment: http://stackoverflow.com/comment/45722260
downvote count: 1
answer count: 1
favorite count: 0
has body: I have a problem with form. After i click Dodaj button nothing happens. I've putted alert dialog to see when it stops and it stops after $.post('dodaj_ztoner.php', post_data, function(response){ I have made similar forms with similar code (names and number of items was different) and it worked alert('post'); is not displaying. so looks like problem is here $.post('dodaj_ztoner.php', post_data, function(response){ html code: &lt;body&gt; &lt;div id="dialog" title="Błąd Wprowadzania!"&gt; &lt;p&gt;Proszę uzupełnić podświetlone pola.&lt;/p&gt; &lt;/div&gt; &lt;div class="container"&gt; &lt;fieldset id="contact_form"&gt; &lt;h2&gt;Zużycie Tonera&lt;/h2&gt; &lt;div id="zresult"&gt;&lt;/div&gt; &lt;label for="id"&gt;&lt;span&gt;ID&lt;/span&gt;&lt;/label&gt; &lt;input type="text" name="zid" id="zid" value="&lt;?php $zapytanie = "select max(id) as id from zuzycie_toner"; $widok = mysql_query($zapytanie); while ($wynik = mysql_fetch_array($widok)) { echo $wynik['id']+1; } mysql_free_result($widok); ?&gt;" disabled /&gt; &lt;label for="zdata"&gt;&lt;span&gt;Data wydania&lt;/span&gt;&lt;/label&gt; &lt;input type="text" name="zdata" id="zdata" /&gt; &lt;label for="ilwyd"&gt;&lt;span&gt;Ilość wydrukowanych&lt;/span&gt; &lt;/label&gt; &lt;input type="text" name="ilwyd" id="ilwyd" /&gt; &lt;label for="drukarka"&gt;&lt;span&gt;Drukarka&lt;/span&gt;&lt;/label&gt; &lt;select type="text" name="zdrukarka" id="zdrukarka" &gt; &lt;option selected="selected"&gt;Wybierz&lt;/option&gt; &lt;?php $zapytanie = "select nazwa from drukarki order by nazwa"; $widok = mysql_query($zapytanie); while ($wynik = mysql_fetch_array($widok)) { echo "&lt;option&gt;$wynik[nazwa]&lt;/option&gt;"; } mysql_free_result($widok); ?&gt; &lt;/select&gt; &lt;label for="toner"&gt;&lt;span&gt;Toner&lt;/span&gt;&lt;/label&gt; &lt;select type="text" name="ztonery" id="ztonery" &gt; &lt;option selected="selected"&gt;Wybierz&lt;/option&gt; &lt;?php $zapytanie = "select nazwa from tonery order by nazwa"; $widok = mysql_que…

http://stackoverflow.com/a/28734938
score: 0
type: Answer
has body: Try replacing the href itself: function myfunction(link) { link.href = "otrta://code?id=" + document.getElementById("textbox1").value; } Submit
answers question: http://stackoverflow.com/q/28734788

http://stackoverflow.com/a/36478817
score: 8
upvote count: 8
has body: You can also do it by setting cache:false in your $stateProvider: $stateProvider.state('myState', { cache: false, url : '/myUrl', templateUrl : 'my-template.html' })
type: Answer
answers question: http://stackoverflow.com/q/28676631
downvote count: 0

http://stackoverflow.com/comment/45556578
score: 0
type: Comment
has text: @squiroid.. a single thread does each work on your server: when there is **input/output**(this is not a servers work here) then this work is given to background process, and when they come back with result, there is the same process serving them again.. so there is only single process which serves you(all http requests).
comment on: http://stackoverflow.com/a/28627152
type: AnswerComment

http://stackoverflow.com/q/28622553
tagged with: css
score: 0
accepted answer: http://stackoverflow.com/a/28622638
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28622670
has answer: http://stackoverflow.com/a/28622670
type: Question
has comment: http://stackoverflow.com/comment/45546983
answer count: 2
has title: How to use fadeTo, etc. animation tags along with a css change statement in jquery?
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28622638
has body: I have many statements like this: $('#prof').css('background-image','url("images/select2.png")'); I want the change to happen with an animation effect like FadeIn etc. I am using this but it is not working: $('#prof').css('background-image','url("images/select2.png")').fadeIn( "slow"); neither is this working: $('#prof').fadeIn( "slow").css('background-image','url("images/select2.png")'); Can anyone suggest what to do, or what I am doing wrong? I am an absolute beginner in the web development. After reading the answers, I am adding a few more details to make the problem more clear: The situation is that there is a sort of sidebar index, containing elements like about, experience, etc. The divs are already visible, what I am doing is when a particular div is selected I want the background image of the div to change. But with the code I am using, the change is happening but too suddenly, I want the transition to be smooth and more aesthetically pleasing, here is the code for an entire section: $('#about').click(function(){ $('#contents').css('margin-left','8%'); $('#contents').css('font-family', "'Quicksand', sans-serif"); $('#contents').css('font-size', '1.2em'); $('#topbar').fadeTo( 2000 , 1); $('#name').text('Dip Ranjan Chatterjee'); $('#contents').load("about.html #contents &gt; *"); $('#about').css('background-image','url("images/select2.png")'); $('#edu').css('background-image',''); $('#prof').css('background-image',''); $('#portfolio').css('background-image',''); $('#sidebar').css('background-image','url("images/sidebar3.png")'); $('#about').css('color','black'); $('#about').css('width','55%'); $('#about').css('margin-top','25%'); $('#about').css('padding-left','65px'); $('#about').css('padding-bottom','75px'); $('#about').css('padding-top','70px'); $('#about').css('padding-right','15px'); $('#edu').css('color','white'); $('#edu').css('width','70%'); $('#edu').css('padding-left','45px'); $('#edu').css('padding-bottom','10px'); $('#edu').css('padding-top','0px')…
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45496514
score: 1
has text: Or, if you don't actually care about the `this` context (if you don't know what that means, you probably **do**) you can just write `b: b`
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28594890

http://stackoverflow.com/a/28675056
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28617921
downvote count: 0
answers question: http://stackoverflow.com/q/28617921
has body: In case anyone could benefit from this, I had to either enable CORS (http://en.wikipedia.org/wiki/Cross-origin_resource_sharing) or to host both the webservice and website in the same place.
type: Answer
score: 1

http://stackoverflow.com/a/65607475
score: 3
downvote count: 0
upvote count: 3
has body: overwrite home button event, like this: viewer.homeButton.viewModel.command.beforeExecute.addEventListener( function(e) { e.cancel = true; viewer.scene.camera.flyTo(homeCameraView); });
answers question: http://stackoverflow.com/q/28709007
type: Answer

http://stackoverflow.com/comment/45665437
comment on: http://stackoverflow.com/q/28686341
has text: I use your last approach. Keeping each third party assets isolated simplifies updates (You are not meant to touch them anyway).
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28695358
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28695290
type: Answer
answers question: http://stackoverflow.com/q/28695290
has body: It just doesn't work that way, you can't compare one value against multiple other values using OR, you have to compare each value individually. The closest you'll get is using Array.indexOf if ( ['a', 'b', 'c'].indexOf(choice2) != -1 ) The reason it doesn't work is because OR and AND checks for a truthy value, so in ('a' || 'b' || 'c') // return "a" a is a truthy value, so the OR never proceeds, it doesn't have to, it already has a truthy value so the expression is true, and you're left with a, the rest is discarded
score: 4
upvote count: 4

http://stackoverflow.com/q/28709580
has comment: http://stackoverflow.com/comment/45708559
has comment: http://stackoverflow.com/comment/45708968
has comment: http://stackoverflow.com/comment/45708131
score: -1
favorite count: 0
tagged with: multidimensional-array
type: Question
has answer: http://stackoverflow.com/a/28709827
answer count: 2
has body: I have a multidimensional array "questArray" whose index starts from 0 to 4 only.It has data in the indexes as follows questArray[0][0]['q_sec']=1 questArray[1][0]['q_sec']=2 questArray[2][0]['q_sec']=3 questArray[3][0]['q_sec']=4 questArray[4][0]['q_sec']=5 Now, i have a for loop which iterates 40 times.Now inside this for loop i'm using a if block to check a certain condition with the above array as follows: for(var secCnt=1;secCnt&lt;=5;secCnt++){ for(var noCoun=0;noCoun&lt;40;noCoun++){ if (secCnt == questArray[noCoun][0]['q_sec']){ //some code here alert('1'); } } } My problem is that, in the inner loop when 'noCoun' counter's value is greater that 4, the code does not work because there is no 'questArray' with index greater than 4. How do i check for this condition. I have tried the following: if (typeOf questArray[noCoun][0]['q_sec'] !== undefined){ if (secCnt == questArray[noCoun][0]['q_sec']){ //some code here alert('1'); } } if (typeOf questArray[noCoun][0]['q_sec'] !== 'undefined'){ if (secCnt == questArray[noCoun][0]['q_sec']){ //some code here alert('1'); } } if (questArray[noCoun][0]['q_sec'] !== 'null'){ if (secCnt == questArray[noCoun][0]['q_sec']){ //some code here alert('1'); } } if (questArray[noCoun][0]['q_sec'] !== ''){ if (secCnt == questArray[noCoun][0]['q_sec']){ //some code here alert('1'); } } But none of the above code works.Hope you understand my problem.Please help.Thanks in advance
has title: Check for undefined array
has comment: http://stackoverflow.com/comment/45708546
downvote count: 1
has comment: http://stackoverflow.com/comment/45708182
has comment: http://stackoverflow.com/comment/45708325
tagged with: jagged-arrays
has comment: http://stackoverflow.com/comment/45708255
upvote count: 0
has comment: http://stackoverflow.com/comment/45708394
tagged with: arrays
has comment: http://stackoverflow.com/comment/45708936
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28709693

http://stackoverflow.com/comment/45525815
score: 0
type: QuestionComment
type: Comment
has text: @Sami - Both `bootstrap/backbone` and `bootstrap/jquery` are modules that I created that just do some configuring. They are not twitter bootstrap related and they do exist. For example, `bootstrap/backbone` looks like this `define(['backbone', 'backbone.paginator'], function(backbone, paginator){ /* do something */ });`. This file lives in *app/bootstrap/backbone* and loads fine with requirejs. Any other ideas?
comment on: http://stackoverflow.com/q/28600536

http://stackoverflow.com/q/28621123
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28621141
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has body: I have this main page that loads another php file on onchange event of the dropdown. I use this to load the page: function get_value(){ if($("#dropdwn").val()=="0"){ //load nothing }else{ $('#txtval').val($("#dropdown").val()); $('#load_page').html('&lt;p align="center"&gt;&lt;br/&gt;&lt;img src="images/popuploader.gif" /&gt;&lt;br/&gt;&lt;br/&gt;&lt;/p&gt;'); $('#load_page').load('load_xml.php'); } } For now I put the value of dropdown on the textbox but will also try to get the value of dropdown. The problem is on the second php file that loads on the main page. I can't get the value of $txtval=$_POST['txtval'] when I use this. I will need the value for if else condition.
type: AnsweredQuestion
has title: Getting textbox value on the same page but different php file
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28621141

http://stackoverflow.com/q/28662116
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45620577
favorite count: 0
tagged with: animation
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 0
has comment: http://stackoverflow.com/comment/45619499
type: UnansweredQuestion
tagged with: loops
has body: I am learning JS, and am trying to find the simplest, most elegant way to keep looping through an HTML input box and firing off an associated CSS animation based on what a user types in. Here is the pen link, and the HTML only below: Click button to enter a string. Click me! I get the feeling I have to code a JS callback function (which I am learning about), unless there is some much simpler way to keep looping through the HTML code. It is almost as is I am trying to have a pseudo main section with a while() loop that executes the animation every time the user enters something. Really stuck and would appreciate any feedback. thanks!
downvote count: 1
has comment: http://stackoverflow.com/comment/45619378
type: Question
has comment: http://stackoverflow.com/comment/45619520
score: -1
has comment: http://stackoverflow.com/comment/45620399
has comment: http://stackoverflow.com/comment/45619380
has comment: http://stackoverflow.com/comment/45619921
has title: JS looping, through an HTML5 prompt button

http://stackoverflow.com/comment/45709518
comment on: http://stackoverflow.com/q/28710243
score: 0
type: Comment
type: QuestionComment
has text: change `value.toFixed(options.decimals)` to `$(_this).html(value.toLocaleString());`

asp.net
tags question: http://stackoverflow.com/q/28651282
tags question: http://stackoverflow.com/q/28597820
tags question: http://stackoverflow.com/q/28710984
tags question: http://stackoverflow.com/q/28636920
tags question: http://stackoverflow.com/q/28699658
tags question: http://stackoverflow.com/q/28694574
tags question: http://stackoverflow.com/q/28636309
tags question: http://stackoverflow.com/q/28625293
tags question: http://stackoverflow.com/q/28706343
tags question: http://stackoverflow.com/q/28744006
tags question: http://stackoverflow.com/q/28737274
tags question: http://stackoverflow.com/q/28721409
tags question: http://stackoverflow.com/q/28659622
tags question: http://stackoverflow.com/q/28593679
tags question: http://stackoverflow.com/q/28622806
tags question: http://stackoverflow.com/q/28603945
tags question: http://stackoverflow.com/q/28633096
tags question: http://stackoverflow.com/q/28609745
tags question: http://stackoverflow.com/q/28618425
tags question: http://stackoverflow.com/q/28676323
tags question: http://stackoverflow.com/q/28738572
tags question: http://stackoverflow.com/q/28632618
tags question: http://stackoverflow.com/q/28618034
tags question: http://stackoverflow.com/q/28647286
tags question: http://stackoverflow.com/q/28712469
tags question: http://stackoverflow.com/q/28665061
tags question: http://stackoverflow.com/q/28635144
tags question: http://stackoverflow.com/q/28688322
tags question: http://stackoverflow.com/q/28746132
tags question: http://stackoverflow.com/q/28673085
tags question: http://stackoverflow.com/q/28673506
tags question: http://stackoverflow.com/q/28741089
tags question: http://stackoverflow.com/q/28645763
tags question: http://stackoverflow.com/q/28605532
tags question: http://stackoverflow.com/q/28699887
tags question: http://stackoverflow.com/q/28651097
tags question: http://stackoverflow.com/q/28623927
tags question: http://stackoverflow.com/q/28622623
tags question: http://stackoverflow.com/q/28623583
tags question: http://stackoverflow.com/q/28630449
tags question: http://stackoverflow.com/q/28713069
tags question: http://stackoverflow.com/q/28671205
tags question: http://stackoverflow.com/q/28748562
tags question: http://stackoverflow.com/q/28667743
tags question: http://stackoverflow.com/q/28706872
tags question: http://stackoverflow.com/q/28724960
tags question: http://stackoverflow.com/q/28681243
tags question: http://stackoverflow.com/q/28602602
tags question: http://stackoverflow.com/q/28725992
tags question: http://stackoverflow.com/q/28619313
tags question: http://stackoverflow.com/q/28741768
tags question: http://stackoverflow.com/q/28603082
tags question: http://stackoverflow.com/q/28611901
tags question: http://stackoverflow.com/q/28716201
tags question: http://stackoverflow.com/q/28667614
tags question: http://stackoverflow.com/q/28642352
tags question: http://stackoverflow.com/q/28695587
tags question: http://stackoverflow.com/q/28623840
tags question: http://stackoverflow.com/q/28691060
tags question: http://stackoverflow.com/q/28601533
tags question: http://stackoverflow.com/q/28712860
tags question: http://stackoverflow.com/q/28700404
tags question: http://stackoverflow.com/q/28603329
tags question: http://stackoverflow.com/q/28604444
tags question: http://stackoverflow.com/q/28607209
tags question: http://stackoverflow.com/q/28727361
tags question: http://stackoverflow.com/q/28715663
tags question: http://stackoverflow.com/q/28630514
tags question: http://stackoverflow.com/q/28683940
tags question: http://stackoverflow.com/q/28677491
tags question: http://stackoverflow.com/q/28693252
tags question: http://stackoverflow.com/q/28673496
type: Tag
tags question: http://stackoverflow.com/q/28643513
tags question: http://stackoverflow.com/q/28650447
tags question: http://stackoverflow.com/q/28625728
tags question: http://stackoverflow.com/q/28677149
tags question: http://stackoverflow.com/q/28703318
tags question: http://stackoverflow.com/q/28716097
tags question: http://stackoverflow.com/q/28702802

http://stackoverflow.com/comment/45642297
score: 0
type: Comment
has text: I was just playing with that :) http://jsfiddle.net/sxm22w3b/17/ And you're 100% correct, `replaceWith` strips the event handlers, `detach` doesn't. Thanks again Joe!
comment on: http://stackoverflow.com/a/28654788
type: AnswerComment

http://stackoverflow.com/comment/45757316
type: AnswerComment
has text: what is r stand for in this line of code: `emailCheck().done(function (r) { if (r)`
comment on: http://stackoverflow.com/a/28735913
type: Comment
score: 0

http://stackoverflow.com/q/28677907
tagged with: javascript
has title: Angular - expression in templates view
favorite count: 0
has comment: http://stackoverflow.com/comment/45649076
has comment: http://stackoverflow.com/comment/45649272
tagged with: angularjs
has answer: http://stackoverflow.com/a/28678209
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28678593
upvote count: 1
type: Question
tagged with: expression
score: 1
has body: I'm new to angular, trying to make a SPA. Just include the route module, and it works fine, but the templates inside don't process angular expression, just put one inside " {{ 1 + 2 }} ". And shows me the exact same expression and not "3". Do i need to make anything else to make templates run expressions? My code: index.html <!HTML> vista2.html {{ 1+2 }}
answer count: 2
has comment: http://stackoverflow.com/comment/45649006
downvote count: 0
has comment: http://stackoverflow.com/comment/45649261

http://stackoverflow.com/a/28611836
accepted answer of: http://stackoverflow.com/q/28611502
answers question: http://stackoverflow.com/q/28611502
type: AcceptedAnswer
has body: You could add an option in the select dropdown like My option is not in the list with the value 0 (or what ever you prefere) and have a change event attached to the select. When the value of the select changes to 0 you could replace the select with an text input field using jQuerys replceWith function: http://api.jquery.com/replacewith/ Edit: I made a little fiddle, this should be more understandable than the above one ;) http://jsfiddle.net/azumon0L/ Note: You can use any name for the text input, here I just assumed, that you want the same as in the Select... Edit2: It wasn't specified, that the user should be able to get back to the select and because I'm a lazy bastard, it didn't add it. However I've updated my solution, now it is able to do what you want! http://jsfiddle.net/azumon0L/2/
has comment: http://stackoverflow.com/comment/45565727
has comment: http://stackoverflow.com/comment/45547666
upvote count: 1
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45687363

http://stackoverflow.com/q/28634863
has answer: http://stackoverflow.com/a/28635371
has comment: http://stackoverflow.com/comment/45569691
type: UnansweredQuestion
downvote count: 3
upvote count: 1
type: Question
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45569676
answer count: 1
has body: I am beginner for java script. I have three check boxes on my page with different ids. when I checked first check box I need to show one div. when I checked second check box include first check box , I need to split one div to two divs. As well as when i checked three boxes split one div to three divs. I need to add all these divs dynamically with java script. observe the below image and same like i need Please help me to achieve this with simple java script code not with Jquery.
has comment: http://stackoverflow.com/comment/45569967
has title: Javascript : on click check boxes adding divs dynamically with pure java script not Jquery
favorite count: 0

http://stackoverflow.com/a/28735251
type: Answer
answers question: http://stackoverflow.com/q/28734644
has body: If moneydiv and textmoney need to execute the same function. Then i advice you to do it this way. &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function() { var $demo = $('#demo'); var $textMoney = $('#textmoney'); var $moneydiv = $('#moneydiv'); function todo(){ var money = $textMoney.val(); if (isNaN(money) || money === '') { $demo.text('You aint enter no $$$$$$'); } else { var dailyE = $textMoney.val() / 365; $demo.text('$' + dailyE + ' per day'); } } // on enter key $textMoney.keydown(function(e) { if (e.which === 13) { todo(); } else if ($(this).val() === '') { $demo.text(''); } }).mouseover(function() { $(this).css('border', '1px solid black'); }).mouseout(function() { $(this).css('border', '1px solid grey'); }); // on click $moneydiv.click(function(){ todo(); }); }); &lt;/script&gt; Hope it helps.
score: 0

http://stackoverflow.com/q/28609994
accepted answer: http://stackoverflow.com/a/28610565
type: Question
answer count: 2
upvote count: 12
downvote count: 0
tagged with: javascript
score: 12
has comment: http://stackoverflow.com/comment/45524406
has answer: http://stackoverflow.com/a/28610565
has comment: http://stackoverflow.com/comment/45523956
favorite count: 0
has title: Javascript - prevent function from executing multiple times
possible better answer: http://stackoverflow.com/a/66763414
has answer: http://stackoverflow.com/a/66763414
type: AnsweredQuestion
has body: I have a function which is executed on a click (or taphold) because I am working with Cordova. The problem is that a function calls on the next object from Parse.com which shows its details but, for some reason, it executes the function twice or even 3 times, skipping 1 or 2 objects that have to be shown. I want to prevent this from happening, so I already used a flag (boolean) to indicate if it was executed by setting it to true. If the flag was false, it can be executed and the flag is set to true. The other problem is that when I call the function one more time, the boolean is still set to true and the function will not be executed. Therefore I cannot initialize the flag to false inside the method, because then it will always be executed. Global variable will be set to true the first time and stay true for the rest of it's "life". I tried a second method by using a counter and making sure that if the counter reached, let's say 0, it could be executed, but then I have the same problem for setting it back to 0 when it reaches the end .. Let's say the function got executed twice, I could check if the counter reaches 2 (by incrementing it every time) and set it back to 0. Then when the next time it gets executed, it executes 3 times, so when the check happens if the counter reaches 2 .. it get's set back to 0 and the next execution (the 3rd one) will be executed again because the counter is 0 again. How do I catch this or prevent this from happening? I made a basic Javascript to show you what I mean: window.addEventListener("load",setup,false); var counter = 0; function setup() { for(var i = 0; i &lt; 3; i++) { showAlert(); } } function showAlert() { if(counter == 0) { alert("Executed once"); counter++; } else if(counter &gt; 2) //counter is bigger than 2, so it got executed more than once { counter = 0; //reset the counter to 0 } } The goal is to prevent the function from executing more than once (in this case, the alert may not be shown more than once). It could be…

http://stackoverflow.com/comment/45547173
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28622517
has text: result variable returns what is been echoed from your php file.Try putting an `alert(result)` before the `if statement`

http://stackoverflow.com/comment/45633976
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28669931
has text: @Sray Well, you set the timeout value to 1 second, which is unnecessary; also, why would you need to know exactly when the repaint is done? it's done as soon as your function finishes, that's the whole point.
type: AnswerComment

http://stackoverflow.com/a/28697472
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28697281
answers question: http://stackoverflow.com/q/28697281
has body: You have to check the encoding of your page, such as &lt;meta charset="UTF-8"&gt;. 'Garbage characters' appear because your page has an encoding that your browser cannot guess.
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1

gulp
tags question: http://stackoverflow.com/q/28637774
tags question: http://stackoverflow.com/q/28648312
tags question: http://stackoverflow.com/q/28655368
tags question: http://stackoverflow.com/q/28683949
tags question: http://stackoverflow.com/q/28593660
tags question: http://stackoverflow.com/q/28683069
tags question: http://stackoverflow.com/q/28593992
tags question: http://stackoverflow.com/q/28605925
type: Tag
tag name: gulp
tags question: http://stackoverflow.com/q/28729447
tags question: http://stackoverflow.com/q/28727762
tags question: http://stackoverflow.com/q/28659012
tags question: http://stackoverflow.com/q/28646846
tags question: http://stackoverflow.com/q/28602843
tags question: http://stackoverflow.com/q/28667641
tags question: http://stackoverflow.com/q/28676345
tags question: http://stackoverflow.com/q/28720477
tags question: http://stackoverflow.com/q/28749749
tags question: http://stackoverflow.com/q/28686605
tags question: http://stackoverflow.com/q/28688521
tags question: http://stackoverflow.com/q/28719091

http://stackoverflow.com/comment/45595464
type: QuestionComment
has text: I'm not sure if this is a cross origin problem, since the request is being sent FROM `localhost:3000/` TO `localhost:3000/`
comment on: http://stackoverflow.com/q/28648929
score: 0
type: Comment

http://stackoverflow.com/a/28648628
downvote count: 0
has comment: http://stackoverflow.com/comment/70652068
has comment: http://stackoverflow.com/comment/70650343
type: Answer
answers question: http://stackoverflow.com/q/28648090
score: 18
upvote count: 18
has body: They don't have a precise meaning, especially "property" is ambiguous. The term property (also: attribute, less common or even used for different things in JS) usually refers to the key/value pair that describes a member of an object. While, especially when used with a specific identifier (key), it often refers to the whole combination, it can also denote the value of that member. It does usually not mean the identifier itself. When people try to be accurate, they distinguish between "property" (the whole thing, part of an object), "property name" (the string used as the key) and "property value" (the stored data).

http://stackoverflow.com/q/28742013
has answer: http://stackoverflow.com/a/28742272
tagged with: underscore.js
has title: Merge Javascript Objects and All References Pointing at Them
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28742272
linked to: http://stackoverflow.com/q/13104494
has comment: http://stackoverflow.com/comment/45773613
favorite count: 0
has comment: http://stackoverflow.com/comment/45767433
upvote count: 2
has comment: http://stackoverflow.com/comment/45767331
tagged with: pass-by-reference
score: 2
has body: In javascript, variables referring to objects are passed a "copy of the reference". I am struggling with this concept as it relates to merging two objects, and the effect on the references to those objects. Attempting to use underscore's extend, take the following (coffeescript) code: a = { id: 1 type: "cat" name: "Angry" } b = { id: 1 type: "dog" owner: "Bill" } c = a d = c e = b _.extend(a, b) b = a d.home = "Nashville" console.log(a) //Object {id: 1, type: "dog", name: "Angry", owner: "Bill", home: "Nashville"} console.log(b) //Object {id: 1, type: "dog", name: "Angry", owner: "Bill", home: "Nashville"} console.log(c) //Object {id: 1, type: "dog", name: "Angry", owner: "Bill", home: "Nashville"} console.log(d) //Object {id: 1, type: "dog", name: "Angry", owner: "Bill", home: "Nashville"} console.log(e) //Object {id: 1, type: "dog", owner: "Bill"} As we can see, underscore did not 'merge' the objects. Instead, what has happened is that underscore set the attributes of the object referred to by b on the object referred to by a. Later, when we replace the reference held by b to point at the object referred to by a, e continues to hold a reference to the object originally referred to by b. This is because e was not assigned a reference to b, but rather a copy of the reference held by b. Similiarly, d holds a reference, not to c but to the object referred to by a. I would like to find a way to truly merge the two objects, so that all references to both objects point at a single destination. Is this possible in Javascript, or am I precluded from doing this as a result of Javascript's object passing structure?
type: AnsweredQuestion

http://stackoverflow.com/a/28643788
score: 1
has body: Using your example, this should work:- $("div[contenteditable='true']").each(function(ind,elem) { //$(this).onblur = alert($(elem).attr('id')); $(elem).onblur="onDivBlur(elem)" ; $(elem).onmouseup="saveSelection()" ; $(elem).onkeyup="saveSelection(elem)" ; $(elem).onfocus="restoreSelection(elem)"; });
upvote count: 1
answers question: http://stackoverflow.com/q/28643703
type: Answer
downvote count: 0

http://stackoverflow.com/q/28691770
has title: Load a page, give a variable on alert of JavaScript
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28691836
has comment: http://stackoverflow.com/comment/45675292
has answer: http://stackoverflow.com/a/28691836
accepted answer: http://stackoverflow.com/a/28692149
type: Question
tagged with: javascript
score: 0
answer count: 2
has body: I have a intranet-website here that checks if an employee has used the form correctly and (via php) calls then a JavaScript part: Now, there is a php-variable with a huge amount of text. how can I call the site and give the variable with it, instead of using a simple history.back, where every variables are deleted instantly? Someone an idea how to make this without jQuery?
has answer: http://stackoverflow.com/a/28692149
tagged with: php

http://stackoverflow.com/q/28730337
accepted answer: http://stackoverflow.com/a/28730568
tagged with: javascript
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28730875
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28730564
tagged with: css
answer count: 4
has answer: http://stackoverflow.com/a/28730564
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28730662
score: 1
has comment: http://stackoverflow.com/comment/45747625
upvote count: 1
has answer: http://stackoverflow.com/a/28730568
has comment: http://stackoverflow.com/comment/45746956
has title: How can position auto adjusting html block elements with css in this way (photo attached)
type: Question
has body: Is it possible to create this page layout with css alone? if so what is the best way to go about it? floating puts all block level elements aligned to the last page break along the top, display:inline-block just aligns up along the bottom. Neither create the alineation model from the image below. I know I could position them manually but the divs are filled with content from a data base so they will need to adjust automatically and align this way independently of their size. I thought about calculating all their heights with javascript and positioning them dynamically this way, but I've got this feeling that there might be a simple way of doing this that I'm totally overlooking. any ideas?

http://stackoverflow.com/comment/45572782
type: Comment
has text: actually it's still happening. It just seems to work sometimes. It's very strange but I suspect it's my javascript. :( And 100% seems to work fine in the options.
comment on: http://stackoverflow.com/q/28619474
score: 0
type: QuestionComment

http://stackoverflow.com/a/28741740
has comment: http://stackoverflow.com/comment/45776492
upvote count: 5
has body: That's very interesting behavior, and happens on IE8 and IE11 as well. Here's a rather simpler test/proof: var span = document.createElement('span'); span.appendChild(document.createTextNode("This disappears on IE")); var div = document.createElement('div'); div.appendChild(span); snippet.log("[before] span's childNodes.length: " + span.childNodes.length); div.innerHTML = ""; snippet.log("[after] span's childNodes.length: " + span.childNodes.length); &lt;!-- Script provides the `snippet` object, see http://meta.stackexchange.com/a/242144/134069 --&gt; &lt;script src="http://tjcrowder.github.io/simple-snippets-console/snippet.js"&gt;&lt;/script&gt; After setting the div's innerHTML to "", the span we kept a reference to loses its child text node on IE, and not on other browsers. We're not the only ones to notice this and find it, um, inappropriate. It doesn't have to be "", either, any new content causes the bug: var span = document.createElement('span'); span.appendChild(document.createTextNode("This disappears on IE")); var div = document.createElement('div'); div.appendChild(span); snippet.log("[before] span's childNodes.length: " + span.childNodes.length); div.innerHTML = "New content"; // &lt;== Not "" snippet.log("[after] span's childNodes.length: " + span.childNodes.length); &lt;!-- Script provides the `snippet` object, see http://meta.stackexchange.com/a/242144/134069 --&gt; &lt;script src="http://tjcrowder.github.io/simple-snippets-console/snippet.js"&gt;&lt;/script&gt; What little we have in the way of a spec for innerHTML is quite vague on what should happen to the old content, but surely this is wrong, even if Microsoft did invent innerHTML. Whereas removing the nodes via removeNode doesn't cause this behavior: var span = document.createElement('span'); span.appendChild(document.createTextNode("This disappears on IE")); var div = document.createElement('div'); div.appendChild(span); snippet.log("[before] span's childNodes.length: " + span.childNodes.lengt…
has comment: http://stackoverflow.com/comment/54005630
score: 5
has comment: http://stackoverflow.com/comment/45776877
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28741528
downvote count: 0
has comment: http://stackoverflow.com/comment/54000944
accepted answer of: http://stackoverflow.com/q/28741528
type: Answer

http://stackoverflow.com/a/28676170
answers question: http://stackoverflow.com/q/28633194
type: AcceptedAnswer
type: Answer
upvote count: 1
has body: I approached the problem from a new perspective using a parent_key on every TR and querying against all the array in search of those objects that have that parent_key, changing it's properties. Now I have the start of a fully functional table tree. //Won't work below IE9, but totally safe otherwise !function() { function _dynamicSortMultiple(attr) { /* * save the arguments object as it will be overwritten * note that arguments object is an array-like object * consisting of the names of the properties to sort by */ var props = arguments; return function (obj1, obj2) { var i = 0, result = 0, numberOfProperties = props.length; /* try getting a different result from 0 (equal) * as long as we have extra properties to compare */ while(result === 0 &amp;&amp; i &lt; numberOfProperties) { result = _dynamicSort(props[i])(obj1, obj2); i++; } return result; }; } function _dynamicSort(property) { var sortOrder = 1; if(property[0] === "-") { sortOrder = -1; property = property.substr(1); } return function (a,b) { var result = (a[property] &lt; b[property]) ? -1 : (a[property] &gt; b[property]) ? 1 : 0; return result * sortOrder; } } Object.defineProperty(Array.prototype, "sortBy", { enumerable: false, writable: true, value: function() { return this.sort(_dynamicSortMultiple.apply(null, arguments)); } }); }(); var TD = React.createClass({ onHandleClick: function(event) { this.props.onHandleClick(this.props.data.key); }, render: function() { var iparent = this.props.data.deep*20; var icon = "fa-chevron-down"; return ( &lt;td style={{paddingLeft: iparent+'px'}}&gt; &lt;span onClick={this.onHandleClick} className={"fa "+icon}&gt; &amp;nbsp;&lt;/span&gt; {this.props.data.label} &lt;/td&gt; ); } }) var TR = React.createClass({ onHandleClick: function(TD) { this.props.onHandleClick(TD); }, render: function() { if (this.props.data.isShown) { return ( &lt;tr&gt; &lt;TD data={this.props.data} onHandleClick={this.onHandleClick}/&gt; &lt;/tr&gt; ); } else { return ( &lt;tr&gt; &lt;/tr&gt; )…
score: 1
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28633194

http://stackoverflow.com/q/28719886
type: Question
type: AnsweredQuestion
tagged with: javascript
has body: I want to generate click able table grid using javascript. My code is not working. I created 2 text input fields for get values for row and column. Button that will call drawGrid() function onClick event. &lt;input type="text" name="enter" class="enter" value="" id="inputX"/&gt; &lt;input type="text" name="enter" class="enter" value="" id="inputY"/&gt; &lt;input type="button" value="click" onclick="drawGrid();"/&gt; &lt;script language="JavaScript"&gt; function drawGrid(){ document.write('&lt;table border="1"&gt;'); var x_start = 1; var x_end = document.getElementById('inputX').value; var y_start = 1; var y_end = document.getElementById('inputY').value; // loop over all x values (rows) sequentally for( var x=x_start; x &lt;= x_end; x++ ){ // open the current row document.write('&lt;tr&gt;'); // loop over all y values (cols) sequentally for( var y=y_start; y &lt;= y_end; y++ ){ // write out the current x/y coordinate with a table cell document.write('&lt;td&gt; x:'+x+' y:'+y+'&lt;/td&gt;'); } // end the current row document.write('&lt;/tr&gt;'); document.write('&lt;/table&gt;'); } } &lt;/script&gt;
has answer: http://stackoverflow.com/a/28723265
tagged with: html-table
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28723265
has title: How to generate click able table grid using Javascript
score: 1
upvote count: 1

button
tags question: http://stackoverflow.com/q/28596284
tags question: http://stackoverflow.com/q/28667778
tags question: http://stackoverflow.com/q/28708360
tags question: http://stackoverflow.com/q/28722399
tags question: http://stackoverflow.com/q/28659678
type: Tag
tags question: http://stackoverflow.com/q/28684605
tags question: http://stackoverflow.com/q/28724800
tags question: http://stackoverflow.com/q/28685912
tags question: http://stackoverflow.com/q/28650506
tags question: http://stackoverflow.com/q/28666031
tags question: http://stackoverflow.com/q/28726449
tags question: http://stackoverflow.com/q/28605339
tags question: http://stackoverflow.com/q/28749033
tags question: http://stackoverflow.com/q/28707955
tag name: button
tags question: http://stackoverflow.com/q/28712337

http://stackoverflow.com/comment/45532738
has text: Thanks but I do not want fullscreen mode, I want it windowed but "maximized", eg: width = screen width and height = available screen height. As for using screen.height/width, that's what I'm doing now but it seems to keep making the window too large and it's actually larger than the monitor's display
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28610825

http://stackoverflow.com/a/28727653
has comment: http://stackoverflow.com/comment/45742357
type: Answer
upvote count: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/45815145
answers question: http://stackoverflow.com/q/28727478
has body: In your view model, you'll want to hook into your router by creating a computed that listens to the value of the current instruction: var ko = require('knockout'); var router = require('plugins/router'); function viewModel() { this.currentRoute = ko.computed(function() { return router.activeInstruction().fragment; }); } Then you can reference this variable using the visible binding in your view. &lt;!-- home route only --&gt; &lt;div data-bind="visible: currentRoute() == 'home'&gt;&lt;/div&gt; &lt;!-- non-home routes --&gt; &lt;div data-bind="visible: currentRoute() != 'home'&gt;&lt;/div&gt; If you need more complicated logic, you can create a special computed function that does specific testing against the current route and reference that variable instead. For example: this.isSpecialRoute = ko.computed(function() { var re = /matchspecialroute/; return re.test(this.currentRoute()); }, this);
has comment: http://stackoverflow.com/comment/45754451
accepted answer of: http://stackoverflow.com/q/28727478
score: 5
type: AcceptedAnswer

http://stackoverflow.com/q/28697397
downvote count: 0
tagged with: javascript
score: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28697539
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: Question
upvote count: 1
answer count: 1
tagged with: audio
has answer: http://stackoverflow.com/a/28697539
has body: Objective: User taps a button. A random audio track is selected (among 3 tracks) and plays in the background. Problem: The track plays on desktop Chrome and Firefox, but does not play on Mobile Chrome. JS: function play() { var a = Math.random() * 3; a = Math.floor(a); if (a == 0) { document.getElementById('soundtrack').innerHTML = " Your browser does not support the audio element. "; } if (a == 1) { document.getElementById('soundtrack').innerHTML = " Your browser does not support the audio element. "; } if (a == 2) { document.getElementById('soundtrack').innerHTML = " Your browser does not support the audio element. "; } } HTML: How do I make this play on Mobile browsers? This is event driven (tap button) and not auto-play. It should play but does not.
has title: Playing Random Audio Tracks on mobile browsers
tagged with: mobile

http://stackoverflow.com/q/28660891
possible better answer: http://stackoverflow.com/a/28661115
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28661115
downvote count: 0
has answer: http://stackoverflow.com/a/28661128
favorite count: 0
has comment: http://stackoverflow.com/comment/45617370
has comment: http://stackoverflow.com/comment/45617183
type: Question
has body: I have a div of online users which are dynamically inserted: John Maria Tony Then I have a div for private messages: Now, I'm struggling how to dynamically append a div inside the messageBox when I click on the user. What I need is this below: //when I click on John from users div this below should be appended //when I click on Maria from users div this below should be appended and John above //will be hidden //when I click on Tony from users div this below should be appended and John and Maria //will be hidden Whatever I tried, the divs inside messageBox get appended more than once. Can someone help me to solve this with jQuery please? Link: fiddle
upvote count: 2
tagged with: append
has comment: http://stackoverflow.com/comment/45617642
has answer: http://stackoverflow.com/a/28661208
has answer: http://stackoverflow.com/a/28661113
has title: jQuery append to div on click from the different div
has answer: http://stackoverflow.com/a/28661141
has comment: http://stackoverflow.com/comment/45617420
has comment: http://stackoverflow.com/comment/45617250
answer count: 5
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45617381
accepted answer: http://stackoverflow.com/a/28661113

http://stackoverflow.com/comment/45755315
type: Comment
type: QuestionComment
has text: @squiroid Thanks for replay, it is showing same error as i shown above.
comment on: http://stackoverflow.com/q/28735081
score: 0

http://stackoverflow.com/comment/45627116
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28664050
type: Comment
has text: You do not need `JSON.stringify()` just `data: $('#form1').serialize();` will work (assuming you do have a containing element with `id="#form1`). If the only control in that container was the `@Html.EditorFor(model => model.customer.UserName` then `console.log($('#form1').serialize()); will output `customer.UerName=someValue` which will correctly bind to the model. But if your not using `Html.BeginForm()` to generate the ` ` tag, using `@Html.ValidationMessageFor()` is a bit pointless if your expecting client side validation

http://stackoverflow.com/a/28634663
score: 3
has body: You could also use an attribute selector rather than escaping the . characters. $('span[id="Ribbon.Tabs.InfoPathListTab.Views.ddViews-Medium"]').hide(); Example Here
answers question: http://stackoverflow.com/q/28634618
upvote count: 3
type: Answer
downvote count: 0

http://stackoverflow.com/q/28711513
accepted answer: http://stackoverflow.com/a/35905026
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
has title: how do I edit the navigation menu in AngularJS theme?
has comment: http://stackoverflow.com/comment/45711453
has body: So, I bought a template from envato market. It's an admin panel responsive theme created with bootstrap and AngularJS. I want to edit the theme. I've edited the navigation links in the nav.html file and also in the config.router.js file, where they were defined as .state blocks. But they are still not showing the names I want them to. Is there any other place where all these name are being declared? And also, I want some more toggle buttons on the off-sidebar. I've added them but I don't know where to define their models and other things like IDs and classes. Documentation doesn't provide any information about the files in which these menus are defined. Here's the link to the theme. Here's the .states for the links in main navigation: $stateProvider.state('app', { url: "/app", templateUrl: "assets/views/app.html", resolve: loadSequence('modernizr', 'moment', 'uiSwitch', 'perfect-scrollbar-plugin', 'perfect_scrollbar', 'toaster', 'ngAside', 'vAccordion', 'sweet-alert', 'chartjs', 'tc.chartjs', 'oitozero.ngSweetAlert'), abstract: true }).state('app.dashboard', { url: "/dashboard", templateUrl: "assets/views/dashboard.html", resolve: loadSequence('jquery-sparkline', 'sparkline', 'dashboardCtrl'), title: 'Dashboard', ncyBreadcrumb: { label: 'Dashboard' } }).state('app.prospects', { url: '/prospects', template: ' ', title: 'Prospects', ncyBreadcrumb: { label: 'Prospects' } }) And this is relevant anchor tag in the nav.html file: Dashboard PIPELINE Prospects
tagged with: angular-ui
favorite count: 0
has comment: http://stackoverflow.com/comment/45711577
has comment: http://stackoverflow.com/comment/45711514
tagged with: angularjs
upvote count: 2
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/35905026
score: 2
type: AnsweredQuestion
tagged with: angular-ui-router

http://stackoverflow.com/q/28714010
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
linked to: http://stackoverflow.com/q/7770412
has comment: http://stackoverflow.com/comment/45715785
tagged with: versioning
score: 1
has body: I name my javascript files with an md5 hash of the content. So, if there is an update of the file, the filename will change. Could someone explain why browsers are still refering to an "old" filename, until I force the browser to load the new file? (F5,...). The problem in this question seems identical, but I think the mentioned solution will not fix the problem ("Deactivate the cache in your browser."). Thanks!
tagged with: caching
type: Question
downvote count: 0
has comment: http://stackoverflow.com/comment/45716934
tagged with: javascript
has title: Javascript Cache Issue
has comment: http://stackoverflow.com/comment/45716281

http://stackoverflow.com/a/28735569
has comment: http://stackoverflow.com/comment/45760537
score: 87
has comment: http://stackoverflow.com/comment/45756602
accepted answer of: http://stackoverflow.com/q/28735459
type: AcceptedAnswer
has body: Here is the code which validates the youtube url- function validateYouTubeUrl() { var url = $('#youTubeUrl').val(); if (url != undefined || url != '') { var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&amp;v=|\?v=)([^#\&amp;\?]*).*/; var match = url.match(regExp); if (match &amp;&amp; match[2].length == 11) { // Do anything for being valid // if need to change the url to embed url then use below line $('#ytplayerSide').attr('src', 'https://www.youtube.com/embed/' + match[2] + '?autoplay=0'); } else { // Do anything for not being valid } } } Fiddle Url: https://jsfiddle.net/cpjushnn/12/
has comment: http://stackoverflow.com/comment/45764514
type: Answer
has comment: http://stackoverflow.com/comment/65149303
has comment: http://stackoverflow.com/comment/45763663
upvote count: 89
has comment: http://stackoverflow.com/comment/94929554
has comment: http://stackoverflow.com/comment/45757061
has comment: http://stackoverflow.com/comment/45760342
has comment: http://stackoverflow.com/comment/65144297
has comment: http://stackoverflow.com/comment/45764219
downvote count: 2
answers question: http://stackoverflow.com/q/28735459
has comment: http://stackoverflow.com/comment/81863497

http://stackoverflow.com/comment/45532167
comment on: http://stackoverflow.com/q/28614459
type: Comment
has text: In other words, you do not want to declare this script in the master page, and only apply it to the first content page, right?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45759112
has text: Are you wanting to pass entire html pages to the client, or just the data to display in them?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28737397

http://stackoverflow.com/a/28689936
type: AcceptedAnswer
downvote count: 0
score: 5
type: Answer
accepted answer of: http://stackoverflow.com/q/28676293
answers question: http://stackoverflow.com/q/28676293
has body: I found a solution to this problem. If anyone comes accross this issue, here is the answer. canvas.on('mouse:up', function (e) { //check if user clicked an object if (e.target) { //clicked on object alert('clicked on object'); }else{ //add rectangle addrect(e.e.clientY, e.e.clientX, 100, 100, "#CCCCC"); } }); This solution is defined in http://fabricjs.com/fabric-intro-part-2/#events . Here on mouse click I am checking if its an object on canvas. If its not an object I add a new rectangle. Hope this helps :)
upvote count: 5

http://stackoverflow.com/q/28711591
has comment: http://stackoverflow.com/comment/45711548
accepted answer: http://stackoverflow.com/a/28711662
tagged with: servlets
has answer: http://stackoverflow.com/a/28711628
type: AnsweredQuestion
tagged with: jsp
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28711662
tagged with: ajax
type: Question
possible better answer: http://stackoverflow.com/a/28711616
has answer: http://stackoverflow.com/a/28711616
score: 0
answer count: 3
has title: How to get the clicked element's ID
has body: I want to retrieve the ID of the clicked element (on the 'onclick; event. &lt;script&gt; function myFunction(element) { var $id = element.id; $($id).click(function() { $.get('ajaxTestSrvlt?test=1', function(responseText) { $('#firstName').val(responseText); with the response text. }); }); }; &lt;/script&gt; This is the element this function was called upon. I would like to get the ID of this raw from the above script. This only works when I directly give the "clickableRow" as to id to the Script. The "ID" is to be changed dynamically &lt;tr id="clickableRow" style="cursor: pointer;" class='clickable-row' data-href="#" data-toggle="modal" data-target="#editModal" onclick="myFunction(this)"&gt;

http://stackoverflow.com/q/28666514
answer count: 1
has answer: http://stackoverflow.com/a/28666552
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28666552
score: 0
type: AnsweredQuestion
has body: I am trying to have a text area where the user can put text in; basically when the user clicks the button, it should calculate the number of words, the length of the shortest word, and the word; also the average length of the words, and the RMS(Root-mean-square) of the length of the words.The text area will have pre-loaded text but it should clear out the text area when user clicks on the text area so they can put whatever they want. This is what i got so far: $(document).ready(function () { $("#btnCalculate").click(function(){ var text = $("#txtInput").val(); text = text.replace(/\.|,|;/g, ""); //eliminate punctuation //the g makes it a global replace not a replacement of the first occurrence text = text.toLowerCase(); //put all text into lower case text = text.replace(/\bi\b/g, "I"); // \b means word boundary so \bi\b means an i by iteslf which should be I text = text.replace(/\s+/g, " "); //replace white space with a simple space if (text.charAt(text.length - 1) == " ") { text = text.substring(0, text.length - 1); // if space at end get rid of } //longest word count function longestWord(str) { var words = str.replace(/[^A-Za-z\s]/g, "").split(" "); var wordsByDescendingLength = words.sort(function (a, b) { return b.length - a.length; }); return wordsByDescendingLength[0]; } }); //shortest word });
has title: Calculate Number Of Words based on user's input
type: Question

http://stackoverflow.com/comment/45723314
comment on: http://stackoverflow.com/a/28717240
type: AnswerComment
score: 0
type: Comment
has text: I did a test with background-image and the filter worked on background-img. Is it this? http://jsfiddle.net/5ddsj2ap/1/

http://stackoverflow.com/comment/127835369
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/72265631
type: Comment
has text: @Timo I've added a line to the end of the snippet to show usage.

http://stackoverflow.com/q/28738426
has comment: http://stackoverflow.com/comment/45761322
score: 0
has body: I am uploading an image via ajax and wanna instantly update them in the user profile picture element. it works but the problem is, that the image is not moved perfectly until i refreshed the site 1-2 times. var t = new Date().getTime(), avatar = $("img.user-avatar"), src = avatar.attr("src"); src = src.substr(0, src.indexOf("?") &gt; 0 ? src.indexOf("?") : src.length); avatar.attr("src", src + "?" + t); resizeAndMoveAvatar(); the resizeAndMoveAvatar() function looks like this: function resizeAndMoveAvatar() { var Avatar = $("img.user-avatar"); var w = Avatar.width(), h = Avatar.height(); Avatar.css({ 'max-width': 'none', 'max-height': 'none' }); if(w &gt; h) { Avatar.css('max-height', 32); w = Avatar.width(); Avatar.css('left', -(w/2 - 32/2)); } else if(h &gt; w) { Avatar.css('max-width', 32); h = Avatar.height(); Avatar.css('top', -(h/2 - 32/2)); } else { Avatar.css({width: 32, height: 32}); } } when I update it its look like this: but it should like this: any suggestions how I can fix this problem? thank you!
has comment: http://stackoverflow.com/comment/45765004
tagged with: image-uploading
has comment: http://stackoverflow.com/comment/45764168
type: AnsweredQuestion
has title: Updating an Image and resize them faults
has comment: http://stackoverflow.com/comment/45762996
type: Question
has comment: http://stackoverflow.com/comment/45762124
answer count: 1
has comment: http://stackoverflow.com/comment/45764599
tagged with: javascript
has answer: http://stackoverflow.com/a/28741226
accepted answer: http://stackoverflow.com/a/28741226
linked to: http://stackoverflow.com/q/5933230
tagged with: image

http://stackoverflow.com/q/28688468
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/28669127
has answer: http://stackoverflow.com/a/28688657
accepted answer: http://stackoverflow.com/a/28688657
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
has title: delete the current and also delete the before it using plain javascript
downvote count: 0
type: Question
has body: I have this HTML structure: REMOVE THIS This is an entry <~~~~~~~~~~ THIS SPAN $ Verified LOL And I hope that the entire REMOVE THIS plus its contents will be remove completely This is what I have so far: function showAlert() { var projectDescriptions = document.querySelectorAll('tr.project-description'), projectDescriptions = Array.prototype.slice.call(projectDescriptions); projectDescriptions.forEach(function(el) { if (el.querySelector('span.verfied-badge')) { }else { el.parentNode.removeChild(el); el.prev('tr').remove(); } }); } What it does is select the with the I am looking for, then delete the entire span. This part el.prev('tr').remove(); is not working, any alternative? Thanks!
has answer: http://stackoverflow.com/a/28688583
possible better answer: http://stackoverflow.com/a/28688583
upvote count: 2
answer count: 2

http://stackoverflow.com/comment/45665145
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28686083
type: AnswerComment
has text: Thank you. I don't know how I didn't notice this.

http://stackoverflow.com/q/28711916
has body: I'm facing a problem in my website please help me this is my website link http://istinye.superpaket.org $(function() { $('li.page-scroll').bind('click', function(event) { var $anchor = $(this); $('html, body').stop().animate({ scrollTop: $($anchor.attr('href')).offset().top }, 1500, 'easeInOutExpo'); event.preventDefault(); }); }); When i click on any nav menu button div appear very fast. i want to appear the div slowly not fast. for example when i click on "Menü" button, the div menu appear but very fast i want to this effect slowly. Thanks in advance...
answer count: 3
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28712001
has answer: http://stackoverflow.com/a/28711973
has title: on click div appear slowly
type: UnansweredQuestion
tagged with: css
score: 2
has answer: http://stackoverflow.com/a/28712087
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/45712041
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45723376
comment on: http://stackoverflow.com/q/28706615
has text: No, the mean is not for the whole graph. I'm looking to place a mean line on each bar in the graph - just like the median line (probably a different color, or otherwise styled differently). I've seen the "theoretical mean" that is drawn as a graph plot line for the whole graph on some of their examples. What I'm after is a line drawn on each of the boxes just like the median line. And just like the median value is passed in, I would expect to pass in the mean value. I will update my post with an updated fiddle.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46423321
comment on: http://stackoverflow.com/q/28718657
type: Comment
type: QuestionComment
has text: `Then you'll need media queries for every expected pixel ratio though` yeah that's the problem I'm trying to avoid. besides I don't want to scale everything on the page. Just part of it.
score: 0

http://stackoverflow.com/comment/45577159
score: 1
has text: because "arrays" are built on associative arrays. meanings you can do blah[1]= oor blah['bsf']= and associate anything. But normal ol arrays use length to know that associations 0 -> length-1 are a "array"
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28638734

http://stackoverflow.com/comment/45659863
comment on: http://stackoverflow.com/q/28683333
has text: Can you post your code? I imagine you are most likely trying to do something synchronous with asynchronous code.
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/q/28716015
has title: Cake php form helper. Substitute input values
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: php
type: UnansweredQuestion
score: 1
upvote count: 1
has body: Im use cakephp 1.3. I have form like this: <? __('Select one'); ?> <?=$this->Form->input('Bla.bla1', array( 'class' => 'form-control', 'label' => false, 'div' => false, 'options' => array( 'option1' => 'value1', '0ption2' => 'value2', 'option3' => 'value3' ) ));?> <? __('Select two'); ?> <?=$this->Form->input('Bla.bla2', array( 'class' => 'form-control', 'label' => false, 'div' => false, 'options' => array( 'option1' => 'value1', '0ption2' => 'value2', 'option3' => 'value3' ) ));?> <? __('text one'); ?> <?=$this->Form->input('Bla.bla3', array( 'class' => 'form-control validate[required]', 'label' => false, 'div' => false, 'type' => 'text' ));?> <!-- * * There more inputs with 'type' => 'text' * --> So i have 2 selects and ~10 inputs. I need to when you select, for example, 'value1' in 'Select one' and 'value3' in 'Select two' insert values in my inputs depending on selects values. This values (default texts) stored in array. How can i do something like this?
has answer: http://stackoverflow.com/a/28721092
tagged with: cakephp-1.3
type: Question
tagged with: javascript

http://stackoverflow.com/q/28626897
accepted answer: http://stackoverflow.com/a/28626987
possible better answer: http://stackoverflow.com/a/28626949
has answer: http://stackoverflow.com/a/28626949
tagged with: javascript
has comment: http://stackoverflow.com/comment/45554503
answer count: 2
tagged with: jquery
favorite count: 0
has body: Here is my code: Jump for Joy Sale Here is my jsfiddle. When an image is clicked it shows a random discount and it should hide it after clicking again, however it instead shows the discount again and again. I tried using remove event, but it isn't working.
has answer: http://stackoverflow.com/a/28626987
has title: Remove event in jQuery not working
score: -1
type: AnsweredQuestion
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/45554485
type: Question
has comment: http://stackoverflow.com/comment/45554803

http://stackoverflow.com/comment/45672219
type: Comment
comment on: http://stackoverflow.com/a/28684542
has text: true enough. My thinking was more about the OP scope - a browser game. Then you use flash more often. Or something like unity, which also provides networking support.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45768377
score: 0
type: Comment
type: QuestionComment
has text: `this.draw {` ... You could have tried to isolate the problem instead of dumping the whole code to SO...
comment on: http://stackoverflow.com/q/28742744

http://stackoverflow.com/comment/45668530
comment on: http://stackoverflow.com/a/28654371
score: 0
type: Comment
has text: @Henry Sorry I forgot to tag you.. Anyways the explanation for the use of `||` in JavaScript is that it doesn't actually work like an "or" statement, but rather it will just keep executing until it encounters a truthy (or rather non-falsy) value to return. If it can't find one it will return false (or at least a falsy value). `&&` on the other hand works exactly as expected and will return either true or false.
type: AnswerComment

http://stackoverflow.com/comment/45588929
score: 0
type: Comment
has text: @slaur4: In fact, that the object syntax is malformed causes the *parser* to drop the "first" value (or, in strict mode, to throw a syntax error). `isMatch` is not to blame here, any other method would work the same - except when it would take object 2 as JSON and used a tolerant parser internally.
type: QuestionComment
comment on: http://stackoverflow.com/q/28632281

http://stackoverflow.com/a/54417662
upvote count: 1
has body: I think you are looking for that : $('.tooltip_hover_n_click').tooltipster({ delay: 100, trigger: 'custom' // disable all by default }).mouseover(function(){ // show on hover $(this).tooltipster('show'); }).blur(function(){ // on click it'll focuses, and will hide only on blur $(this).tooltipster('hide'); }).mouseout(function(){ // if user doesnt click, will hide on mouseout if(document.activeElement !== this){ $(this).tooltipster('hide'); } });
downvote count: 0
score: 1
type: Answer
answers question: http://stackoverflow.com/q/28684592

http://stackoverflow.com/q/28699439
accepted answer: http://stackoverflow.com/a/28700947
has title: Create options onClick attribute
type: Question
possible better answer: http://stackoverflow.com/a/28700335
has comment: http://stackoverflow.com/comment/45748993
downvote count: 0
has answer: http://stackoverflow.com/a/28700335
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28699731
has body: This is the idea: When I click on "word1" (or "word2") the select tag shows me the options. Once I click on one of the options, my script change "word1" (or "word2") whit the option. I can update the options, but once I click on one of them the script always write the last option. The script write the same onClick attribute for all the options... I've been searching a lot but I cannot understand why it happen, and how to solve it. Here is the code: function updatemyselect(currentElement, optionsList) { var mySelect = document.getElementById("mySelect"); var i; //Clear the options mySelect.options.length = 0; //Add the options for (i = 0; i < optionsList.length; i++) { var option = document.createElement("option"); var newWord = optionsList[i] option.text = newWord; option.onclick = function() { currentElement.innerHTML = newWord; }; mySelect.add(option); } } Word1 Word2 Thanks in advance
has answer: http://stackoverflow.com/a/28700947
answer count: 4
tagged with: html-select
upvote count: 3
has answer: http://stackoverflow.com/a/28731963
has comment: http://stackoverflow.com/comment/45689160
linked to: http://stackoverflow.com/q/12750307
type: AnsweredQuestion
score: 3
tagged with: onclick

http://stackoverflow.com/q/28747040
accepted answer: http://stackoverflow.com/a/28756612
score: 0
tagged with: ember-table
answer count: 1
tagged with: ember.js
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/29071528
has answer: http://stackoverflow.com/a/28756612
has body: in Ember Table, I need to change style of a cell with the change of particular cell content. I need to add color to cell with value update (that I have already done) and remove styles after 1 second (that I want to do). I have called setTimeout when applying color and removed color within setTimeout. It does not work all the time. some cell colors are not removed. (this gets worse when scrolling). I assume after 1 second, Ember cannot find the particular cell element. I use and Ember table component and assigned a contentBinding and columnBinding. I added a template for the Ember.Table.TableCell component and added class names. Added Main Function and modified Jsbin example below.
type: Question
has title: How to apply 'Blink' feature in Ember Table?
tagged with: javascript

http://stackoverflow.com/q/28616534
type: UnansweredQuestion
has body: i have an ajax call and i am getting a response from the call. the code is like this: &lt;div id="flow_#id#~#sid#" style="margin: 0 10px 0 0;float:right;height:150px;" class="code"&gt; &lt;img src="/assets/codes/#code#.jpg" style="max-height: 230px;"&gt; &lt;/div&gt; What i am doing is the response i get from my ajax, i want to replace the contents of the div tag with the value coming from my ajax success ajax call is like this $.ajax({ url: 'bc.cfm?ID=' + getID + '&amp;ssID=' + getSID, type: "GET", cache: false, success: function(data){ $("#flow_" + getID + "~" + getSID + " img:last-child").remove(); $("#flow_" + getID + "~" + getSID).html(data); } }); But a complete html page is coming in success, i can the img in firebug, but a complete html source is there, how can i extract that img tag and replace with the one which is already there above [the id is going to be same for both for identification, only 1 will be used, we will be removing and adding again]
has comment: http://stackoverflow.com/comment/45536395
has comment: http://stackoverflow.com/comment/45538404
has comment: http://stackoverflow.com/comment/45537120
has answer: http://stackoverflow.com/a/28617660
type: Question
has comment: http://stackoverflow.com/comment/45536716
has comment: http://stackoverflow.com/comment/45536342
answer count: 2
has title: get only specific data in success message from ajax
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45537227
has answer: http://stackoverflow.com/a/28617229
tagged with: ajax
has comment: http://stackoverflow.com/comment/45536268
score: 0

http://stackoverflow.com/comment/45783850
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28750162
has text: Just figured it out. I'd never used a background script before, I didn't realize that you had to debug it from clicking on the link in the extensions window.
score: 0

http://stackoverflow.com/q/28654641
tagged with: javascript
has answer: http://stackoverflow.com/a/28654654
type: AnsweredQuestion
type: Question
has body: String joined with single variable is executing properly in setTimeout() function setTimeout("document.getElementById('err_box').innerHTML = "+selected_troops.length, 1000); But when I join multiple variable in same string. It is not executing. setTimeout("document.getElementById('err_box').innerHTML = "+selected_troops.length+" Men "+varues, 1000); And this is also not executing ("string"+variable+"string") setTimeout("document.getElementById('err_box').innerHTML = "+selected_troops.length+" Men", 1000);
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45606186
has title: String joined with multiple variables are not executing in setTimeout()
accepted answer: http://stackoverflow.com/a/28654654
possible better answer: http://stackoverflow.com/a/28654653
has answer: http://stackoverflow.com/a/28654653
score: 0
answer count: 2
tagged with: dom

http://stackoverflow.com/q/28659038
tagged with: javascript
has comment: http://stackoverflow.com/comment/45613760
tagged with: ascii
score: 0
tagged with: function
answer count: 1
has body: i have a function here takes input parameter. it then iterates and changes the values from Ascii to strings im using node.js and testing files and for some reason my code is adding a space to the result. any help please? function stringify(input) { var result = ""; for (var i=0; i&lt;=input.length; i++) { result+=String.fromCharCode(input[i]); } return result; }
favorite count: 0
type: UnansweredQuestion
has title: My JS is adding a space when converting ascii to string
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/28659072
type: Question

http://stackoverflow.com/a/28618698
answers question: http://stackoverflow.com/q/28616702
score: 0
type: Answer
has body: &lt;?php $username = $_GET['username']; include_once('includes/conn.inc.php'); $query = ("SELECT comicID, comicName FROM comic WHERE username = '$username'"); $result = mysqli_query($conn, $query); while ($row = $result-&gt;fetch_assoc()) { echo "&lt;br&gt;&lt;input name='comicList' id='".$row['comicID']."' type='radio' value='".$row['comicID']."'&gt;".$row['comicName']." &lt;/option&gt;"; } ?&gt; ajaxRequest.onreadystatechange = function() { if(ajaxRequest.readyState == 4) { document.getElementById('loadList').innerHTML=""; document.getElementById("divComics").innerHTML=xmlhttp.responseText; } } ajaxRequest.open("GET", "delCom.php?username=MY_EXACT_NAME_I_KNOW_WORKS_HERE", true); ajaxRequest.send(null);
has comment: http://stackoverflow.com/comment/45541040
has comment: http://stackoverflow.com/comment/45541460
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28616702

http://stackoverflow.com/comment/45606847
has text: I think this might simply be due to the fact that the for loop `for(var i=index; i>0; i--)` only runs while `i` is greater than zero, whereas it should run as long as `i` is greater-equal zero.
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/28654886

http://stackoverflow.com/comment/45671989
has text: What are success function doing? Maybe you can use some dynamic DOM manipulation instead?
comment on: http://stackoverflow.com/q/28690056
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45547356
score: 0
type: Comment
type: QuestionComment
has text: Sorry fo these "`" but Stackoverflow has error and I must do this to send this message...
comment on: http://stackoverflow.com/q/28605076

http://stackoverflow.com/a/28626684
score: 1
answers question: http://stackoverflow.com/q/28626513
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28626513
type: Answer
has body: When working with JavaScript or jQuery on your website - if something isn't working as you intend - the first thing you should do is check the browser console to see if anything is being logged there. To check the browser console: Hit F12 on your keyboard. When the developer tools open, choose the console tab, its placed in the toolbar at the top of the new window. In the console you will see a few errors in red with error codes (404). A 404 means the requested file wasn't found. This tells us that your reference to jQuery isn't correct. This could be because the file path you've written isn't correct, or that you haven't deployed those files correctly to your site. Check your file paths you've referenced and make sure the file is on your server. Once both are correct - the errors should go away. Here's a link to view more about developer tools: https://developer.chrome.com/devtools#console
upvote count: 1

http://stackoverflow.com/q/28669835
tagged with: http://stackoverflow.com/tag/html
upvote count: 0
tagged with: cordova
has body: I have list of RSS feed (rss page) in mobile app. I want to open each feed link once clicked, in different tab (in Android) and in iOS want to open _blank. Below code works fine for me. First issue is I need to click once in empty place on rss page, then it works; otherwise app replaced itself with the external hyperlink webpage. Second issue as many times I click anywhere in rss page or rss links; on next rss click it opens that many tabs. (e.g I click 3 times in empty space in page and already 2 times visit rss links; on next hyberlink click, it tries to open 5 tabs). index.html HTML: Grants New Opportunity List by Agency Grants New Opportunity feed.js function rssfeedbtn() { $('#myfeeddiva').empty(); $.mobile.changePage("#rssfeed", {reverse:false, transition:"slide"}); var rssurl='http://www.ddd.ddd/rss/asdd.xml'; $.get(rssurl, function(data) { var $xml = $(data); var mytext=""; $xml.find("item").each(function() { mytext+=''; mytext+=$(this).find("title").text(); mytext+=''; mytext+=' '; mytext+=$(this).find("pubDate").text(); mytext+=' '; mytext+=' '; }); $('#busy1').hide(); $('#myfeeddiva').append(mytext); }); }
tagged with: hybrid-mobile-app
type: Question
type: AnsweredQuestion
has title: Why first click anywhere in empty space in document initiate the code instead of clicking on hyperlink and why too many tabs open?
score: -2
downvote count: 2
has answer: http://stackoverflow.com/a/28669949
accepted answer: http://stackoverflow.com/a/28669949
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45635041

http://stackoverflow.com/q/28647061
score: 0
has comment: http://stackoverflow.com/comment/45592025
has title: Redirecting user on failed Accounts.validateLoginAttempt
tagged with: meteor
tagged with: iron-router
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45591760
has comment: http://stackoverflow.com/comment/45591869
answer count: 0
has comment: http://stackoverflow.com/comment/45591901
has comment: http://stackoverflow.com/comment/45591735
type: Question
has comment: http://stackoverflow.com/comment/45591795
has comment: http://stackoverflow.com/comment/45592007
has body: all. I'm working on a new Meteor project, and I'm using e-mail verification (mandatory) for all new accounts. I want to keep people from being able to log into the application when their e-mail isn't verified, but I have a question. I'm using the following code: // Refuse login from non-verified users Accounts.validateLoginAttempt(function(attempt){ if (attempt.user &amp;&amp; attempt.user.emails &amp;&amp; !attempt.user.emails[0].verified ) { return false; // the login is aborted } return true; }); To handle the 'rejected login', but I want to redirect the user to a page on the app that tells them why they can't log in (a simple view that will say 'hey, go verify your e-mail'. Seeing as how this bit of code is server-side, how am I supposed to redirect the client to a page based on the failure of their login attempt? I'm confused. I'm using Iron Router, and the newest version of Meteor available. Thanks in advance for any assistance.
tagged with: javascript
has comment: http://stackoverflow.com/comment/45591828

http://stackoverflow.com/comment/45684207
type: QuestionComment
comment on: http://stackoverflow.com/q/28696540
has text: You could make use of a kendoValidator, simply indicating what is required in the html markup, and attach this one to the form, as long as it isn't valid, the submit button won't be enabled. See this link: http://docs.telerik.com/kendo-ui/api/javascript/ui/validator
score: 0
type: Comment

http://stackoverflow.com/comment/45665586
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28683504
has text: Your title is a fallacy. You cannot determine if the form is valid without "running" through the validation.

http://stackoverflow.com/comment/45568629
type: QuestionComment
type: Comment
score: 2
comment on: http://stackoverflow.com/q/28619731
has text: Turbolinks is known to cause issues with loading JavaScript between pages. Which portion of the JavaScript isn't getting triggered? Try adding `$(document).on('page:load', ready);` after `$(document).ready(ready);`

http://stackoverflow.com/comment/45562143
type: QuestionComment
comment on: http://stackoverflow.com/q/28631053
has text: Post it in question itself, this is unreadable in comment. BTW, a jsFiddle would make it clearer
score: 1
type: Comment

http://stackoverflow.com/comment/45651248
comment on: http://stackoverflow.com/q/28679048
type: QuestionComment
type: Comment
score: 3
has text: This should work `ng-model="expense[key]" `

http://stackoverflow.com/a/28687583
upvote count: 1
has body: Second attempt, now that I understand your question a little better. You can use a MutationObserver to output changes to the DOM. Something as simple as var observer = new MutationObserver(function (mutations) { mutations.forEach(function (mutation) { console.log(mutation); }); }) observer.observe(document.body, { attributes: true, childList: true, characterData: true, subtree: true }); var hiders = document.querySelectorAll('.hider'), hiders = Array.prototype.slice.call(hiders); hiders.forEach(function(el) { el.parentNode.removeChild(el); }); &lt;div class="hider"&gt;&lt;/div&gt; &lt;div class="hider"&gt;&lt;/div&gt; in the window's load handler will work, and will output a MutationRecord on each change. I'd bet one of those will be your element (specifically, the removedNodes of the record.) The browser console for this snippet will have what you'll see if you use this.
answers question: http://stackoverflow.com/q/28687483
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/comment/45643649
comment on: http://stackoverflow.com/a/28675046
type: Comment
has text: it shows that it has uploaded one file band shows "you cannot upload more files" for the rest but still doesn't work
score: 0
type: AnswerComment

http://stackoverflow.com/a/28656831
has comment: http://stackoverflow.com/comment/45610132
type: Answer
has comment: http://stackoverflow.com/comment/45610110
has comment: http://stackoverflow.com/comment/45610190
upvote count: 3
has comment: http://stackoverflow.com/comment/45714775
has comment: http://stackoverflow.com/comment/45610060
score: 3
has comment: http://stackoverflow.com/comment/45657388
accepted answer of: http://stackoverflow.com/q/28656596
has comment: http://stackoverflow.com/comment/45715080
answers question: http://stackoverflow.com/q/28656596
type: AcceptedAnswer
downvote count: 0
has body: You need to write below two lines wherever you want to inject your directive element to DOM, don't forget to add $document &amp; $compile dependency wherever you use it. var template = '&lt;calender&gt;&lt;/calender&gt;', body = $document.find('body'); body.append($compile(template)(scope));
has comment: http://stackoverflow.com/comment/45610174

http://stackoverflow.com/q/28690410
has comment: http://stackoverflow.com/comment/45672444
possible better answer: http://stackoverflow.com/a/28690613
has answer: http://stackoverflow.com/a/28690613
has answer: http://stackoverflow.com/a/28690567
type: AnsweredQuestion
tagged with: oop
type: Question
accepted answer: http://stackoverflow.com/a/28690567
has comment: http://stackoverflow.com/comment/45672956
has comment: http://stackoverflow.com/comment/45673128
tagged with: function
has body: Hello Im having problems returning a value from the AmountToDisplay() function I feel like a module approach would be appropriate but since I'm new to OOP I've been having problems setting that up function AmountToDisplay(){ $emitter = $({}); $('#amountItems').change(function(){ var amountchosen = $("#amountItems option:selected").val(); $emitter.trigger('amountUpdate', amountchosen); }); $emitter.on('amountUpdate', function(e, val){ if(val == 2){ return 2; }else if(val == 3){ return 3; }else if(val == 4){ return 4; } }) } I want to be able to do something like if(AmountToDisplay() ==2){ ..append 2 items to body }else if(AmountToDisplay() ==3){ ..append 3 items to body } console.log(AmountToDisplay()) gives undefined instead of returning and I use the alert method alert(2), it works. I'm trying to get the values out of the select box so I could decouple separate the value from the event so I could use the value in other part of my code other parts in my code in this jsfiddle. Thanks in advance for your help. EDIT THE thing is I want to be able to use the amount somewhere out of the change event. so if the user clicked 3 I want to be able to have that value so I could perform another function not related to the change event even though the value changes when the user inputs. pub/sub?
has title: having problems returning value from functions
tagged with: javascript
has comment: http://stackoverflow.com/comment/45672388
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28690702
tagged with: events

http://stackoverflow.com/comment/45567147
comment on: http://stackoverflow.com/a/28633341
type: AnswerComment
score: 1
type: Comment
has text: That's what i'm talking about! .. Now, it returned a list of urls but what if i want to use every url alone? .. btw you're genius :)

http://stackoverflow.com/comment/45635196
comment on: http://stackoverflow.com/a/28669707
type: AnswerComment
score: 0
type: Comment
has text: SOLVED! thank you. I created a function with inside promiseCanceller.resolve("user cancelled"); promiseCanceller = $q.defer(); and i call it just before http call. It works!

http://stackoverflow.com/a/28668745
accepted answer of: http://stackoverflow.com/q/28645036
type: Answer
has body: Move your ng-controller="TypeaheadController" statement to parent div, it will work fine.
score: 0
answers question: http://stackoverflow.com/q/28645036
type: AcceptedAnswer

http://stackoverflow.com/a/28607032
score: 0
has body: Simple use max-width in css. width: 100% max-width: 500px;
answers question: http://stackoverflow.com/q/28601519
type: Answer

http://stackoverflow.com/a/29176220
has comment: http://stackoverflow.com/comment/104304104
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28703820
upvote count: 5
type: Answer
has comment: http://stackoverflow.com/comment/46570266
has comment: http://stackoverflow.com/comment/73029615
has body: Pass *.bind(null,this) instead; See this Google Groups thread for explanation.
accepted answer of: http://stackoverflow.com/q/28703820
score: 5

http://stackoverflow.com/comment/81220764
type: Comment
comment on: http://stackoverflow.com/a/38134429
has text: what about a typescript react project?
score: 0
type: AnswerComment

dom-events
tags question: http://stackoverflow.com/q/28723198
tags question: http://stackoverflow.com/q/28679271
tags question: http://stackoverflow.com/q/28722441
tags question: http://stackoverflow.com/q/28640410
tags question: http://stackoverflow.com/q/28746595
tags question: http://stackoverflow.com/q/28669970
tags question: http://stackoverflow.com/q/28686936
tags question: http://stackoverflow.com/q/28599769
tags question: http://stackoverflow.com/q/28689701
tags question: http://stackoverflow.com/q/28742419
tags question: http://stackoverflow.com/q/28710807
tags question: http://stackoverflow.com/q/28627882
type: Tag
tags question: http://stackoverflow.com/q/28748773
tags question: http://stackoverflow.com/q/28643457
tags question: http://stackoverflow.com/q/28710702
tag name: dom-events
tags question: http://stackoverflow.com/q/28611879
tags question: http://stackoverflow.com/q/28666596
tags question: http://stackoverflow.com/q/28665784
tags question: http://stackoverflow.com/q/28666704
tags question: http://stackoverflow.com/q/28703060
tags question: http://stackoverflow.com/q/28649386
tags question: http://stackoverflow.com/q/28656675

object-tag
type: Tag
tags question: http://stackoverflow.com/q/28727620
tag name: object-tag

http://stackoverflow.com/comment/45522525
comment on: http://stackoverflow.com/q/28609179
score: 2
has text: In chrome I get `3, undefined` in a [fiddle](http://jsfiddle.net/tLpbm2rg/).
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28651710
has body: So I found a solution after few research, I just entered this one line of code &lt;meta name="viewport" content="width=device-width, initial-scale=0.33, maximum-scale=1" /&gt; into head section, adjusted scale and it worked. It doesn't work as good as like bootstrap or a code for designed for mobile, but it fixed. Thanks for help.
answers question: http://stackoverflow.com/q/28608870
accepted answer of: http://stackoverflow.com/q/28608870
type: AcceptedAnswer
score: 0
type: Answer

package.json
tag name: package.json
tags question: http://stackoverflow.com/q/28636506
type: Tag

http://stackoverflow.com/q/28727753
has comment: http://stackoverflow.com/comment/45763283
tagged with: kendo-grid
has title: How to display JSON response in kendo grid?
tagged with: javascript
tagged with: kendo-ui
score: 0
has answer: http://stackoverflow.com/a/28769171
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
has body: I have kendo window popup from another grid where i want to show detail of selected record.i am not seeing data in the grid once i got response from server.I am new to Angularjs i need help to implement code in CTRL.JS Any help or suggetion will be appreciated. code tried so far... CTRL.JS $scope.vendorWinOptions = subCategoryGridConfig.vendorWinConfig; $scope.vendorDetailOptions = subCategoryGridConfig.VendorsDetailGrid; $scope.showDetail = function(id) { var dataToReturn = subCategoryGridConfig.VendorsDetailGrid; dataToReturn.dataSource = { transport : { read : function(options) { SubCategory.getAllVendors().then(function(response) { options.success = (response.data); }) } } } return dataToReturn; $scope.$broadcast('openDetailWindow'); }; FACTORY.JS getAllVendors: function(subcategoryId){ return $http.get('/third-party-management/rest/vendor/' + subcategoryId); } JSON.JS id: 1 parentAribaId: "18682" subCatogeryCode: "X99.99.171" subCatogeryName: "PROFESSIONAL SERVICES BUNDLED WITH TECHNOLOGY PURCHASES" vendorAribaId: "18682" vendorBusinessName: "SAP" vendorLineOfBusiness: {id: 4, vendorBusinessIdentifier: "278070", primaryLOb: "GTO", secondaryLob1: "GHR",…} id: 4 primaryLOb: "GTO" secondaryLob1: "GHR" secondaryLob2: "GHR" vendorBusinessIdentifier: "278070" vendorName: "SAP" modalgridconfig.js VendorsDetailGrid: { scrollable: true, filterable: false, scrollable: false, columns: [{ field: 'vdrDetail.parentAribaId', title: 'Ariba ID', width: '32px' }, { field: 'vdrDetail.vendorName', title: 'Vendor Name', width: '25px' }, { field: 'vdrDetail.vendorName', title: 'Vendor Parent', width: '30px' }, { field: 'vdrDetail.vendorBusinessName', title: 'LOB Owner', width: '30px' }] }
type: Question

http://stackoverflow.com/comment/45646208
score: 1
has text: It seems that you are using the debug variants of the jquery lib. Use the minified version instead ( that makes for a size reduction of about 2/3, 250kB -> 80 kB ). Also consider keeping a local copy of the jquery lib instead of fetching it from jquery.com. Finally, consider fetching all the samples asynchronously - your subjects won't need them rifht after loading the page.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28676091

http://stackoverflow.com/q/28633869
upvote count: 3
has answer: http://stackoverflow.com/a/30207342
type: UnansweredQuestion
tagged with: handlebars.js
has title: ParseError: Unexpected token with Browserify and template files
score: 3
has body: I'm developing a site using Backbone and I have Watchify running to bundle the application. Everything works fine with the javascript modules, but I am having a problem with .hbs templates, with Watchify throwing parse errors when processing the template files. These are really simple templates, the one in question literally contains only this html: Hello world! I have installed hbsfy am invoking it thusly: watchify ./app/main.js -t hbsfy -o static/js/bundle.js -v The error returned: /home/***/***/backbone_app/app/node_modules/templates/layout.hbs:1 Hello world! ^ ParseError: Unexpected token I've read over the docs and looked in several locations online and honestly can't see what I am doing wrong here. Thanks for any insight you can offer.
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: jst
has answer: http://stackoverflow.com/a/37493941
tagged with: node.js
tagged with: backbone.js

http://stackoverflow.com/a/28751626
has comment: http://stackoverflow.com/comment/46051867
score: 4
has comment: http://stackoverflow.com/comment/45802014
type: Answer
has comment: http://stackoverflow.com/comment/45801787
accepted answer of: http://stackoverflow.com/q/28725690
answers question: http://stackoverflow.com/q/28725690
has comment: http://stackoverflow.com/comment/46259631
has comment: http://stackoverflow.com/comment/46062217
has comment: http://stackoverflow.com/comment/45811949
has body: EDIT 2 - Revised answer based on comments: From comments, I understand that the object model you have is along the following lines: metaItem.fieldOptions = {0: {optionValue: "Supplier"}, 1: {optionValue: "SomethingA"}, 2: {optionValue: "SomethingB"}}; And you want the selected values to populate the fieldValue object. So, say, for selected keys 0 and 2, the following appears: issueForView.metaData[subIndex].fieldValue = {0: "Supplier", 2: "SomethingB"}; and the problem is if you deselect 0, you get this: issueForView.metaData[subIndex].fieldValue = {0: "", 2: "SomethingB"}; But you want this: issueForView.metaData[subIndex].fieldValue = {2: "SomethingB"}; Answer: This is easily solved if you assigned undefined in ng-false-value: &lt;input type="checkbox" ng-model="issueForView.metaData[subIndex].fieldValue[key]" ng-true-value="'{{option.optionValue}}'" ng-false-value="undefined"&gt; plunker ==== Original answer: Simply put, you want the model set in ng-model to be "some string" if true, and empty object {} - if false, right? Then, just set these as the ng-true-value and ng-false-value: &lt;input type="checkbox" ng-model="foo" ng-true-value="'some string'" ng-false-value="{}"&gt; To apply it directly to your example, &lt;div ng-repeat="(key,option) in metaItem.fieldOptions"&gt; &lt;input type="checkbox" ng-model="issueForView.metaData[subIndex].fieldValue[key]" ng-true-value="'{{option.optionValue}}'" ng-false-value="{}"&gt; {{option.optionPlaceholder}} &lt;/div&gt; EDIT: If, instead of "some string", you want to set your model to an object, you could supply an object literal hardcoded inline: &lt;input type="checkbox" ng-model="foo" ng-true-value="{0: 'Supplier'}" ng-false-value="{}"&gt; In your example, where this object is set dynamically within ng-repeat's iteration, then it's better if you have that object literal prepared. Say, you had option.optionValue === {0: "Supplier"} for this iteration (doesn't look like you do, but that would be the right approach, sinc…
upvote count: 4
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/44597742
upvote count: 5
type: Answer
answers question: http://stackoverflow.com/q/28607451
has body: Array.prototype.reduce() can be used to delete elements by condition from an array but with additional transformation of the elements if required in one iteration. Remove undefined values from array, with sub-arrays support. function transform(arr) { return arr.reduce((memo, item) =&gt; { if (typeof item !== "undefined") { if (Array.isArray(item)) item = transform(item); // We can transform item here. memo.push(item); } return memo; }, []); } let test1 = [1, 2, "b", 0, {}, "", , " ", NaN, 3, undefined, null, 5, false, true, [1, true, 2, , undefined, 3, false, ''], 10]; console.log(transform(test1)); Try it on jsfiddle.net/bjoy4bcc/
score: 4
downvote count: 1

http://stackoverflow.com/a/28703008
has comment: http://stackoverflow.com/comment/45695957
downvote count: 0
answers question: http://stackoverflow.com/q/28702851
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45696242
score: 1
has body: Do you want to have the functions available in the array or function calls with those specific values? Just to have the calls, you can do: var a = []; a.push(draw_cylinder); a.push(draw_sphere); a.push(draw_cone); a.push(draw_cube); a[2](17,0,7,3); If you want the latter, you'd want to use bind to curry the function: var a = []; a.push(draw_cylinder.bind(null, 0, 0, 3, 2)); a[0](); // will do whatever draw_cylinder(0,0,3,2) does Currying functions - http://www.crockford.com/javascript/www_svendtofte_com/code/curried_javascript/index.html Bind documentation - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
has comment: http://stackoverflow.com/comment/45695963

http://stackoverflow.com/comment/45634700
score: 0
has text: --Which if are we talking about here?-- nevermind saw the comment just now
comment on: http://stackoverflow.com/q/28670350
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45749873
type: QuestionComment
has text: This sounds a lot like some homework assignment. Try first searching in google for "random number javascript" and go from there.
score: 1
comment on: http://stackoverflow.com/q/28731944
type: Comment

http://stackoverflow.com/q/28617976
score: 0
has title: Use variable wrapped in squiggly brackets in array?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28618150
has body: I've downloaded a plugin that does something like the following: &lt;span class="block block_{icon}"&gt;&lt;/span&gt; Where {icon} seems to be a variable's value (?). How can I use {icon} as a key in an array, i.e. something like array[{icon}]?
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28618149
tagged with: javascript

view
tags question: http://stackoverflow.com/q/28708116
tags question: http://stackoverflow.com/q/28659148
type: Tag
tag name: view

http://stackoverflow.com/a/28728005
upvote count: 6
answers question: http://stackoverflow.com/q/28727919
has body: You have to define your controller var app = angular.module('app', []); app.controller('Ctrl', ['$scope',function($scope) { $scope.age = 24; }]);
downvote count: 0
has comment: http://stackoverflow.com/comment/45743881
type: Answer
score: 6

http://stackoverflow.com/q/28670805
downvote count: 1
type: Question
upvote count: 9
has body: I am trying to add an event to a button: str = "a#fCoverage" // my locator def str2 = "\$('" + str + "').addEventListener('click', function(){alert('text')});" // add event js.exec(str2) But I get this error: error: org.openqa.selenium.WebDriverException: unknown error: $ is not defined Could anyone help me please?
tagged with: java
has comment: http://stackoverflow.com/comment/45637807
answer count: 2
tagged with: groovy
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45637469
score: 8
tagged with: selenium-webdriver
has answer: http://stackoverflow.com/a/46349638
has answer: http://stackoverflow.com/a/28673410
has title: How fix selenium-webriver error - $ is not defined?
type: UnansweredQuestion
tagged with: selenium

http://stackoverflow.com/q/28598848
tagged with: javascript
has title: Prevent mousemove fire upon elementFromPoint
has body: DEMO: http://jsfiddle.net/2FWZD/ Here is jsfiddle code since its force me to add code: $(document).ready(function () { $('.test').on('mousemove', function (e) { counter++; $('.counter').text(counter); $(this).hide(); // Comment out the following line and counter will stop increasing document.elementFromPoint(e.clientX, e.clientY); $(this).show(); }); }); This happens in chrome, is there anyway to prevent this or an alternative method to elementFromPoint ? Bug detailed here: https://code.google.com/p/chromium/issues/detail?id=333623 Edit 1: I just want to note while the answer is a cleaver hack to the jsfiddle demo it doesn't actually solve the underlying issue I have. I am using Leap Motion to simulate a mouse on a website which sends simulated mousedown and mouseup events and also mousemoves. I use a canvas to draw the cursor on top of everything and use the technique shown here to access the element that is just underneath the canvas. Upon doing that the mousemove is triggered at the REAL mouse location and not my simulated mouse, effectively giving me weird issues. This isn't an issue for FireFox. Edit 2: Issue Solves. See Answer. Using other methods of hiding besides hide() seem to work without triggering
has answer: http://stackoverflow.com/a/28651074
has comment: http://stackoverflow.com/comment/45599016
answer count: 4
has answer: http://stackoverflow.com/a/28650638
possible better answer: http://stackoverflow.com/a/28650903
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28650404
has comment: http://stackoverflow.com/comment/45598180
score: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/28650404
type: Question
has comment: http://stackoverflow.com/comment/45598155
upvote count: 2
has comment: http://stackoverflow.com/comment/45598182
has comment: http://stackoverflow.com/comment/45599075
has comment: http://stackoverflow.com/comment/45598062
tagged with: google-chrome
downvote count: 1
has comment: http://stackoverflow.com/comment/45599434
has answer: http://stackoverflow.com/a/28650903

http://stackoverflow.com/q/28704433
tagged with: dynamic
score: 1
has title: Dynamically loaded AngularJS application
upvote count: 1
tagged with: integration
type: Question
possible better answer: http://stackoverflow.com/a/28705038
has answer: http://stackoverflow.com/a/28727970
accepted answer: http://stackoverflow.com/a/28727970
tagged with: javascript
answer count: 2
has body: I'm looking to integrate an AngularJS web application into a number of websites. I'd like to be able to provide each website administrator with an HTML code, such as the following: &lt;div id='angular-integration-app'&gt;&lt;/div&gt;&lt;script src="widget.js"&gt;&lt;/script&gt; With this HTML code inserted into the website, the website should load AngularJS and insert an AngularJS application as a child element of the element labeled with the ID of "angular-integration-app." This Plunker has an implementation, however this implementation isn't working. It fails intermittently, with an error of: Uncaught ReferenceError: angular is not defined application.js:1 Uncaught Error: [$injector:modulerr] angular.js:38 I've noticed that it usually works fine the first time it's loaded, but when the browser refresh button is pressed, it often fails. This is particularly true when it's not being hosted through Plunker. Please advise on the best way to create a dynamic AngularJS application integration that works all the time.
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28705038
tagged with: angularjs
type: AnsweredQuestion

http://stackoverflow.com/q/28625897
tagged with: javascript
has title: Change Div Class with Javascript if DateTime variable is passed
has comment: http://stackoverflow.com/comment/45553002
score: 0
answer count: 2
has body: Good Morning, I have Written a Dashboard for work written in PHP and Javascript. It pulls Data from our database and shows events in Divs with a class of Dash, Showing a Variable of $nextupdate, I need to write some Js that will compare the DateTime Now and if the $nextupdate variable time is past then i need to change the Div Class to .overdue, I am struggling to figure out how would be the best way to solve this any help would be much appreciated Regards Steve
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: php
tagged with: css
has answer: http://stackoverflow.com/a/28629728
has comment: http://stackoverflow.com/comment/45552651
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28629728
has comment: http://stackoverflow.com/comment/45552789
type: Question
has answer: http://stackoverflow.com/a/28626425
accepted answer: http://stackoverflow.com/a/28626425

http://stackoverflow.com/q/28660096
has answer: http://stackoverflow.com/a/28660668
score: 0
answer count: 2
has title: jQuery Smooth Scroll to ID on same and on other page: how to set offset?
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28660668
type: AnsweredQuestion
tagged with: scroll
tagged with: offset
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28661276
has body: Im using jQuery on my page to jump / scroll to IDs. This works from other pages with anchors like Jump & Scroll to ID on other page and on the same page only with anchors like Jump / Scroll to ID on the same page Thats not the best solution because I have to change my nav menue but it works (I load another menue with other tags on the page). Now im looking for a way to add an offset of -230px to the scroll / jump script, beause I have a fixed header on my page. I think its simple but unfortunately im not a jQuery pro. How can I do this? Please Help me to add the -230 Offset to this function :) The jQuery Code: (function($){ var jump=function(e) { if (e){ e.preventDefault(); var target = $(this).attr("href"); }else{ var target = location.hash; } $('html,body').animate( { scrollTop: $(target).offset().top },1000,function() { location.hash = target; }); } $('html, body').hide() $(document).ready(function() { $('a[href^=#]').bind("click", jump); if (location.hash){ setTimeout(function(){ $('html, body').scrollTop(0).show() jump() }, 0); }else{ $('html, body').show() } }); })(jQuery)
possible better answer: http://stackoverflow.com/a/28661276

http://stackoverflow.com/comment/45512560
type: Comment
type: QuestionComment
has text: If you're loading the frame content from the same domain where you're going to display the iframe, have a look at this. I'm using it and it's working absolutely well...https://github.com/davidjbradshaw/iframe-resizer
comment on: http://stackoverflow.com/q/28603805
score: 0

http://stackoverflow.com/a/28630054
has body: select tags aren't easily customizable with CSS. Therefore, we usually need to hide the original select and create a new element that will be customized with CSS and JS. For example, given the following select: Category 1 Category 2 Category 3 Category 4 Category 5 Category 6 Category 7 Category 8 Category 9 Category 10 First, we hide the original select: var dropdown = $('.Dropdown').hide(); Then, we create a new div element, and append it to our page: var newDropdown = $(' ') // create new div element .addClass('NewDropdown') // with class NewDropdown .appendTo(document.body); // and append it to page For each option in our original select, we create an element inside our new dropdown. dropdown.find('option').each(function(index, element){ var option = $(element); // this is the option from the original select var newOption = $(' ') // create new div element .addClass('NewDropdown-item') // with class NewDropdown-item .html(option.html()) // copy content from original option .data('value', option.val()) // copy value from original option .on('click', onClicked) // add a click listener .appendTo(newDropdown); // append it to the new dropdown }); For convenience, we will store the newly created dropdown items in a variable: var newDropdownOptions = newDropdown.find('.NewDropdown-item'); When one of the items in the new dropdown is clicked, we mark it as selected and set the original select's value. function onClicked(){ newDropdownOptions.removeClass('is-selected'); // deselect all items var clickedOption = $(this); // wrap clicked option in jquery clickedOption.addClass('is-selected'); // add class to mark clicked option as selected dropdown.val(clickedOption.data('value')); // set original select's value }; JSFiddle link: https://jsfiddle.net/Lhrmcouz/
has comment: http://stackoverflow.com/comment/45621037
upvote count: 2
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28629359
type: Answer
accepted answer of: http://stackoverflow.com/q/28629359
score: 2
downvote count: 0

http://stackoverflow.com/comment/58752805
type: AnswerComment
comment on: http://stackoverflow.com/a/28695155
type: Comment
has text: After I obtained the exponent and mantissa, how do I construct the 16-bit FP? The exponent is an integer which is easy, but how to turn the mantissa part to the 10-bit fraction ? Can you make it more clear? Will dividing the mantissa with the unit value work?
score: 0

http://stackoverflow.com/comment/45556543
type: Comment
comment on: http://stackoverflow.com/q/28627860
score: 0
has text: the problems seems to be the chosen key, in Chrome 40 Ubuntu full screen mode can only be closed with F11 key, not ESC
type: QuestionComment

http://stackoverflow.com/q/28655044
favorite count: 0
has answer: http://stackoverflow.com/a/28655062
type: Question
has comment: http://stackoverflow.com/comment/45607095
possible better answer: http://stackoverflow.com/a/28655062
linked to: http://stackoverflow.com/q/23970431
score: 4
answer count: 2
has answer: http://stackoverflow.com/a/28655100
linked to: http://stackoverflow.com/q/16063394
has body: if I just use obj.prototype.property = val, everything will be ok, code like function animal() {} var frog = new animal(); animal.prototype.color = 'Green'; console.log(frog.color); // 'Green' But if I use obj.prototype = {key:val} after new keyword, it will give me a undefined, code like function animal() {} var frog = new animal(); animal.prototype = { color: 'Green' }; console.log(frog.color); // 'undefined' -- why? And if I change the order which let the prototype before the new keyword, it will be ok, so weird and why? because we know an object’s prototype allows us adding properties to all instances of that object (even to the existing instances), right? code like function animal() {} animal.prototype = { color: 'Green' }; var frog = new animal(); console.log(frog.color); // 'Green'
upvote count: 4
has title: Why replacing constructor function's prototype is not reflected in the Objects?
has comment: http://stackoverflow.com/comment/45625225
accepted answer: http://stackoverflow.com/a/28655100
type: AnsweredQuestion
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/28659588
has comment: http://stackoverflow.com/comment/45614734
score: 1
has title: Stop form submit from javascript
tagged with: forms
upvote count: 1
has comment: http://stackoverflow.com/comment/45614795
type: Question
has answer: http://stackoverflow.com/a/28659659
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28659659
has body: I have prepared this demo for the problem http://jsfiddle.net/20k4ur8o/ As you can see when you try to submit the form via the input it is stopped but when you click the button the form submits. How can I prevent the form from submitting when .submit() is called without overwriting the default behavior of the function, because I need to also keep other submit listeners active when it is called? HTML Submit JS document.getElementById('form').addEventListener('submit', function (e) { e.preventDefault(); alert('stopped'); }, false); document.getElementById('submit').onclick = function () { document.getElementById('form').submit(); }
has comment: http://stackoverflow.com/comment/45614724
has comment: http://stackoverflow.com/comment/45615309
answer count: 2
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/28659631
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28659631
linked to: http://stackoverflow.com/q/24248576
type: AnsweredQuestion

http://stackoverflow.com/q/28712561
has answer: http://stackoverflow.com/a/28712701
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45713149
has body: I've attempted to build a table that appears when the window is a certain size. Now I want to work it to be more responsive by making the table hidden once a window reaches a certain size. I've seen window.onresize(), but I'm not sure how to implement it with the following code. if (iedom||document.layers){ with (document){ document.write('&lt;table style="display:block" border="0" cellspacing="0" cellpadding="0"&gt;&lt;td&gt;') document.write('&lt;/td&gt;&lt;/table&gt;') } }
possible better answer: http://stackoverflow.com/a/28712701
type: Question
answer count: 2
has title: Hide element on window resize
tagged with: javascript
has comment: http://stackoverflow.com/comment/45713349
score: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28712626
tagged with: web
has comment: http://stackoverflow.com/comment/45713124
has answer: http://stackoverflow.com/a/28712626
has comment: http://stackoverflow.com/comment/45713344
tagged with: css

http://stackoverflow.com/q/28702884
tagged with: javascript
score: 0
has title: How to use a variable in an aggregate query in mongoose/node.js
has body: I've got a very basic Mongoose aggregate query Transaction.aggregate().match({ timestamp : { $gt : time_lower_bound, $lt : time_upper_bound } }).group({ _id : '$currencyFrom', count : { $sum : 1 } }).sort({ count : -1 }) I wanted to make the _id dynamic. But i tried var field = job.data.field; Transaction.aggregate().match({ timestamp : { $gt : time_lower_bound, $lt : time_upper_bound } }).group({ _id : '$' . field, count : { $sum : 1 } }).sort({ count : -1 }) and it doesn't return the correct data, it returns [ { _id: null, count: 473 } ] so i'm missing something obvious here.
answer count: 1
has answer: http://stackoverflow.com/a/28702932
accepted answer: http://stackoverflow.com/a/28702932
tagged with: node.js
type: AnsweredQuestion
type: Question
tagged with: mongodb
tagged with: mongoose

http://stackoverflow.com/a/31277912
score: 1
has body: Try this npm install bson and npm update
type: Answer
answers question: http://stackoverflow.com/q/28651028
upvote count: 2
downvote count: 1

http://stackoverflow.com/q/28744335
answer count: 2
has title: Unable to redirect using angular routeprovider
tagged with: ngroute
has answer: http://stackoverflow.com/a/28744713
has answer: http://stackoverflow.com/a/28812619
tagged with: route-provider
tagged with: angularjs
type: UnansweredQuestion
has body: i am new to angular i when i am not able to redirect to the signup.html page when i hit the locahost:port/projectname/ eventhough i specified the template url for singup in app.js i am getting 404 but when i hit the locahost:port/projectname/signup.html the file was opening am i doing anything wrong? i want to get the signup.html when i hit locahost:port/projectname/ app.js var app = angular.module('pollApp', ['ngRoute']); app.config(['$routeProvider',function($routeProvider){ $routeProvider .when('/Welcome', { templateUrl: '/Welcome.html', controller: 'submitCtrl' }) .when('/', { templateUrl: '/signup.html', controller: 'submitCtrl' }) .otherwise({ redirectTo: '/Welcome.html' }); }]); submitController.js app.controller('submitCtrl',['$scope', '$http', '$location', function ($scope, $http, $location) { $scope.timeZones = [ { label: '(GMT-09:00) Alaska', value: 'Alaska' }, { label: '(GMT-08:00) Pacific Time (US &amp;amp; Canada)', value: 'Pacific Time (US &amp;amp; Canada)' } ]; $scope.submit=function() { var userDetails=new Object(); userDetails.firstname=$scope.firstname; userDetails.lastname=$scope.lastname; userDetails.Companyname=$scope.Companyname; userDetails.Email=$scope.Email; userDetails.timezone=$scope.timezone; console.log(userDetails); $http({ method: 'POST', data: userDetails, url:'/mongopractise/rest/signup/userdata', headers: {'Content-Type':'application/json'} }).success(function(data, status, headers, config) { console.log("success data"+JSON.stringify(data)); $scope.username=data; $location.url('/Welcome.html').replace();; }). error(function(data, status, headers, config) { console.log("Failure data"+data); }); } }]); Signup.html &lt;html lang="en" ng-app="pollApp"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt; &lt;title&gt;Welcome!&lt;/title&gt; &lt;script src="lib/angular.js"&gt;&lt;/script&gt; &lt;link href="css/b…
type: Question
tagged with: javascript
score: 0

dc.js
tag name: dc.js
tags question: http://stackoverflow.com/q/28639889
tags question: http://stackoverflow.com/q/28732380
tags question: http://stackoverflow.com/q/28658493
type: Tag

http://stackoverflow.com/comment/45629898
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28667743
has text: Can you create a page to reproduce the error?

http://stackoverflow.com/comment/45572562
type: QuestionComment
has text: Check name attribute...
comment on: http://stackoverflow.com/q/28636462
score: 0
type: Comment

http://stackoverflow.com/q/28644340
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28799619
linked to: http://stackoverflow.com/q/19696308
tagged with: javascript
has title: How do i get base64 encoded image from clipboard in internet explorer?
favorite count: 0
has comment: http://stackoverflow.com/comment/45836065
accepted answer: http://stackoverflow.com/a/28799619
score: 8
linked to: http://stackoverflow.com/q/3263724
tagged with: clipboard
linked to: http://stackoverflow.com/q/12928117
linked to: http://stackoverflow.com/q/15351508
has body: I searched a lot but didnt find getting base64 encoded data from clipboard. I can catch paste event and then assign event to variable with this clipBoard = e.clipboardData ? e.clipboardData : window.clipboardData; in chrome; i can get print screen which has been paste, like this if (clipBoard.types[0] == "Files") { var blob = clipBoard.items[0].getAsFile(); var reader = new FileReader(); reader.onload = function(event){ console.log(event.target.result); }; // data url! reader.readAsDataURL(blob); } but in ie 11 clipBoard variable has no "items" or "types". i will upload that image server but i didnt get base64 encoded data.
has comment: http://stackoverflow.com/comment/45783502
downvote count: 1
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28692310
upvote count: 9
has answer: http://stackoverflow.com/a/28692310
tagged with: internet-explorer-11

http://stackoverflow.com/comment/45638839
has text: try `style="position: absolute; top: 0%;"` for 1st div, then `style="position: absolute; top:100%` for next div, then `style="position: absolute; top: 200%` for next and soon
comment on: http://stackoverflow.com/q/28672631
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45585091
has text: did you update the path in casperjs.cmd or somewhere else?
comment on: http://stackoverflow.com/q/28643401
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28637594
answers question: http://stackoverflow.com/q/28637416
has body: The problem is in your result from function getElementsByClassName. For AutoComplete you need an element, not an array. function addressLookup() { var address = document.getElementById('pickup'); var address2 = document.getElementById('destination'); var options = { componentRestrictions: { country: 'uk' } }; new google.maps.places.Autocomplete(address, options); new google.maps.places.Autocomplete(address2, options); }
type: Answer
score: 0

http://stackoverflow.com/comment/45519766
comment on: http://stackoverflow.com/a/28607594
has text: Not necessarily more code. You write the ugly bits (the loader/bootstrapper) once and then all the modules are pretty simple. It looks like you're trying to force node to be something it's not. In general you never want to block on the main thread.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45773099
has text: I didn't know. I've got a link to it from the guy above. Thank you !
type: Comment
comment on: http://stackoverflow.com/q/28743794
score: 0
type: QuestionComment

http://stackoverflow.com/q/28635379
has body: I am creating a cookie using the following code: var cnm="exampleCookie"; var exdays=365*4; var exdate=new Date(); exdate.setDate(exdate.getDate() + exdays); var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString()); document.cookie=cnm + "=" + c_value; However, instead of saving the cookie until the date it expires, Firefox (v 35.0.1) deletes the cookie when the session ends. This does not happen in Chrome, and Firefox does not delete other cookies on the same site. I've also used this same JS code on a github-hosted page and it retains the cookie after the browser closes. Examining the cookie after it is set (using Cookies Manager+ addon) shows that it is set with an expiration date. How can I make it so Firefox stops deleting this cookie?
has title: Firefox deleting specific cookie at end of session
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28635794
tagged with: cookies
type: Question
tagged with: firefox
answer count: 1
tagged with: javascript
score: 0

http://stackoverflow.com/q/28731190
score: 0
has answer: http://stackoverflow.com/a/28731384
tagged with: css
has title: Window resize events and media queries do not fire when window height is changed at heights under 500px
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28731384
tagged with: responsive-design
type: Question
answer count: 1
tagged with: javascript
has body: I'm working with a responsive design that includes vertical breakpoints. I'm seeing that CSS media queries as well as window resize events do not fire once the window height is less than 500px. This may seem like a fringe use case, but folks with disabilities do frequently adjust screen resolutions leaving less available height. When the window height is less than 500px, horizontal resize events still fire, but not vertical ones. I couldn't find any info on this, and I did lose some time trying to understand what I was seeing, so I thought I'd share the experience and ask if anyone knows anything about it. I observed this behavior in IE10, Firefox, and Chrome.

http://stackoverflow.com/comment/45755227
has text: Thanks for taking a look. You are correct regarding the additional trigger statement (I have removed it and it still selected). However, looking at the example findByUid you posted, I am following the same steps as the example: get the dataItem from the datasource using $("#treeview").data('kendoTreeView').dataSource.get(id) then pass the uid from the found dataitem to the $("#treeview").data("kendoTreeView").findByUid() method. Unless I am missing something?
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28734818
score: 0

http://stackoverflow.com/comment/45553243
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28626093
has text: you can learn browser javascript.. u will solve your puzzles
score: 0

http://stackoverflow.com/q/28689043
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28689181
has comment: http://stackoverflow.com/comment/45670090
tagged with: css
favorite count: 0
type: UnansweredQuestion
has title: Save the position of a draggable div in jquery
has body: I have some draggable divs in my jsp which i can drag all around the page.After dragging there is one save button,On click of which i want to save the positions of grid in cookie or database whichever solution is better.Please suggest how can i do that.Below is my draggable code This div is draggable
tagged with: jquery-ui
has comment: http://stackoverflow.com/comment/45670158
has comment: http://stackoverflow.com/comment/45670222
type: Question
upvote count: 4
answer count: 2
has answer: http://stackoverflow.com/a/28689271
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 4

http://stackoverflow.com/comment/45679634
has text: I just confused @mort,, you have to help me.. please?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28694143
type: Comment

npr-api
type: Tag
tags question: http://stackoverflow.com/q/28685573
tag name: npr-api

http://stackoverflow.com/comment/45762093
score: 0
type: Comment
type: QuestionComment
has text: Try double click(first click for hover)
comment on: http://stackoverflow.com/q/28738785

http://stackoverflow.com/comment/83423810
has text: your answer saved my day :)
comment on: http://stackoverflow.com/a/28730164
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28700251
upvote count: 5
has comment: http://stackoverflow.com/comment/45703379
tagged with: node.js
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/45691945
tagged with: socket.io
linked to: http://stackoverflow.com/q/52676171
possible better answer: http://stackoverflow.com/a/60372737
type: Question
answer count: 2
score: 5
has answer: http://stackoverflow.com/a/28700480
accepted answer: http://stackoverflow.com/a/28700480
tagged with: javascript
has title: How can a client know if the emit failed? Is there any callback for socket.emit()?
has comment: http://stackoverflow.com/comment/45691250
has answer: http://stackoverflow.com/a/60372737
has body: If the client emit some msg to the server, is there any way for client to know if this emit is failed or not ? I think it my be some callback like : socket.emit("test",dataToSend,function(err){ });
favorite count: 0

http://stackoverflow.com/comment/45642203
type: QuestionComment
has text: Oh, I get it. q1 and q2 are variables? So you can use `fill( eval("q"+count) )`.
score: 2
comment on: http://stackoverflow.com/q/28674461
type: Comment

http://stackoverflow.com/a/28655185
type: Answer
has body: Use the method setData Highcharts - setData
answers question: http://stackoverflow.com/q/28647017
score: 0

http://stackoverflow.com/a/28712941
type: Answer
answers question: http://stackoverflow.com/q/28712860
has body: You need to emit the dynamic value of the ID attribute in your HTML like so: $('#&lt;%= Label1.ClientID %&gt;').text($(this).val()); You should adopt this way of working everywhere in your client script blocks (e.g. in your keyup event above as well)
score: 0

http://stackoverflow.com/q/28605619
has comment: http://stackoverflow.com/comment/45515643
accepted answer: http://stackoverflow.com/a/28605909
upvote count: 1
has comment: http://stackoverflow.com/comment/45515832
type: Question
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28605838
tagged with: http://stackoverflow.com/tag/json
has body: I need parse JSON answer containing this structure { "TariffItems": [ { "TariffId": "89", "TariffCode": "Y", "TariffRusName": "Эконом" }, { "TariffId": "67", "TariffCode": "C", "TariffRusName": "Бизнес" }, { "TariffId": "87", "TariffCode": "J", "TariffRusName": "Премиум" } ] } When I see this in Firebug it's showing that each TariffItems wraped in object and this mean that following jquery cannot get values. How should I change this? $.ajax({ url: "/Home/GetTariffs", type: "post", cache: false, success: function (result) { $.each(result, function () { $("#tariffs").append($("&lt;button class='btn btn-default tariff'/&gt;").val(this.TariffId).text(this.TarifNameRus)); $("div#tariffs.btn-group button.btn.btn-default").first().addClass("active"); }); }, error: function (xhr, status, error) { var err = eval("(" + xhr.responseText + ")"); alert(err.Message); } });
tagged with: javascript
has answer: http://stackoverflow.com/a/28605838
has comment: http://stackoverflow.com/comment/45515928
answer count: 2
has comment: http://stackoverflow.com/comment/45515752
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/45515803
has answer: http://stackoverflow.com/a/28605909
favorite count: 0
has title: How should I parse using jQuery JSON answer wrapped in Object?
has comment: http://stackoverflow.com/comment/45515945
score: 1

http://stackoverflow.com/a/28600856
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/45507809
upvote count: 1
downvote count: 0
has body: The problem was type should be "GET" instead of "POST" and route get('form-data', 'FormController@postform'); Thank U every one for your help
answers question: http://stackoverflow.com/q/28599638

http://stackoverflow.com/a/28717165
type: Answer
upvote count: 1
score: 1
has body: done by my self $( 'textarea.ckeditorJugar' ).ckeditor(); $( "body" ).on( "click", "#add-more-btn", function() { $( ' ' ).appendTo( "#more" ); $( 'textarea.ckeditorJugar' ).ckeditor(); });
answers question: http://stackoverflow.com/q/28712859
downvote count: 0

http://stackoverflow.com/a/28697941
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28697839
has body: With setTimeout: function doSetTimeout(i) { if(i &gt;= 3) return; alert(i); setTimeout((function () { return function () { doSetTimeout(i); }; })(i + 1), 5000); } doSetTimeout(0); But you can also use setInterval, maybe more appropriate.

http://stackoverflow.com/q/28694437
type: Question
answer count: 1
tagged with: javascript
has title: Repeat div every click angular
accepted answer: http://stackoverflow.com/a/28694589
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45679769
type: AnsweredQuestion
has body: I have a counter in angularjs $scope.count = 0; $scope.increment = function(){ $scope.count = $scope.count + 1; console.log("count " + $scope.count); }; $scope.decrement = function() { if($scope.count > 0) { $scope.count = $scope.count - 1; } }; and i would display a div if the count value is more than 1. The counter is incremented by a click in a button. Every time i click i increment the counter. Actually the counter goes well but i would create a div in each click. Now i'm be able to generate only one div. This is html part New div = 1"> {{item.name}}
has answer: http://stackoverflow.com/a/28694589

http://stackoverflow.com/comment/45632647
comment on: http://stackoverflow.com/a/28667617
score: 0
type: AnswerComment
type: Comment
has text: Hi There, one question. It is working OK. However sometimes & I don't even know why when I click the link to the same page containing the above script or navigate to other page, the alert in the `error:` call back will be popped up. Any idea why?

http://stackoverflow.com/comment/45720875
comment on: http://stackoverflow.com/q/28606056
score: 0
type: Comment
type: QuestionComment
has text: I have changed templateUrl : "scripts/my-module/views/my-module.html" to templateUrl: function(){ return 'scripts/my-module/views/my-module.html';} which reduces Karma test code coverage. so i am trying to cover this function through my controller. without return type function to templateUrl code coverage was full.

http://stackoverflow.com/comment/45732332
score: 0
has text: @Andurit okay, what protractor and browser and browser version are you using?
comment on: http://stackoverflow.com/a/28722613
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45545638
type: AnswerComment
comment on: http://stackoverflow.com/a/28620850
type: Comment
has text: Ah yes right you are - I have corrected it - just a typo!
score: 0

http://stackoverflow.com/comment/45657145
score: 0
type: Comment
type: QuestionComment
has text: several ways to do it with angular, use `ng-change` or `$watch`
comment on: http://stackoverflow.com/q/28682059

http://stackoverflow.com/comment/45614959
comment on: http://stackoverflow.com/q/28659678
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/comment/45683156
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28696385
score: 0
has text: Have you tried merging the arrays ? Have a look [here](http://www.w3schools.com/jsref/jsref_concat_array.asp)

http://stackoverflow.com/q/28711222
tagged with: wkwebview
has body: my main issue is WKWebView....when i run my app its supposed to navigate to a website behind the scene and login the user by running a some code from a .js file found on the main bundle. required init(coder aDecoder: NSCoder) { // Load username and password from NSUserDefults self.staffID = defaults.objectForKey("UserName") as String self.pass = defaults.objectForKey("PassWord") as String // locate file from main bundle let populateLoginURL = NSBundle.mainBundle().pathForResource("login", ofType: "js") // edit username and password var PassEdited = pass + "'" println(pass) var PassJs = "document.getElementsByName('password')[0].value = '" + PassEdited var usernameEdited = "'" + staffID + "'" println(staffID) var userNameJS = "document.getElementsByName('username')[0].value = " + usernameEdited // submit fuction will validate username and password on webpage let submit = "submitButton()" //combine the java code in one line let javaCode = userNameJS + "; " + PassJs + "; " + submit // write java code to file in main bundle which is empty javaCode.writeToFile(populateLoginURL!, atomically: true, encoding: NSUTF8StringEncoding, error: nil) //configure webView self.webView = WKWebView(frame: CGRectZero) let configuration = WKWebViewConfiguration() // load javacode to inject from file let populateLoginJS = String(contentsOfFile:populateLoginURL!, encoding:NSUTF8StringEncoding, error: nil) let populateLoginScript = WKUserScript(source: populateLoginJS!, injectionTime: .AtDocumentEnd, forMainFrameOnly: true) // add configuration to webview configuration.userContentController.addUserScript(populateLoginScript) configuration.preferences.javaScriptCanOpenWindowsAutomatically = false self.webView = WKWebView(frame: CGRectZero, configuration: configuration) println(populateLoginJS) super.init(coder: aDecoder) } override func viewDidLoad() { //set navigation delegate of web view and navigate to specified url webView.navigationDelegate = self let URL = NSURL(string: "https://ifly.e…
score: 0
has comment: http://stackoverflow.com/comment/45711029
has title: WKWebView not running on device
has comment: http://stackoverflow.com/comment/45735429
has answer: http://stackoverflow.com/a/28849667
accepted answer: http://stackoverflow.com/a/28849667
tagged with: swift
type: AnsweredQuestion
type: Question
tagged with: ios
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/45594136
score: 0
type: Comment
has text: @emzy try the jsbin i made for you.. hope it helps.
comment on: http://stackoverflow.com/a/28642710
type: AnswerComment

http://stackoverflow.com/q/28610397
type: Question
score: 3
has comment: http://stackoverflow.com/comment/45524924
tagged with: javascript
has title: Using Local Storage in Hybrid App Development as a "Local Database" - Dangerous or Useful?
has comment: http://stackoverflow.com/comment/45524712
tagged with: ionic-framework
has body: I am building a hybrid app (Ionic) and only need local storage to save my database objects. The app simply allows you to store, edit and view simple Notes. Now, obviously I need to make sure that when the user saves a note, it remains stored on his phone. My question is, are there any dangers of using window.localstorage in this context? Moreover, in which cases will the user loose all its data? One obvious case is when he deletes and re installs the app. If local storage is not the way to go, what other ways are there (or does it always require a server side solution)?
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/28610819
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/40152814
has answer: http://stackoverflow.com/a/40152814
type: AnsweredQuestion
tagged with: hybrid-mobile-app
upvote count: 3
accepted answer: http://stackoverflow.com/a/28610819
tagged with: local-storage

http://stackoverflow.com/a/28621136
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28621061
type: Answer
score: 1
answers question: http://stackoverflow.com/q/28621061
has body: I am not sure whether you are looking to do this with HTML context since you have tagged the question, if so, I would not do this and look for a better way such as using a parser. You could split on preceding whitespace and the delimiters like this. var r = 'Hello, I am your &lt;type1&gt; and &lt;type2&gt;!'.split(/\s*(&lt;[^&gt;]*&gt;)\s*/); console.log(r); //=&gt; [ 'Hello, I am your', '&lt;type1&gt;', 'and', '&lt;type2&gt;', '!' ] If you want to keep the preceding whitespace and only split on the delimiters. var r = 'Hello, I am your &lt;type1&gt; and &lt;type2&gt;!'.split(/(&lt;[^&gt;]*&gt;)/); console.log(r); //=&gt; [ 'Hello, I am your ', '&lt;type1&gt;', ' and ', '&lt;type2&gt;', '!' ]
upvote count: 1
has comment: http://stackoverflow.com/comment/45560448
type: AcceptedAnswer

http://stackoverflow.com/comment/45638990
type: Comment
type: QuestionComment
has text: What is important is what is being rendered inside the charts...
score: 0
comment on: http://stackoverflow.com/q/28672424

http://stackoverflow.com/comment/45652411
comment on: http://stackoverflow.com/a/28679378
score: 0
type: AnswerComment
type: Comment
has text: Well, there's nothing wrong in your code. Bt since document.getElementByTagName is restricted to look in only the document object of which it is a method, It is more elegant method. By the way, your code worked without any problem here...

http://stackoverflow.com/q/28707957
has comment: http://stackoverflow.com/comment/45705428
has comment: http://stackoverflow.com/comment/45736679
score: 1
has comment: http://stackoverflow.com/comment/45736338
has body: I am using a bootstrap template that has a single sidebar. I am trying to place a highchart on the initial index page of this template, but apparently the template is causing issues and making my graph not show up at all The template with the code is located at http://pastebin.com/wBvdG2J1 (for some reason I can't get it to format very well for the post so I will leave it there). At first I thought it was my javascript, but then I tried just it alone and it performed as intended Enter Number Code: $(document).ready(function() { $('#enter').click(function() { sgaxml = "https://sga.quickbase.com/db/bjmdensiu?apptoken=beadyrucxguavbx5isubd6iaqpe&act=API_DoQuery&query={14.EX." + $("#numberInput").val() + "}&clist=7.24.25.26.27.28.29.30.31.32.33.34.35.36.37"; console.log(sgaxml); // Load the data from the XML file $.get(sgaxml, function(xml) { // Split the lines var xml = $(xml).find('record'); var options = { chart: { renderTo: 'container', type: 'column' }, title: { text: 'Components Over Time' }, xAxis: { categories: [] }, yAxis: { title: { text: 'Concentration%' } }, series: [] }; // Variables for the component series var seriesH = { name: 'Hydrogen', data: [] }; var seriesHe = { name: 'Helium', data: [] }; var seriesO = { name: 'Oxygen', data: [] }; var seriesHs = { name: 'Hydrogen Sulfide', data: [] }; var seriesN = { name: 'Nitrogen', data: [] }; var seriesC = { name: 'Carbon Dioxide', data: [] }; var seriesM = { name: 'Methane', data: [] }; var seriesE = { name: 'Ethane', data: [] }; var seriesP = { name: 'Propane', data: [] }; var seriesIb = { name: 'Iso-Butane', data: [] }; var seriesNb = { name: 'N-Butane', data: [] }; var seriesIp = { name: 'Iso-Pentane', data: [] }; var seriesNp = { name: 'N-Pentane', data: [] }; var seriesHex = { name: 'Hexanes+', data: [] }; xml.each(function (i, record) { options.xAxis.categories.push(new Date(parseInt($(record).find('sample_date').text()))); seriesH.data.push(parseFloat($(record).find('hydrogen').text())); seriesHe.data.…
tagged with: highcharts
downvote count: 0
tagged with: javascript
has title: Bootstrap causing javascript errors?
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45742030
answer count: 0
tagged with: twitter-bootstrap
upvote count: 1
type: Question

http://stackoverflow.com/q/28684192
has answer: http://stackoverflow.com/a/29432277
answer count: 3
has answer: http://stackoverflow.com/a/58203412
score: 8
favorite count: 0
has answer: http://stackoverflow.com/a/62021448
has title: Heroku 403 Forbidden for static js files
has body: I have push my simple php app to Heroku and get 403 status for some js files. https://guarded-forest-7267.herokuapp.com/vendor/jquery/dist/jquery.min.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/jquery-form/jquery.form.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/jquery-validate/dist/jquery.validate.min.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/jquery.inputmask/dist/inputmask/jquery.inputmask.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/modernizer/modernizr.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/jselector/src/jquery.jselector.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/rubber-carousel/dist/jquery.rubber-carousel.min.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/jmodal/src/jquery.jmodal.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/scrollReveal.js/dist/scrollReveal.min.js Failed to load resource: the server responded with a status of 403 (Forbidden) Whats the problem can be?
type: UnansweredQuestion
tagged with: heroku
downvote count: 0
upvote count: 8
has comment: http://stackoverflow.com/comment/45941408
type: Question
tagged with: javascript
tagged with: http-status-code-403

http://stackoverflow.com/comment/45735135
has text: I think the problem is the jQuery validate plugin I cannot figure out how to add the rule in there so its just allowing it through with anything being entered. Do you have any experience with that plugin? Im new to JS and man does this get confusing with all these different types of plugins
comment on: http://stackoverflow.com/a/28723361
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28735112
answers question: http://stackoverflow.com/q/28734841
score: 0
type: Answer
has body: I see 3 &lt;/div&gt; and just 2 &lt;div&gt; in your code posted above. Not sure if that might be the issue.

http://stackoverflow.com/a/28737145
answers question: http://stackoverflow.com/q/28736832
has comment: http://stackoverflow.com/comment/45760085
type: Answer
score: 0
has body: there are some filter effects in CSS3 , only for webkit I've no idea how to use them to make the effect you showed but I think they can help here is a link that you can test CSS3 filters and get the css code http://html5-demos.appspot.com/static/css/filters/index.html and here you can see it's Browser compatibility hope that help's

http://stackoverflow.com/comment/45539149
type: Comment
has text: This would just be relative of the page page.?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28600172

http://stackoverflow.com/comment/45606063
type: QuestionComment
has text: what is the value of `html` If you replace it with just a string like `"test"` it should work fine. So something is weird with your value of `html`
score: 1
comment on: http://stackoverflow.com/q/28645405
type: Comment

http://stackoverflow.com/a/28708311
upvote count: 6
answers question: http://stackoverflow.com/q/28708216
has body: .forEach() specifies the value of this within the iterator based on its 2nd parameter, thisArg. arr.forEach(callback[, thisArg]) So, it will only use a particular object if you provide it: arr.forEach(function(e){ console.log(this); }, arr); // &lt;--- Otherwise, the value of this will be the default value of a normal function call -- either undefined in strict mode or the global object (window in browsers) in non-strict. function foo(e) { console.log(this); } foo(); // [object Window] [1].forEach(foo); // (same) Though, the arr is still provided to the iterator, just as its 3rd argument: arr.forEach(function (e, i, arr) { console.log(arr); });
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28708216
type: Answer
score: 6

http://stackoverflow.com/comment/45752008
type: QuestionComment
has text: The tag showed on the html part is on the head section.
score: 0
comment on: http://stackoverflow.com/q/28733158
type: Comment

http://stackoverflow.com/a/28653106
score: 1
downvote count: 0
type: Answer
upvote count: 1
has body: Yes. Instantiation occurs each time you invoke the nested functions. Instantiating functions does use CPU time but it's not as important as parsing. So, for the general case (not the case now that you mention that your functions will be invoked many times per second), parsing time is more relevant than instantiation. In this case, nesting functions will use a lot of memory and CPU time,CSO it's best to use RobG's solution (closures), where functions are instantiated once and they are simply called, causing less memory usage. If you want more optimized code in this critical piece of code, you should try to use as few functions as possible as this will work faster, albeit at the expense of losing code readability and maintainability.
answers question: http://stackoverflow.com/q/28652563

http://stackoverflow.com/a/29362146
score: -1
upvote count: 0
has comment: http://stackoverflow.com/comment/46908410
has body: Add style to body as body { padding-right:0px !important; overflow-y:hidden !important; }
type: Answer
answers question: http://stackoverflow.com/q/28746348
downvote count: 1

http://stackoverflow.com/comment/45741610
comment on: http://stackoverflow.com/q/28727480
type: Comment
type: QuestionComment
has text: The form is trying to submit. Remove the form tags.
score: 1

http://stackoverflow.com/comment/45512754
has text: @JeremyThille I think it's an issue with event propagation inside `destroyPopover` because the moment I removed the call from inside the if statement, it's working as intended but of course the popovers wont be removed before another one is created.
score: 0
comment on: http://stackoverflow.com/q/28603496
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28701131
type: UnansweredQuestion
has title: Issue with saving to Parse through Javascript
has body: I have the following code which works fine: &lt;script type="text/javascript"&gt; Parse.initialize("Lvw6b7TPacv0DX949odBhUPo2nqH5az7SPg6qoiD", "PIuBiR1tGtdJ8IDMnX3yEiljW4V3FQjeoEOhmzEW"); var Recipe = Parse.object.extend("UserSignUp"); var recipe = new Recipe(); recipe.save({username: "&lt;?php echo $Username ?&gt;",password: "&lt;?php echo $Password ?&gt;",title: "&lt;?php echo $Title ?&gt;",name: "&lt;?php echo $Name ?&gt;",email: "&lt;?php echo $Email ?&gt;",summary: "&lt;?php echo $Summary ?&gt;"}, { success: function(object) { $(".success").show(); }, error: function(model, error) { $(".error").show(); } }); However this saves to a usersignup class which I created. Ideally I need the data to be saved the User installation class however I am unable to do so. How can this be achieved??
tagged with: save
type: Question
tagged with: api
tagged with: javascript
has answer: http://stackoverflow.com/a/28701671
score: 0
answer count: 1
tagged with: parse-platform

http://stackoverflow.com/comment/45694329
score: 0
comment on: http://stackoverflow.com/q/28702085
type: QuestionComment
type: Comment
has text: `isset($_SESSION['token'])` is better than using `$_SESSION[ 'token'] !=null`. Additionally, `$sessionToken` does not have a default value, you should initialize it.

http://stackoverflow.com/q/28747277
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45777217
favorite count: 0
has body: I've come across something so bizarre. I had this below set up to read from a data.json file. It should show up a list of people. Instead it's ignoring the json file and is reading out non existing words! I just want it to read from data.json. Even if I delete "data.json" , the search function still prints out these words which don't exist. As you can see from the photo, it's showing up a list of words that I DO NOT have stored anywhere in my code or on my server. It's puzzling me. Search: {{person.name}} and var personApp = angular.module('personApp', []); personApp.controller('PersonListCtrl', function ($scope, $http) { $http.get('js/data.json').success(function (data) { $scope.persons = data; }) }); data.json [{ "name": "Mike Doe" }, { "name": "Jhon Doe" }, { "name": "Sam Doe" }, { "name": "Sam Doe" }, ];
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45777052
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/45776986
has comment: http://stackoverflow.com/comment/45777755
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28747815
has title: AngularJs search still reads non existent data
upvote count: 1

http://stackoverflow.com/q/28705577
has comment: http://stackoverflow.com/comment/45700813
has title: JavaScript switch function
favorite count: 0
has comment: http://stackoverflow.com/comment/45700702
has comment: http://stackoverflow.com/comment/45700680
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45700699
has answer: http://stackoverflow.com/a/28705606
has comment: http://stackoverflow.com/comment/45700701
tagged with: switch-statement
type: Question
tagged with: javascript
score: -1
has body: I am trying to get this code running but it gives me an error saying "unexpected end of input". Would you please help? Thanks in advance. var getReview = function (movie) { switch (movie) { case "Toy Story 2": return "Great story. Mean prospector."; break; case "Finding Nemo" : return "Cool animation, and funny turtles."; break; case "The Lion King" : return "Great songs."; break; default : return "I dont know!"; break; };
downvote count: 2
upvote count: 1
tagged with: function
answer count: 1

http://stackoverflow.com/comment/45611532
has text: @Tomalak They defined in the code above.
comment on: http://stackoverflow.com/q/28656675
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/q/28617850
accepted answer: http://stackoverflow.com/a/28618652
tagged with: javascript
has title: React best-practices -- pure or non-pure components? fetching data in componentWillMount?
upvote count: 4
type: AnsweredQuestion
score: 3
tagged with: meteor
favorite count: 0
type: Question
has body: I'm messing around with React in Meteor. There seem to be two ways of going about things... Given the meteor leaderboard example, we have a list of players that render a name and a score. The pure way of doing things is fetch all the players and pass into the playersList component which then divvies up to playerItem components. Everything is done with props and these templates are pure. Whenever a player changes, we can use Meteor's reactivity to re-render everything with React Tracker.autorun =&gt; players = Players.find().fetch() React.render(React.createElement(PlayersList, {players:players}), document.body) (the function passed to autorun will rerun whenever a player changes) This is pretty much exactly what Pete Hunt did in his Meteor-React presentation demo. Now the other way of doing this which seems much more efficient and fine-grained, but not pure. That is to pass the PlayersList component a list of playerIds. Pass the PlayerItem component a playerId and have the PlayerItem fetch the specific player and render the players name and score from the component's state. // inside the PlayerItem component componentWillMount: =&gt; Tracker.autorun =&gt; this.setState('player', Players.findOne(this.props.playerId)) Now the PlayerItem is not pure. Whenever a player's score changes, only the PlayerItem representing that player will be re-rendered. If we make sure to pass the PlayersList only a list of playerIds, then the PlayersList component will only be re-rendered whenever a player is added or removed. Tracker.autorun =&gt; playerIds = _.pluck('_id',Players.find({}, {fields:{_id:1}}).fetch()) React.render(React.createElement(PlayersList, {playerIds: playerIds}), document.body) This makes sense because now we have fine-grained control over React's render cycle and we're not bombarding react with the entire state of every player whenever one thing changes. However, this doesnt seem in the spirit of the way React was designed. Now we have internal state everywhere an…
has answer: http://stackoverflow.com/a/28618652
answer count: 1
downvote count: 1
tagged with: reactjs

http://stackoverflow.com/comment/84961024
type: Comment
comment on: http://stackoverflow.com/a/28656242
has text: @kojow7 I'm afraid it's been forever since I looked at this and I have no idea if what I tried back in 2015 still works Sorry not to be more help!
type: AnswerComment
score: 0

http://stackoverflow.com/q/28681644
type: Question
has comment: http://stackoverflow.com/comment/45656254
has comment: http://stackoverflow.com/comment/45656219
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/45656117
tagged with: ajax
has comment: http://stackoverflow.com/comment/45656350
has title: JS GeoLocation: make $.ajax wait for result
has body: When I send an AJAX POST request to my back-end, I want to send the latitude and longitude from navigator. But apparently, on the background, the request is being sent without even waiting for the navigator to finish. I am using the Parse library, is there a way I can put the request on hold until the lat/lon has been collected? $(document).ready(function(){ Parse.initialize("xxxxxx", "xxxxxx"); var Location = Parse.Object.extend("Location"); var location = new Location(); location.save({ latitude: latitude, longitude: longitude, description: "Testdescription", kind: 1 }).then(function(object){ alert("YAY, it worked."); }, function(err){ console.log(err); }); });
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28681758

http://stackoverflow.com/q/28653192
tagged with: arrays
tagged with: javascript
score: -1
possible better answer: http://stackoverflow.com/a/28653203
has body: I am trying to remove the negative numbers in this array using only the pop() method in Javascript. I know pop() removes the last item so how would I use pop() to remove both negative numbers in this array? Thank you! var x = [-3,5,1,3,2,10,-7]; for (var i = x.length-1; i &gt;= 0; i--){ if (x[i] &lt; 0){ x.pop(x[i]); } } console.log(x)
has comment: http://stackoverflow.com/comment/45619350
has answer: http://stackoverflow.com/a/28653203
has answer: http://stackoverflow.com/a/28653270
has answer: http://stackoverflow.com/a/28653229
has answer: http://stackoverflow.com/a/28653237
favorite count: 0
has answer: http://stackoverflow.com/a/28653254
answer count: 5
has comment: http://stackoverflow.com/comment/45603417
downvote count: 2
has comment: http://stackoverflow.com/comment/45603699
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28653229
has comment: http://stackoverflow.com/comment/45603430
upvote count: 1
has comment: http://stackoverflow.com/comment/45603525
has title: Javascript - removing negative values in an array only using the pop() method
type: Question

http://stackoverflow.com/comment/45639884
comment on: http://stackoverflow.com/q/28673240
has text: Content-Type:application/json add this to ajax request
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/28719691
has comment: http://stackoverflow.com/comment/45729922
has comment: http://stackoverflow.com/comment/45727271
type: Question
has comment: http://stackoverflow.com/comment/45727364
has comment: http://stackoverflow.com/comment/45729201
has answer: http://stackoverflow.com/a/28721649
tagged with: firefox
accepted answer: http://stackoverflow.com/a/28721649
tagged with: javascript
has comment: http://stackoverflow.com/comment/45729485
score: 0
tagged with: firefox-addon
has comment: http://stackoverflow.com/comment/45729156
has body: I have installed two Firefox Extensions to translate words when I double click on them: Google Translator and Wictionary and Google Translate. Both offer you the possibility to translate words just by double clicking on them. But the difference is, Wictionary and Google Translate just works everywhere i double click. It works with local files (file:///...) ,EPUBReader extension which opens EPUB files inside Firefox with a URL something like (about:epubreader?id=5) etc. Since I prefer Google Translator, I want to use it the same way I can use Wictionary and Google Translate, but it doesn't work with any URL other than http:// https:// . I have tried to compare their source codes and searched several times to find and edit this functionality in Google Translator, but could not do anything. Help anyone?? Thanks Some directory from Google Translator resources: igtranslator: lib: firefox.js common.js config.js data: (many png, html, css) inject.js options.js popup.js bootstrap.js
answer count: 1
has comment: http://stackoverflow.com/comment/45729527
has comment: http://stackoverflow.com/comment/45749857
tagged with: xpi
has title: Firefox extension not working with URLs other than http:// https://
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45726491

http://stackoverflow.com/comment/45601150
has text: This also was not the problem, I have the same error still.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28651928

http://stackoverflow.com/a/28719953
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28719241
score: 0
type: Answer
has body: I just find out that, this effect is called "depth of field" (dof) and already implemented by using MeshDepthMaterial and there is an example in threejs website: http://threejs.org/examples/webgl_postprocessing_dof.html
answers question: http://stackoverflow.com/q/28719241

http://stackoverflow.com/q/28606858
type: Question
has title: ng-table DOM not updating with data update
tagged with: javascript
score: 0
answer count: 1
has body: I have a navigation with list of cities which is being generated through angular. Each city has data binded to it. When a user clicks on any city, a table should be rendered with data of the city. First time when user clicks on city, it works fine but second time it does not update the DOM. I have gone through my code multiple times, and have not found any missing data or broken link. I am using ng-table to generate table. Please help function createTable(data){ var table = new ngTableParams({ page: 1, // show first page count: 10 // count per page }, { total: data.length, // length of data counts:[], getData: function($defer, params) { $defer.resolve(data.slice((params.page() - 1) * params.count(), params.page() * params.count())); } }); return table; }
tagged with: web
has comment: http://stackoverflow.com/comment/45519274
tagged with: angularjs
has answer: http://stackoverflow.com/a/28620199
type: UnansweredQuestion

sidebar
type: Tag
tag name: sidebar
tags question: http://stackoverflow.com/q/28663683

http://stackoverflow.com/q/28749159
tagged with: nonblocking
has title: expressjs is not asynchronously processing my requests
tagged with: javascript
tagged with: express
has comment: http://stackoverflow.com/comment/45781199
score: 2
has comment: http://stackoverflow.com/comment/45781332
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28749826
tagged with: asynchronous
has comment: http://stackoverflow.com/comment/45781317
favorite count: 0
has comment: http://stackoverflow.com/comment/45781138
has comment: http://stackoverflow.com/comment/45781245
has comment: http://stackoverflow.com/comment/45782176
tagged with: node.js
type: AnsweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/45780894
accepted answer: http://stackoverflow.com/a/28749826
has comment: http://stackoverflow.com/comment/45781303
has comment: http://stackoverflow.com/comment/45781442
has comment: http://stackoverflow.com/comment/45781243
has body: var data = import('./blahblah/data') app.get('/data', data.getData) app.listen(3000) // blahblah/data: exports.getData = function(req, res) { setTimeout(function(){ res.send('test') }, 10000) }; //code I use to test for(var i = 0;i&lt;10;i++){ $.ajax({ url: 'http://127.0.0.1:3000/data', success: function(l){console.log(l);} }); } If I send 10 simultaneous requests to this endpoint, then they only receive a reply one at a time 10 seconds apart, with the last request coming 110 seconds after the first request was sent. Aren't nodejs and express supposed to let other requests process when the other requests are running asynchronous code?
type: Question

cookies
tags question: http://stackoverflow.com/q/28682051
tags question: http://stackoverflow.com/q/28684786
tags question: http://stackoverflow.com/q/28678704
tags question: http://stackoverflow.com/q/28730090
tags question: http://stackoverflow.com/q/28710289
tags question: http://stackoverflow.com/q/28635379
tags question: http://stackoverflow.com/q/28654924
type: Tag
tags question: http://stackoverflow.com/q/28633588
tags question: http://stackoverflow.com/q/28653207
tags question: http://stackoverflow.com/q/28748199
tags question: http://stackoverflow.com/q/28618277
tags question: http://stackoverflow.com/q/28668268
tags question: http://stackoverflow.com/q/28711448
tags question: http://stackoverflow.com/q/28695727
tags question: http://stackoverflow.com/q/28654595
tag name: cookies
tags question: http://stackoverflow.com/q/28704120
tags question: http://stackoverflow.com/q/28603885
tags question: http://stackoverflow.com/q/28680324
tags question: http://stackoverflow.com/q/28633624
tags question: http://stackoverflow.com/q/28713202
tags question: http://stackoverflow.com/q/28692001
tags question: http://stackoverflow.com/q/28666434

wms
tag name: wms
tags question: http://stackoverflow.com/q/28679697
type: Tag

http://stackoverflow.com/a/28734328
accepted answer of: http://stackoverflow.com/q/28734249
answers question: http://stackoverflow.com/q/28734249
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/45754004
type: Answer
has body: data = {} data[UUIDDevice]= {"Latitude": Latitude, "Longitude": Longitude, "Model": ModelDevice, "IDDevice": UUIDDevice, "Platform": PlatformDevice };
has comment: http://stackoverflow.com/comment/45753999

http://stackoverflow.com/a/28661318
has body: can get help from : https://github.com/nulltask/node-three.js, it relies on three.js npm module. you can install it with : Installation $ npm install three.js check examples in above github link.
type: Answer
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28661065
answers question: http://stackoverflow.com/q/28661065

http://stackoverflow.com/comment/45751750
type: QuestionComment
comment on: http://stackoverflow.com/q/28732991
score: 2
has text: You're not calling the function, you are **assigning** the `getNewFile` function to the event. When the event is called later (by clicking on the element), the `evt` parameter is passed as part of that event
type: Comment

http://stackoverflow.com/comment/45707895
comment on: http://stackoverflow.com/q/28709024
score: 0
type: Comment
type: QuestionComment
has text: which version of angularJS do you use ? and are you sure that you included the js file in the right position? does other stuff in your project work ?

http://stackoverflow.com/comment/45746394
type: Comment
type: QuestionComment
has text: Will there ever be more than two elements split from column E?
score: 0
comment on: http://stackoverflow.com/q/28729333

http://stackoverflow.com/a/28688580
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28688551
has comment: http://stackoverflow.com/comment/45669291
has body: Missing id selector in change_me as it is the id of the audio element. audio = $("#change_me"); source = $("#change_me source"); You have used the selector as $("change_me") which is the element selector so it will search for an element with tag name change_me like &lt;change_me&gt;&lt;/change_me&gt; Demo: Fiddle
has comment: http://stackoverflow.com/comment/45669323
has comment: http://stackoverflow.com/comment/45712809
answers question: http://stackoverflow.com/q/28688551
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/45601943
comment on: http://stackoverflow.com/q/28633021
has text: Ugh, that output isn't helpful. :) I'm going to guess that some of the GWT library is missing or not fully configured (its always a bit fincky). I can't find any good Libgdx+gradle+GWT docs, so your best bet is to probably find GWT setup instructions that match your environment (Eclipse? etc?) and run though those. If that works, please add an answer, as I suspect you will not be the first to run into this.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28651576
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28651610
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45600978
has title: localStorage returning Object
upvote count: 1
tagged with: local-storage
downvote count: 1
has comment: http://stackoverflow.com/comment/45600524
has answer: http://stackoverflow.com/a/28651653
has body: Previously any time I have used localStorage I have always have to use JSON.stringify to retrieve the code as an object. However I have just used localStorage in the latest version of Chromium Version 42.0.2308.0 canary (64-bit) and this is what it returned: localStorage Storage {debug: "undefined", uid: "3", length: 2} typeof localStorage "object" When and which browsers/phones now support localStorage as objects?
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/a/28708294
accepted answer of: http://stackoverflow.com/q/28708017
has body: Your expression matches PCRE regular expression syntax but not JavaScript because JavaScript requires that square brackets inside a character class be escaped with \. This is what you want: (\[cid=(?:\d*)(?:(?:,\[[^\]]*\][^\]]*)?|(?:,[^\]]*))\]) Explained: https://regex101.com/r/pN4vP4/2
score: 2
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28708017
upvote count: 2

http://stackoverflow.com/q/28734788
has comment: http://stackoverflow.com/comment/45754853
has answer: http://stackoverflow.com/a/28734998
tagged with: concatenation
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: string
type: Question
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/28734998
has title: How do you concatenate a string with a variable/pass to link?
has comment: http://stackoverflow.com/comment/45754728
has comment: http://stackoverflow.com/comment/45754995
has body: I'm trying to make a simple page to send IR codes to an app on my phone (OneRemoteToControlThemAll). This is how the dev of the app shows to communicate with it via html, which works 100% fine. >"Send codes using URI "otrta://code?id=xxx" or "otrta://script?id=xxx" - use it for HTML layouts!" Left But, this only works with a pre-entered id. So, I want to have a text box with a button that when the button is clicked it sends the code entered in the box. I've looked around for different methods and tried many, none quite working. Here's my most recent attempt: html: Submit Right now on chrome on my PC this takes me to a page and outputs otrta://code?id=1234 or whatever numbers I had entered. On my phone the button does nothing. Any solutions on how to make it act the same as the others and work? It doesn't need to be perfect form, just something that will work, thanks for any help.
has comment: http://stackoverflow.com/comment/45754943
has answer: http://stackoverflow.com/a/28734938
tagged with: javascript
has comment: http://stackoverflow.com/comment/45754963
possible better answer: http://stackoverflow.com/a/28734938

http://stackoverflow.com/comment/45741105
has text: @showdev I don't know unfortunately. I'm a web designer with just a very basic javascript knowledge. Me and my team are trying so solve this little thing ourselves without having to depend on our back-end team.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28726193
score: 0

http://stackoverflow.com/a/28653203
answers question: http://stackoverflow.com/q/28653192
has comment: http://stackoverflow.com/comment/45603757
has comment: http://stackoverflow.com/comment/45603470
has body: You could achieve that you want using the filter function. var positiveNumbers = x.filter(function(number){ return number&gt;=0; }) var x = [-3,5,1,3,2,10,-7]; var positiveNumbers = x.filter(function(number){ return number&gt;=0; }); document.write(positiveNumbers); Using the pop method that you try is not possible. According to MDN: The pop() method removes the last element from an array and returns that element. Furthermore, you can't simultaneously try to iterate through the elements of an array and removing elements from this array. It doesn't make sense. You can filter the elements of an array, you can remove specific elements, you can add elements to an array but you definetely you can't looping through it's elements and at the same time to remove elements from it.
has comment: http://stackoverflow.com/comment/45603447
has comment: http://stackoverflow.com/comment/45603509
has comment: http://stackoverflow.com/comment/45603487
score: 0
has comment: http://stackoverflow.com/comment/45619463
type: Answer
has comment: http://stackoverflow.com/comment/45603722
has comment: http://stackoverflow.com/comment/45604996

http://stackoverflow.com/comment/45689622
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28698729
type: AnswerComment
has text: Thanks for showing me that :after clearfix, I might use that someday. I ended up working in the fiddle so much it isn't the same thing at all, but here's what I ended up with: http://jsfiddle.net/htbdbut5/2/

http://stackoverflow.com/q/28698991
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has body: I am migrating a legacy graphing application from (broken) PHP to... something. I am debating between just a newer PHP library and a JS library for Canvas. The application is NOT interactive, so it doesn't intrinsically need Javascript. My impression is that it is more "modern" to use JS as a graphing library than to do it server-side. Server-side rendering seems more "enterprisy". But honestly I'm not entirely sure why this is. To avoid making this seem like a debatable or opinionated question, I really just want to know the advantages to doing this in Canvas vs server-side in terms of maintainability, longevity, etc. I cannot think of obvious benefits one way or the other. I would appreciate some feedback concerning concrete advantages to rendering server-side vs in Canvas (or vice-versa) in my non-interactive application. Thanks!
upvote count: 1
type: Question
tagged with: graphics
has title: Canvas versus server generated graphics
tagged with: javascript
has answer: http://stackoverflow.com/a/28699078
tagged with: canvas
downvote count: 0
answer count: 1
score: 1

http://stackoverflow.com/comment/45674466
type: QuestionComment
has text: The answer that I was talking about (from vickisys) doesn't use any plugins. As olanod said, you can use the Inspector in your browser to see if the request worked or not.
score: 0
comment on: http://stackoverflow.com/q/28644200
type: Comment

http://stackoverflow.com/comment/45700802
score: 0
type: Comment
has text: That makes sense, now someone has to edit it so I can un-down vote.
type: AnswerComment
comment on: http://stackoverflow.com/a/28705351

http://stackoverflow.com/q/28629014
has answer: http://stackoverflow.com/a/28633302
has body: When I click in the table in column link, I open the dialog of bootstrap-editable. My call is: $('TABLE TD A').editable({ type: 'date', name: 'test', pk: $(this).attr("pk"), format: 'dd/mm/yyyy', url: '/post', title: 'Cambiar }); the table is inside DIV. what it is wrong it is the table with class table-condensed inside DIV.datepicker-days. The table expands to all POPOVER instead to do it to all expand to DIV.datepicker-days. I have as CSS: &lt;link href="../../Contents/Styles/bootstrap.css" rel="stylesheet" type="text/css" /&gt; &lt;link href="../../Contents/Styles/bootstrap-combined.min.css" rel="stylesheet" type="text/css" /&gt; &lt;link href="../../Contents/Styles/bootstrap-editable.css" rel="stylesheet" type="text/css" /&gt; In this order. The correct way to see it is : enter link description here What is it wrong?
type: AnsweredQuestion
type: Question
has title: bootstrap-editable: datepicker is not working
answer count: 2
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28633302
score: 0
has answer: http://stackoverflow.com/a/28671445
accepted answer: http://stackoverflow.com/a/28671445
tagged with: http://stackoverflow.com/tag/html
tagged with: twitter-bootstrap

http://stackoverflow.com/a/28654654
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28654641
answers question: http://stackoverflow.com/q/28654641
upvote count: 1
type: AcceptedAnswer
has body: Ideally you should be doing, setTimeout(function(){ document.getElementById('err_box').innerHTML = selected_troops.length+" Men "+varues; }, 1000);
type: Answer

http://stackoverflow.com/comment/45571126
score: 1
comment on: http://stackoverflow.com/a/28629799
type: AnswerComment
type: Comment
has text: how is your `getQueryStr ` method different from jQuerys `$.param()`? My question was about adding arguments to an existing url which already contains a query string. `$.ajax()` method handles that very nicely.

http://stackoverflow.com/a/64184741
has body: your string is not json object but it is an json array object (check out the square brackets). so to get the value you must run it into "for" or "each" or ... .each example below pass the string to variable and then ; var obj=[{"ZoneId": "1", "0": "1", "ZoneX": "29", "1": "29", "ZoneY": "27", "2": "27", "ZoneWidth": "76", "3": "76", "ZoneHeight": "61", "4": "61", "ZoneImage": "46", "5": "46", "ZonePointTo": "2", "6": "2"}, {"ZoneId": "2", "0": "2", "ZoneX": "382", "1": "382", "ZoneY": "226", "2": "226", "ZoneWidth": "-117", "3": "-117", "ZoneHeight": "98", "4": "98", "ZoneImage": "46", "5": "46", "ZonePointTo": "3", "6": "3"}, {"ZoneId": "3", "0": "3", "ZoneX": "108", "1": "108", "ZoneY": "74", "2": "74", "ZoneWidth": "363", "3": "363", "ZoneHeight": "83", "4": "83", "ZoneImage": "46", "5": "46", "ZonePointTo": "2", "6": "2"}] jQuery.each(obj, function(key,value) { alert(value.ZoneId); });
upvote count: 1
answers question: http://stackoverflow.com/q/28734767
score: 1
downvote count: 0
type: Answer

http://stackoverflow.com/q/28714798
type: AnsweredQuestion
type: Question
has body: Is there an FSO (file system object) method to create or delete a folder in JavaScript or VBScript? Any other JavaScript or VBScript method to create or delete a folder which works in HTA is also accepted.
has answer: http://stackoverflow.com/a/28714879
accepted answer: http://stackoverflow.com/a/28714879
tagged with: javascript
tagged with: vbscript
score: 0
upvote count: 1
answer count: 1
downvote count: 1
favorite count: 0
has title: Create or delete a folder using FSO
tagged with: fso

http://stackoverflow.com/q/28651043
favorite count: 0
has answer: http://stackoverflow.com/a/28658896
tagged with: marionette
tagged with: backbone.js
has title: How to track change on an input in a Marionette.LayoutView
type: AnsweredQuestion
downvote count: 0
score: 1
has body: I am current trying to get my input field in a LayoutView to track when it's change as they happen. I the code as follows. https://jsfiddle.net/nyTZU/10/ &lt;div id="view-goes-here"&gt; &lt;div id="listing_filter"&gt; Price: &lt;input type="text" id="listing_filter_price" /&gt; Beds: &lt;input type="text" id="listing_filter_bedroom" /&gt; Baths: &lt;input type="text" id="listing_filter_bathroom" /&gt; &lt;/div&gt; var V = Backbone.LayoutView.extend({ el: '#listing_filter', events: { 'change input': 'updateFilter' }, updateFilter: function() { alert('hey'); } }); var v = new V; Notice that the when a change happens it does nothing ie fires not event. How can i achieve this in backbone/marionette ??
type: Question
accepted answer: http://stackoverflow.com/a/28658896
answer count: 2
upvote count: 1
possible better answer: http://stackoverflow.com/a/28658365
has answer: http://stackoverflow.com/a/28658365
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28716805
answer count: 1
tagged with: javascript
has title: Is there a calendar that can select a range of dates in google closure library
score: 0
accepted answer: http://stackoverflow.com/a/28768050
tagged with: google-closure-library
favorite count: 0
upvote count: 2
downvote count: 2
has body: in my project I'm using google closure. Is there in google closure any calendar component that allows selecting range of dates? Thank you
tagged with: google-closure
tagged with: calendar
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28768050
type: Question

http://stackoverflow.com/q/28692880
score: -2
tagged with: javascript
tagged with: jquery
has body: Actually how to automatically calculate subtotal depending the js spinner change, also sum them into grand total with jquery, I am newly to the jquery with operation function so any suggestion will be appreciated Thanks Warmly Fiddle >> &lt;div class="table-responsive" id="bottom-table"&gt; &lt;table class="table table-striped"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;No&lt;/th&gt; &lt;th&gt;Part Number&lt;/th&gt; &lt;th&gt;Desc&lt;/th&gt; &lt;th&gt;Qty / Unit&lt;/th&gt; &lt;th&gt;Qty Needed&lt;/th&gt; &lt;th&gt;Het ( Rp )&lt;/th&gt; &lt;th&gt;Estimation Price&lt;/th&gt; &lt;th&gt;&amp;nbsp;&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;3DCam01&lt;/td&gt; &lt;td&gt;3D Camera&lt;/td&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;&lt;input class="spinner" value="1" readonly="readonly"&gt;&lt;/td&gt; &lt;td&gt;$1500.00&lt;/td&gt; &lt;td&gt;&lt;p class="subtotal"&gt;&lt;/p&gt;Subtotal&lt;/td&gt; &lt;td&gt;&lt;a href="index.php?action=remove&amp;code=3DCam01" class="btnRemoveAction"&gt;Delete&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;2&lt;/td&gt; &lt;td&gt;USB02&lt;/td&gt; &lt;td&gt;External Hard Drive&lt;/td&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;&lt;input class="spinner" value="1" readonly="readonly"&gt;&lt;/td&gt; &lt;td&gt;$800.00&lt;/td&gt; &lt;td&gt;Subtotal&lt;/td&gt; &lt;td&gt;&lt;a href="index.php?action=remove&amp;code=USB02" class="btnRemoveAction"&gt;Delete&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;3&lt;/td&gt; &lt;td&gt;wristWear03&lt;/td&gt; &lt;td&gt;Wrist Watch&lt;/td&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;&lt;input class="spinner" value="1" readonly="readonly"&gt;&lt;/td&gt; &lt;td&gt;$300.00&lt;/td&gt; &lt;td&gt;Subtotal&lt;/td&gt; &lt;td&gt;&lt;a href="index.php?action=remove&amp;code=wristWear03" class="btnRemoveAction"&gt;Delete&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;Tot…
has answer: http://stackoverflow.com/a/28693390
answer count: 1
has title: Automatically calculate value of jquery spinner
favorite count: 0
type: UnansweredQuestion
downvote count: 2
type: Question
upvote count: 0

http://stackoverflow.com/comment/45733411
score: 0
comment on: http://stackoverflow.com/q/28722075
type: QuestionComment
type: Comment
has text: This jsbin is a bit closer to my actual code although in the example the properties are working as expected: http://emberjs.jsbin.com/qewobaseso/edit

http://stackoverflow.com/a/28636481
has body: The problem is because you're not calling the close method in the correct scope. In your eventlistener, 'this' points to the button. But in the code that you looked at, 'this' has been changed to another scope with the .bind() method. $("#crmbutton").click(function() { /* 'this' points to the element #crmbutton, which doesn't have a close method */ this.close(); }); The example code, look at the bottom where the .bind() method is used. this.closeButton = jQuery( '&lt;div/&gt;', { 'class': 'jBox-closeButton jBox-noDrag' } ).on( 'touchend click', function(ev) { this.isOpen &amp;&amp; this.close({ignoreDelay: true}); }.bind(this) /* The scope is being set to another 'this' */ ); Documentation about the .bind() method
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28636311
answers question: http://stackoverflow.com/q/28636311
has comment: http://stackoverflow.com/comment/45995885

http://stackoverflow.com/a/28733405
has body: The main answer is because it is easier and faster to write.They are also potentially used in environments that don't have modules, like the browser, so if you load jasmine, then a global is the only way to access the jasmine logic. It also arises in this case because the style that Jasmine and Mocha tests are written lends itself to declarative syntax, so you can almost thing of describe and it as syntax for tests, rather than as JS functions.
answers question: http://stackoverflow.com/q/28733362
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28733362
has comment: http://stackoverflow.com/comment/45752715

http://stackoverflow.com/comment/116103415
type: Comment
comment on: http://stackoverflow.com/a/65666870
score: 0
type: AnswerComment
has text: It would be nice if you write some brief explanation to your code. What does the code do and how does it manage the task?

http://stackoverflow.com/q/28662815
score: 0
has comment: http://stackoverflow.com/comment/45690199
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
tagged with: android
has title: Ionic app lags a lot on chrome and device
tagged with: css
has answer: http://stackoverflow.com/a/28700246
tagged with: ionic-framework
has comment: http://stackoverflow.com/comment/45624092
type: Question
has body: So i recently started using the ionic framework, when i tried out making an android app and running it in chrome for the first time it was fast and snappy. Then I added a button which takes you to another screen which has navigation bars and side menus and custom font on both screens, after doing that my app became slow as hell! now i cant even click the button to take me to the next screen. The app doesn't even make server calls. It runs decently fast in firefox however if i use ionic serve --lab the app still lags there. Also i added custom fonts which when i load on an actual android device shows when i first launch the app however it never shows again on the second launch. I attached the code for both screens. ` Harpee A Culture of Happiness and Hope Log In Sign In Forgot your Password? Sign Up ` ` Menu User Name Brief Bio My Profile Forums 0 Connect Settings Log Out `
tagged with: javascript

http://stackoverflow.com/comment/45712208
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28712037
has text: I'm appending the img and p object to the document directly
score: 0

http://stackoverflow.com/q/28734633
favorite count: 0
has comment: http://stackoverflow.com/comment/45754520
has answer: http://stackoverflow.com/a/28734687
has comment: http://stackoverflow.com/comment/69524206
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45755723
score: 1
has body: I'm infatuated by the PS3 Original Theme, and I'd love to have those waves and sparkles as a background on one of my dashboards. Does anyone know if this has ever been done in javascript? Even if it's just the waves, I'd be interested! If you're not sure what I'm talking about, here's a photo of it. Imagine this photo, but with the waves moving and the sparkles moving into the foreground (blurred &amp; bigger) and into the background (crisp &amp; small): http://gameswallpaperhd.com/wp-content/uploads/2013/12/ps3-wallpaper-aevion-a-graphic-design-blog-w1j2gkbe.jpg
upvote count: 1
tagged with: background
type: Question
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28734687
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45756330
has title: PS3 Original Theme in Javascript

http://stackoverflow.com/a/28688657
has body: The body of the else clause: (function removePreviousSibling(sibling) { if (sibling.nodeName === 'TR' &amp;&amp; sibling.classList.contains('project-details')) { return sibling.parentNode.removeChild(sibling); } removePreviousSibling(sibling.previousSibling); }(el.previousSibling)); el.parentNode.removeChild(el); The IIFE ensures if there is an extra text node between the two &lt;tr&gt; elements that the text node will be skipped and not deleted if you just did called a removeChild on the previousSibling of the target element. Take a look over the information at MDN's DOM page. It's got a great set of interface documentation and tutorials.
has comment: http://stackoverflow.com/comment/45669587
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/28688468
downvote count: 0
answers question: http://stackoverflow.com/q/28688468
has comment: http://stackoverflow.com/comment/45669716
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45669437
has comment: http://stackoverflow.com/comment/45669675

http://stackoverflow.com/comment/45744942
type: QuestionComment
type: Comment
score: 0
has text: As I see you have 2 options, the first is use a iFrame as yourself said, the second is to use AJAX, using AJAX don't need to be modal, you can do an http request and update the content of the content. The main problem with both approachs is the URL, to solve this you can use the # techinique or the history API (https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history). Would be nice to have an javascript parse the URL on page load to load the content that the URL is point to, if using this approach. Frameworks like amber and angular have routers to do that.
comment on: http://stackoverflow.com/q/28729259

http://stackoverflow.com/comment/45563573
comment on: http://stackoverflow.com/q/28631752
score: 0
type: Comment
type: QuestionComment
has text: Sounds like references are being tied together. Maybe your copy portion need to create new objects.

http://stackoverflow.com/comment/45572000
score: 0
has text: There are some definite quirks still with ui-grid. I had similar problems and found that resizing the grid often helped. I just made a resizegrid method that calculated the size based on the number of items and then set it.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28635560

http://stackoverflow.com/comment/45562224
comment on: http://stackoverflow.com/a/28630466
has text: does that mean I cannot rely on console.log, just in case I modify the object **after** it is shown on the console?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28635544
answers question: http://stackoverflow.com/q/28634860
downvote count: 0
type: Answer
has body: I re-read your post and saw you mentioned inside an if statement, so I made a simple example that just checks if there is any text inside the div you might want to put a button in and if there is text, add the button, if not, don't add the button. var content = document.getElementById('content'); // get the content div var divs = content.getElementsByTagName('div'); // get all of the divs inside content div var currentDiv; // to store a ref to the current div in the divs array for(var i = 0; i < divs.length; i++) { currentDiv = divs[i]; // pretty contrived example but adds a button if there is already text // if there is no text just set the innerHTML to No Button if(currentDiv.textContent) { var button = document.createElement('button'); button.innerHTML = 'I\'m A Button!'; currentDiv.appendChild(button); } else { currentDiv.innerHTML = 'No Button'; } } Something
score: 1
upvote count: 1

http://stackoverflow.com/a/28743537
has body: in app i'am using Express framework and i use res.json the array from library. res.json seem to stringify my array
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28743091

http://stackoverflow.com/q/28613946
favorite count: 0
accepted answer: http://stackoverflow.com/a/28614077
has comment: http://stackoverflow.com/comment/45531347
type: Question
tagged with: http://stackoverflow.com/tag/html
score: -2
tagged with: css
has comment: http://stackoverflow.com/comment/45531937
answer count: 2
downvote count: 2
has body: I am currently having to use two statements for this and I'd like to combine this into one statement if possible. The hierarchy for the CSS is - div#optionsbox1 div.checkbox a.help div.checkbox a.help I'd like to .addClass('readOnly') to the div.checkbox where a.help was not clicked. So if I clicked a.help in the first div.checkbox I'd like for the second div.checkbox to have the .addClass('readOnly') applied and vice versa. Here's the current syntax that I'm using right now to accomplish this. $("#optionsbox1 .checkbox").addClass('readOnly'); $(this).parent(".checkbox").removeClass('readOnly'); Here's the entire function - $(this).click(function() { if($(this).attr('checked')){ if($(this).hasClass('readOnly')){ $(this).removeClass('readOnly'); } $("#optionsbox1 :checkbox").not(this).prop('checked',false); $("#optionsbox1 .checkbox").addClass('readOnly'); $(this).parent(".checkbox").removeClass('readOnly'); $(this).prop('checked',true); } else { $(this).prop('checked',false); $("#optionsbox1 :checkbox").removeClass('readOnly'); } });
has answer: http://stackoverflow.com/a/28614077
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28614367
tagged with: dom
has answer: http://stackoverflow.com/a/28614367
type: AnsweredQuestion
has title: Combining two jQuery statements using this and not
upvote count: 0
tagged with: jquery

http://stackoverflow.com/comment/45650991
has text: @Luaan using a reference currency would definitely be the best solution
score: 1
comment on: http://stackoverflow.com/q/28678806
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28599220
has answer: http://stackoverflow.com/a/28599465
accepted answer: http://stackoverflow.com/a/28599267
type: Question
answer count: 2
tagged with: javascript
has title: How to set the value of a element using Jquery and how to use a button to reset all objects of a certain object?
tagged with: jquery
has answer: http://stackoverflow.com/a/28599267
has comment: http://stackoverflow.com/comment/45504647
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: So what I am given is this Restart Score: _ (_ dice with _ dots each) _ rolls left and the goal is to set and update the values that are represented initially by the _ char, which will get replaced by the actual value. Creating a game akin to Yatzee, where the score is the sum of the dice with the most occurrance and highest value(ie, score is 12 if there are 2 dice that have 6 and no other most occurred dice value came up) Using jquery, how would I set these values of the element? I figured using `$("#rolls").val(//some number); However, that doesn't work. Any ideas?
possible better answer: http://stackoverflow.com/a/28599465
type: AnsweredQuestion

http://stackoverflow.com/q/28690751
tagged with: sails.js
tagged with: javascript
score: 0
answer count: 2
linked to: http://stackoverflow.com/q/18687818
tagged with: service
tagged with: linux
type: UnansweredQuestion
has body: I want to create a start/stop/restart service on Linux for Sails.js. Will start Sails (similar to sails lift command): sudo service myapp start Will stop Sails: sudo service myapp stop Will restart Sails: sudo service myapp restart I found this link, but it doesn't work as expected.
tagged with: node.js
has title: How to create a start/stop/restart Linux service for Sails.js
has answer: http://stackoverflow.com/a/28696974
has answer: http://stackoverflow.com/a/28734513
type: Question

specifications
type: Tag
tag name: specifications
tags question: http://stackoverflow.com/q/28719018
tags question: http://stackoverflow.com/q/28729085
tags question: http://stackoverflow.com/q/28703855

http://stackoverflow.com/comment/45735713
has text: Start by telling us where it went wrong (i.e. functionally). "Wrong" meaning that it doesn't crop? How exactly should it crop (e.g. to a fixed size if the image is greater than it, by detecting and cropping to a subject within the picture etcetera)?
comment on: http://stackoverflow.com/q/28724391
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28738558
has comment: http://stackoverflow.com/comment/45761221
has comment: http://stackoverflow.com/comment/45761779
has comment: http://stackoverflow.com/comment/45761087
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45765823
has comment: http://stackoverflow.com/comment/45760976
accepted answer: http://stackoverflow.com/a/28738663
tagged with: animation
has comment: http://stackoverflow.com/comment/45761811
has body: Twice today I came across the following code snippet: function draw() { setTimeout(draw, 100); // Drawing code goes here } draw(); This code must get out of sync if the drawing part takes longer than 100 milliseconds?
type: AnsweredQuestion
has title: JavaScript - SetTimeout() - Animation
type: Question
tagged with: recursion
has comment: http://stackoverflow.com/comment/45761380
has answer: http://stackoverflow.com/a/28738663
tagged with: javascript

http://stackoverflow.com/a/28718132
score: 15
has body: Simple Description ng-model Is used for two way binding of variable that can be available on scope as well as on html. which has $modelValue(value reside in actual scope) & $viewValue (value displayed on view). If you mentioned on form with name attribute then angular internally creates validation attributes for it like $error, $valid, $invalid etc. Eg. ng-value Is used to assign value to respective ng-model value like input, select & textarea(same can be done by using ng-init) ng-value does provide good binding if your are setting ng-model value through ajax while writing value attribute doesn't support it Basically meant to use for radio & option tag while creating select options dynamically. It can only have string value it, it doesn't support object value. HTML ... OR {{option.name}} ...
upvote count: 15
downvote count: 0
answers question: http://stackoverflow.com/q/28717523
type: Answer

http://stackoverflow.com/a/28708052
score: 0
has body: You can use the onclick and innerHtml function of javascript. HTML 01A001-Z03-71021 Add to Cart JS function copyValue() { var valueToCopy = document.getElementById("textValue").innerHTML"; var elem = document.getElementById("mytext"); elem.value = valueToCopy; }
type: Answer
answers question: http://stackoverflow.com/q/28707955

http://stackoverflow.com/comment/45540948
comment on: http://stackoverflow.com/q/28618993
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/q/28695617
has comment: http://stackoverflow.com/comment/45681969
type: Question
tagged with: input-field
has comment: http://stackoverflow.com/comment/45681869
has body: I have some issues with calculating some stuff with JS and getting the right values out of the input fields (number). When I use this code it doesn't show anything. So what is wrong with my JS? Do I need to include a jQuery file? Availability Total Production Time hours Breaks minutes Malfunctions minutes Theoretical production time:
linked to: http://stackoverflow.com/q/16880327
has answer: http://stackoverflow.com/a/28695771
score: 18
has title: How to get a number value from an input field?
tagged with: javascript
possible better answer: http://stackoverflow.com/a/46659404
upvote count: 18
has answer: http://stackoverflow.com/a/46659404
has answer: http://stackoverflow.com/a/28696027
accepted answer: http://stackoverflow.com/a/28695771
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/121550277
has answer: http://stackoverflow.com/a/70082334
tagged with: http://stackoverflow.com/tag/html
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45682501
linked to: http://stackoverflow.com/q/15627341

http://stackoverflow.com/comment/45776885
score: 0
comment on: http://stackoverflow.com/q/28747183
type: Comment
has text: @JeremyThille . . . just because someone else has done it already, doesn't mean that there isn't value in trying to do see if you can do it yourself (and, maybe, even better ;) ) . . .
type: QuestionComment

http://stackoverflow.com/comment/45726055
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28719614
has text: Not to the "current" instance if you want to define `obj` on the prototype, no.

http://stackoverflow.com/q/28680015
has body: I have a page which renders many divs of the same class name; Is something like this possible without loop? var elements = document.getElementsByClassName('className of divs'); elements[*].onclick = function(){ alert('I can click any of the divs now!'); }; *=any number
has comment: http://stackoverflow.com/comment/45653050
has comment: http://stackoverflow.com/comment/45653112
possible better answer: http://stackoverflow.com/a/28680192
has comment: http://stackoverflow.com/comment/45653328
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28680192
has comment: http://stackoverflow.com/comment/45653170
upvote count: 1
has answer: http://stackoverflow.com/a/28680172
has comment: http://stackoverflow.com/comment/45653148
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45653156
answer count: 2
tagged with: javascript
has title: Target any element of the elementsByClassName array?
has comment: http://stackoverflow.com/comment/45653139
score: 0
accepted answer: http://stackoverflow.com/a/28680172
has comment: http://stackoverflow.com/comment/45652926
has comment: http://stackoverflow.com/comment/45652934
has comment: http://stackoverflow.com/comment/45652940
favorite count: 0

http://stackoverflow.com/comment/45576379
type: AnswerComment
comment on: http://stackoverflow.com/a/28638322
has text: That's what I tried immediately before asking this question. But apparently this isn't the case - if I use setSelectionRange without focusing on it, it remains out of focus (at least on chrome). So it could have false negatives.
score: 0
type: Comment

http://stackoverflow.com/q/28635861
upvote count: 1
has answer: http://stackoverflow.com/a/28636049
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28636015
accepted answer: http://stackoverflow.com/a/28636049
tagged with: javascript
type: Question
tagged with: html-table
downvote count: 0
tagged with: jquery
has body: I have a table with patients in which, for each row of table I can remove the row or do other operations, so when I remove all the rows I want my table header to be hidden or removed. Emri Mbiemri Numri personal Vendi i lindjes Data e diagnozës së parë Data e raportimit Mjeku raportues Veprimet {% if patient_docs and patient_docs.collection.count() > 0 %} {% for patient_doc in patient_docs %} {% if patient_doc.patient is defined %} {{ patient_doc.patient.emri }} {{ patient_doc.patient.mbiemri }} {{ patient_doc.patient.numri_personal }} {{ patient_doc.patient.vendi_lindjes }} {% endif %} {% if patient_doc.diagnosis is defined %}{{ patient_doc.diagnosis.data_diagnozes_se_pare }}{% endif %} {% if patient_doc.treatment is defined %}{{ data_e_raportimit }}{% endif %} {% if patient_doc.treatment is defined %}{{ patient_doc.treatment.mjeku_raportues }}{% endif %} {% endfor %} {% endif %} So how can I do that using jQuery, so that if there is no row hide the header and and show a message there is no patient registered?
favorite count: 0
has title: Hide table header if there is no row
answer count: 4
possible better answer: http://stackoverflow.com/a/28635894
has answer: http://stackoverflow.com/a/28635894
score: 1
has answer: http://stackoverflow.com/a/28635916

http://stackoverflow.com/comment/45561250
type: QuestionComment
type: Comment
has text: As minifying and "spriting" reduce the total size of the files, then yes, they still have an effect. What is unclear here ?
score: 3
comment on: http://stackoverflow.com/q/28630108

http://stackoverflow.com/comment/45776930
has text: @Oriol I try to add somehting like "window.onload" or document.addEventListener('DOMContentLoaded', function() but it seems to don't work...can you show me your idea by modifying my given script?
comment on: http://stackoverflow.com/q/28747005
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28673217
has body: I got problem with my code. I got a div(id - ball) which is moving to the top and left by default. Then, when it reaches a top of wrapper block (with id = field) the "ball" should change its moving direction. BUT it changes everything wrong. Here is my code. Dont laugh at my code skills, i'm newbie...:) I actually understand why the ball continues to fly in wrong direction, but I havent any ideas how I can fix it, so please help me:) var ball = document.getElementById('ball'); var timer = setInterval(function () { var posTop = ball.offsetTop; var posLeft = ball.offsetLeft; var ballPositionX = parseFloat(window.getComputedStyle(ball). left) ; var ballPositionY = parseFloat(window.getComputedStyle(ball). top); ball.style.top = --posTop + 'px'; ball.style.left = ++posLeft + 'px'; if( ballPositionX &lt;= 0 ) { ball.style.top = --posTop + 'px'; } if( ballPositionX &lt;= 550 ) { ball.style.top = ++posTop + 'px'; } if( ballPositionY &lt;= 0 ) { ball.style.left = ++posLeft + 'px'; } if( ballPositionY &gt;= 1000 ) { ball.style.left = --posLeft + 'px'; } }, 10); and HTML is here: &lt;div class="field" id="field"&gt; &lt;div id="here"&gt;&lt;/div&gt; &lt;div class="ball" id="ball"&gt;&lt;/div&gt; &lt;div class="desk" id="desk"&gt;&lt;/div&gt; &lt;/div&gt; and here is CSS *{ margin: 0; padding: 0; } .field{ margin: 15px auto; width: 1000px; height: 650px; border: 1px solid #000; background: aliceblue; position: relative; overflow: hidden; } .ball{ width: 50px; height: 50px; -webkit-border-radius: 100px; -moz-border-radius: 100px; border-radius: 100px; background: green; -webkit-border: 5px double silver; -moz-border: 5px double silver; -ms-border: 5px double silver; -o-border: 5px double silver; border: 5px double silver; position: absolute; top: 550px; left: 0; } .desk{ width: 200px; height: 25px; background: darkblue; -webkit-border: 3px double silver; -moz-border: 3px double silver; -ms-border: 3px double silver; -o-border: 3px double silver; border: 3px double silver; -webk…
has comment: http://stackoverflow.com/comment/45640206
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28673483
has title: div changes moving direction when reaches border
has comment: http://stackoverflow.com/comment/45639824
type: Question
accepted answer: http://stackoverflow.com/a/28673483
has comment: http://stackoverflow.com/comment/45639826
tagged with: javascript
has comment: http://stackoverflow.com/comment/45640405
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45640021

http://stackoverflow.com/q/28743239
type: Question
score: 1
upvote count: 1
answer count: 1
has body: I was thinking of where does the difference lies when i try to do the following in two different ways, not in terms of usage, but performance wise affect: Using Image tag &lt;img src='http://lorempixel.com/300/300/sports/2/'&gt; along with, say, img{ width: 100px; height: 100px; } Using div tag &lt;div class='test'&gt;&lt;/div&gt; along with, say, .test{ background-image: url('http://lorempixel.com/300/300/sports/2/'); width: 100px; height: 100px; } Having said that, I wanted to know When image is getting loaded for both cases. For first one, its pretty easy using load event. But for second one, div case, how should i check?..I know of this way OverHead, but doesn't it means that it will incur overhead, instantiating Image separately for each div? Are there other possible ways to achieve the same?
tagged with: javascript
has title: Ways to find out div background image is loaded
tagged with: css
favorite count: 0
has answer: http://stackoverflow.com/a/28743350
downvote count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/28617996
has comment: http://stackoverflow.com/comment/45539910
answer count: 1
tagged with: onbeforeunload
tagged with: ajax
has body: I'm working on a CMS to allow users to access and classify records in MySQL database. I have created a user login system for this CMS. I am trying to program a lock out function that will monitor when a record is being viewed so that no other users can access this record. This is to prevent multiple users from trying to write to the same record at the same time. So far this part works fairly well. When they access the record I update the field "in_use" within the MySQL database for that particular record to show that it is being viewed. When they have submitted the form with the classification for the record it, I update the field "in_use" to show that it is no longer being viewed. The problem I have is when the user closes the browser without submitting the form, or when they navigate away from the page. I have been trying to use AJAX to run an update on the beforeunload event, but it has not been working. ***** readRecord.php***** Analyze //PHP include that contains functions for php queries to the MySQL database. <?php include 'core/database/record_functions.php'; ?> //Form to search MySQL database by Case Number and Button to manually release a record that is in_use. Search records by Case Number: <input type="text" name="user" id="user" readonly="readonly" hidden="hidden" value="<?php echo $_SESSION['username']; ?>"> <input type="Submit" name="release record" value="Release the current record" onclick="<?php update_in_use($_SESSION['case_num'], 0); ?>"> //Includes for jQuery library and AJAX code for automatically releasing the record on page navigation or close. ... code continues for reading records ... when the form is submitted update_in_use is called again to set the value to 0 ***** ajaxBridge.js ***** // This code is supposed to run the query on releaseVariable.php to update the in_use field to 0 on the beforeunload event. window.addEventListener("beforeunload", function(event){ if(xmlHttp.readyState==4) { xmlHttp.open("POST", "releaseVariable.php", true…
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45657537
has answer: http://stackoverflow.com/a/28992993
tagged with: php
has title: Updating MySQL field beforeunload
tagged with: mysql
type: Question
tagged with: javascript
score: 0

http://stackoverflow.com/q/28714941
tagged with: jquery
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/45717631
has title: searching deeper than 1 into json
has body: im trying to figure out how to search deeper than just one deep in my JSON file. its structure is as follows json&gt;data&gt;movies&gt; in movies the different movies are enumerated 0, 1, 2, 3, 4, etc so json&gt;data&gt;movies&gt;3&gt; would contain movie information for the 4th movie each containing key value pairs.the code i am using only seems to look one deep, and i cant seem to get it to go deeper. code is as follows $('#search').keyup(function () { // i understand this to watch the form id search var searchField = $('#search').val(); // sets variable searchfield from typed content, .val grabs the content if (searchField.length) // this sets the length to false by default ensuring the code only runs when it is supposed to and not all the time { var myExp = new RegExp(searchField, "i"); // sets variable myexp to regular expression using "i" for case insensitive var found = 0; // sets variable found to 0 to keep div hidden until match is found $.getJSON('/secure/movies.json', function (data) { //gets movies.json file pushes to data function var output = '&lt;ul class="searchresults"&gt;'; $.each(data, function (key, val) { // this should make key pairs from data if (val.title.search(myExp) !== -1) { // this is the problem i think console.log(val); // this should show our search term results in console found = 1; output += '&lt;li&gt;'; output += '&lt;h2&gt;' + val.title + '&lt;/h2&gt;'; output += "&lt;a href=" + val.image + ' target="_blank" &gt;&lt;/a&gt;'; output += '&lt;/li&gt;'; } }); output += '&lt;/ul&gt;'; if (found == 1) { $('#update').removeClass('update-hidden'); $('#update').html(output); } else { $('#update').addClass('update-hidden'); } }); } else { $('#update').addClass('update-hidden'); } }); ive tried manipulating val.title.search(myexp) but i might be missing the boat on whats happening here with val.title.search. thanks in advance
type: Question
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has comment: http://stackoverflow.com/comment/45718410
score: 0
has comment: http://stackoverflow.com/comment/45717615

http://stackoverflow.com/comment/45752889
has text: Fair enough, but since we are dealing with integers and the range isn't wide enough to overflow (even `new Date(Number.MAX_SAFE_INTEGER / 2)` is sometime in the year `144683`), it's probably not a great concern here.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28730053
type: Comment

http://stackoverflow.com/comment/118055484
type: AnswerComment
comment on: http://stackoverflow.com/a/63490897
type: Comment
score: 0
has text: @Reality This tip is not about stopping visitors from inspecting elements (good luck with that), but about helping you, the developer, make Inspect Element better at picking out the element you're interested in (the one you can see) rather than some large invisible element that might overlap it.

http://stackoverflow.com/q/28594139
type: Question
has title: Keep formatting from SharePoint list in Google Map infowindow
has comment: http://stackoverflow.com/comment/45498195
tagged with: javascript
has comment: http://stackoverflow.com/comment/45497659
tagged with: google-maps-api-3
upvote count: 2
tagged with: infowindow
downvote count: 0
tagged with: sharepoint-2010
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45751602
score: 2
answer count: 0
has body: (First Overstack Post so please forgive me in advance for any posting mistakes.) I am using SharePoint 2010. I have created a wiki page that contains a google map that displays multiple marker locations from a sharepoint list that is also on the wiki page. The list has two columns (multi-line text) one that contains the address and the other information about the location. The google map API V3, gets each address from the list, places a marker at the location, and displays in a marker infowindow information about that location. My problem is that the line returns in the information column do not appear in the infowindow on the map. The infowindow displays the information as single line text that raps in the info window. How do I keep the formating (most concerned about the line returns) from the SharePoint List information column in the infowindow? &lt;!--initialize is a function that needs to run when the page is loaded--&gt; &lt;body onload="initialize()"&gt; &lt;form id="form1" runat="server"&gt; &lt;asp:ScriptManager runat="server" id="ScriptManager"&gt;&lt;/asp:ScriptManager&gt; &lt;!--js?key is developer's API Key that can be gotten for free at https://code.google.com/apis/console/.--&gt; &lt;script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=MYAPIKEY&amp;sensor=false"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;&lt;/script&gt; &lt;!--width and height can be px or %--&gt; &lt;div id="map_canvas" style="width: 700px; height: 500px"&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt; // set up the basic map object var latlng = new google.maps.LatLng(21.4667, 152); var myOptions = { zoom: 2, center: latlng, mapTypeId: google.maps.MapTypeId.SATELLITE }; var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); // this is used for geocoding var geocoder = new google.maps.Geocoder(); function codeAddress(address, info) { geocoder.ge…

http://stackoverflow.com/comment/45575805
score: 2
has text: Absolutely. What have you tried?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28638104

http://stackoverflow.com/q/28669409
has title: Node reference is lost after modifying a class name
has answer: http://stackoverflow.com/a/28669428
downvote count: 0
answer count: 1
favorite count: 0
has body: I lost object reference after changing the class name through node.className = ... var nodeName = 'my_div'; var subNode = document.getElementById(nodeName); var nodes = subNode.getElementsByClassName('one'); alert (nodes[0]); // OK - [object HTMLSpanElement] nodes[0].setAttribute('class','zzz'); alert (nodes[0]); // Undefined How do I save a reference to the object in a variable?
accepted answer: http://stackoverflow.com/a/28669428
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: javascript

http://stackoverflow.com/comment/45495731
score: 0
type: AnswerComment
has text: it would be required once and then just referenced after that point as it is already in memory -- more here -- http://nodejs.org/api/modules.html#modules_cycles
type: Comment
comment on: http://stackoverflow.com/a/28594515

http://stackoverflow.com/comment/45757810
has text: It's not supposed even to open. Does alert open?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28736778

http://stackoverflow.com/a/28770342
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28747036
has body: You need to escape the Url before it is sent to the Session/Expire page. See this previous question for information on encoding it in Javascript: Encode URL in JavaScript? Once you have returnUrlString on your Session Expire page, you should then unescape it and direct the user to it. The problem is that the Url to the Session/Expire page would be: "/Session/Expire?returnUrlString=http://localhost:49574/Report/ReportWithUserIdAndCaseId?userId=84&amp;caseId=173" What the server sees is: Page: "/Session/Expire?, QueryString ReturnUrlString: returnUrlString=http://localhost:49574/Report/ReportWithUserIdAndCaseId?userId=84, QueryString CaseId: &amp;caseId=173" It is interpreting your &amp;caseId as part of the /Session/Expire URL. This is why it disappears.
type: Answer
has comment: http://stackoverflow.com/comment/45941513
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45941892
accepted answer of: http://stackoverflow.com/q/28747036

http://stackoverflow.com/comment/45723049
score: 0
type: Comment
type: QuestionComment
has text: Nothing works, alert($scope.email) is undefined too
comment on: http://stackoverflow.com/q/28702245

http://stackoverflow.com/comment/45605840
has text: I think I understand... it seems that it would be better to change the service to receive a callback, which it would call everytime it receives an nfc event. Made an edit
comment on: http://stackoverflow.com/a/28613618
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45567385
has text: @ArnaldoIgnacioGasparVéjar: You should make that an answer. It's much better than the currently accepted.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28632281
score: 1

http://stackoverflow.com/a/28612703
has comment: http://stackoverflow.com/comment/123880166
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/123880881
has comment: http://stackoverflow.com/comment/123885357
accepted answer of: http://stackoverflow.com/q/28612649
answers question: http://stackoverflow.com/q/28612649
type: Answer
score: 22
has body: ^\d{0,6}(\.\d{1,2})?$ Try this.See demo. https://regex101.com/r/oL9kE8/4 Just make the (\.\d{1,2}) decimal part optional.?
upvote count: 22

http://stackoverflow.com/q/28695348
has comment: http://stackoverflow.com/comment/45681947
has comment: http://stackoverflow.com/comment/45682325
has comment: http://stackoverflow.com/comment/45681996
tagged with: arrays
downvote count: 0
has comment: http://stackoverflow.com/comment/45681752
tagged with: javascript
score: 4
linked to: http://stackoverflow.com/q/2980763
has comment: http://stackoverflow.com/comment/45681973
favorite count: 0
has answer: http://stackoverflow.com/a/28696648
has answer: http://stackoverflow.com/a/28696380
has comment: http://stackoverflow.com/comment/45682476
has body: I have an array of objects which goes on something like this var obj = [{ id: 23, name: 'Test1', children: [{ id: 24, name: 'Test2, children: [..] },{ id: 25, name: 'Test2, children: [..] }], },{..}] Each children can have multiple sub children, so basically I am trying to represent a graph like structure, similar to the output of htmlparser. I need a function like this: function(nodeId, json){} The function will need to find the json object in the tree by using the nodeId and insert the json as a children of that parent object. Thats where I am stuck. I tried writing a recursive function like this to search the appropriate node, however, the trouble arises when I have to insert the json into the actual obj array. function findNode(nodeId, json, obj){ if(obj.id == nodeId){ obj.children.push(json); } else{ for(var i=0; i&lt;obj.children.length; i++){ findNode(nodeId, json, obj.children[i]); } } } It seems the json gets inserted to the obj local to the recursive function, not the actual root obj. How can I can insert it to the parent obj?
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28696380
has comment: http://stackoverflow.com/comment/45682373
has comment: http://stackoverflow.com/comment/45684450
has comment: http://stackoverflow.com/comment/45681796
has title: Pushing item into a multi-dimensional tree like structure in JavaScript
type: Question
accepted answer: http://stackoverflow.com/a/28696648
has comment: http://stackoverflow.com/comment/45682857
tagged with: tree
tagged with: http://stackoverflow.com/tag/json
upvote count: 4
tagged with: graph
answer count: 2

http://stackoverflow.com/comment/45947983
type: AnswerComment
has text: You're welcome, but that doesn't explain why I got 3 negative votes :( I think that javascriptless solution that I provided is very useful. Best regards.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28720985

http://stackoverflow.com/q/28690303
upvote count: 4
has title: Updating span inner html with jQuery .html not working in IE
has answer: http://stackoverflow.com/a/28690820
has comment: http://stackoverflow.com/comment/45672224
has comment: http://stackoverflow.com/comment/45672183
has comment: http://stackoverflow.com/comment/45672468
has comment: http://stackoverflow.com/comment/45672517
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45672461
has comment: http://stackoverflow.com/comment/45672354
type: AnsweredQuestion
score: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45672317
favorite count: 0
accepted answer: http://stackoverflow.com/a/28690820
has body: I am trying to update a span with the value of a range input as it is being slided. It works in Chrome and Firefox but in IE (Tried both 10 &amp; 11). There's no error in console, the span inner html is just blank. I tried with .text instead of .html but no luck. What is happening here? function onRangeInput(myobj) { $(myobj).val(); var theid= $(myobj).attr('id'); var spanid = theid + "_span"; $("#" + spanid).html($(myobj).val()); } Okay, upon further looking, I guess this code is fine and there's something wrong in the way I am calling the fucntion. Here's the html, &lt;input type="range" id="rangefirst" name="rangefirst" min="0" max="100" value="51" onChange="rangeChanged(this)" oninput="onRangeInput(this)"/&gt; &lt;span id="rangefirst_span"&gt;&lt;/span&gt; On Chrome and FF the function is getting called when the slider is moved. IE ignores the event. What am I doing wrong?
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/45672166
has comment: http://stackoverflow.com/comment/45672406
has comment: http://stackoverflow.com/comment/45672785
downvote count: 1

http://stackoverflow.com/q/28670215
tagged with: php
type: AnsweredQuestion
score: 1
upvote count: 1
has title: Cannot drag and drop after$AJAX
type: Question
accepted answer: http://stackoverflow.com/a/28670306
tagged with: javascript
has body: If I drag in csets.php page, I can drag and drop items. But when I use onchange to change categories item. New item after$AJAX and query cannot drag. Csets.php &lt;div class="wrapper"&gt; &lt;div id="options"&gt; &lt;?php $strSQL = "SELECT * FROM item_head ORDER BY ihead_id DESC"; $objQuery = mysqli_query($con, $strSQL); while($row = mysqli_fetch_array($objQuery)){ ?&gt; &lt;img width="150" height="120" src="item_head/&lt;?php echo $row['filesName'];?&gt;" id="drag1&lt;?php echo $row['head_id'];?&gt;" class="drag"&lt;/img&gt; &lt;?php } ?&gt; &lt;/div&gt; &lt;/div&gt; JavaScript function selectCa(){ var xmlhttp=new XMLHttpRequest(); var value = document.getElementById("sel1").value; xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200){ document.getElementById("options").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET", "checkQuery.php?value="+value, true); xmlhttp.send(); } CheckQuery.php &lt;?php $value = $_GET["value"]; //query head items if($value == "head"){ $strSQL = "SELECT * FROM item_head ORDER BY ihead_id DESC"; $objQuery = mysqli_query($con, $strSQL); while($row = mysqli_fetch_array($objQuery)){ ?&gt; &lt;img width="150" height="120" src="item_head/&lt;?php echo $row['filesName'];?&gt;" id="drag1&lt;?php echo $row['head_id'];?&gt;" class="drag"&gt;&lt;/img&gt; &lt;?php } }else if($value == "body"){ $strSQL = "SELECT * FROM item_body ORDER BY ibody_id DESC"; $objQuery = mysqli_query($con, $strSQL); while($row = mysqli_fetch_array($objQuery)){ ?&gt; &lt;img width='150' height='120' src='item_body/&lt;?php echo $row['filesName'];?&gt;' id='drag1' class='drag'&gt;&lt;/img&gt; &lt;?php } }else if($value == "shoes"){ $strSQL = "SELECT * FROM item_shoes ORDER BY ishoes_id DESC"; $objQuery = mysqli_query($con, $strSQL); while($row = mysqli_fetch_array($objQuery)){ ?&gt; &lt;img width='150' height='120' src='item_shoes/&lt;?php echo $row['filesName'];?&gt;' id='drag1' class='drag'&gt;&lt;/img&gt; &lt;?php } } ?&gt;
answer count: 1
downvote count: 0
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28670306

http://stackoverflow.com/comment/45656519
score: 0
type: AnswerComment
type: Comment
has text: @user3574492 may you paste your page within your question? It seems like you have a problem with the droppable and not the redirect function. Just paste your code and I will check what's really being wrong
comment on: http://stackoverflow.com/a/28676245

http://stackoverflow.com/comment/45643390
has text: I downloaded the free jqGrid & replaced the 4.71 version in my code, but get the error **jqGrid is not a function** when I click on a button to load the grid. The code I use for that is `$("btnGetData").click(function() { $("myGrid").jqGrid('GridUnload'); createMyGrid(); });` which creates the grid above. I have 2 buttons, each loading a separate data source into essentially the same grid. The above code used to unload a grid & load the specific grid. I've checked to make sure the usual things (grid.locale-en.js & jquery.jqGrid.js) are referenced properly. Ideas?
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28637128
score: 0

http://stackoverflow.com/comment/45628824
has text: @shmuli Without seeing the code, I would imagine it's because the "local" method is in the same Javascript scope (not to be confused with Angular scope) as the event handler you were declaring. In other words, if you defined a function you wanted to call, and the event handler both inside the controller, then the event handler can see the other function because they are in the same scope. Your service's method, however, is in a different Javascript scope and your handler cannot see it without some reference.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28666690

http://stackoverflow.com/q/28630660
has comment: http://stackoverflow.com/comment/45561458
tagged with: http://stackoverflow.com/tag/html
has body: I am using twitter's widget in my website (i am making the website with the cms eZ publish). So in my code i have this: Tweets de @mytweeterAccount Script: So this work well, it provide me all tweets. Now i would like to customize the html... Someone have an idea. I guess i can't do it via the widget but i would like a confirmation because this is the first time i include twitter and maybe there is something i dont know.
upvote count: 0
type: Question
score: -2
tagged with: javascript
tagged with: twitter
downvote count: 2
answer count: 1
tagged with: jquery
has title: how to modify the html when we use twitter widget?
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28630907

http://stackoverflow.com/q/28681340
answer count: 1
favorite count: 0
type: UnansweredQuestion
has title: How to change the class of a button on change?
downvote count: 0
score: 1
type: Question
has body: I have an input button that I am styling like this: &lt;span class="btn btn-file btn-default"&gt; &lt;span class="text"&gt;&lt;/span&gt; &lt;input type="file" id="fileinput" name="uploaded_file" /&gt; &lt;/span&gt; And changing it with this jQuery: $(document).ready(function(){ $(".text").html("Change Avatar"); $('#fileinput').on('change', function() { $(".text").text('Avatar Selected'); }); }); By default, it shows 'Change Avatar'. And when somebody selected a photo, it changes to 'Avatar Selected'. I'd also like it to change from btn-default to btn-selected. How would I do that?
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28681401
upvote count: 1

http://stackoverflow.com/comment/45650877
type: QuestionComment
comment on: http://stackoverflow.com/q/28677690
type: Comment
score: 1
has text: Sorry, I don't know ampersand and their website is absolutely horrible at describing what kinds of problems it is actually most useful for.

http://stackoverflow.com/q/28734144
tagged with: jquery-form-validator
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28735089
has body: I am using a online blog form validation which is done in jQuery, The problem I have with this file is when I reuse the input code for a different id, the span alert is not showing up. $(document).ready(function() { &lt;!-- Real-time Validation --&gt; &lt;!--Name can't be blank--&gt; $('#contact_name').on('input', function() { var input=$(this); var is_name=input.val(); if(is_name){input.removeClass("invalid").addClass("valid");} else{input.removeClass("valid").addClass("invalid");} }); $('#contact_nameee').on('input', function() { var input=$(this); var is_named=input.val(); if(is_named){input.removeClass("invalid").addClass("valid");} else{input.removeClass("valid").addClass("invalid");} }); &lt;!--Email must be an email --&gt; $('#contact_email').on('input', function() { var input=$(this); var re = /^[a-zA-Z0-9.!#$%&amp;'*+=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; var is_email=re.test(input.val()); if(is_email){input.removeClass("invalid").addClass("valid");} else{input.removeClass("valid").addClass("invalid");} }); &lt;!--Website must be a website --&gt; $('#contact_website').on('input', function() { var input=$(this); if (input.val().substring(0,4)=='www.'){input.val('http://www.'+input.val().substring(4));} var re = /(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&amp;amp;:\/~+#-]*[\w@?^=%&amp;amp;\/~+#-])?/; var is_url=re.test(input.val()); if(is_url){input.removeClass("invalid").addClass("valid");} else{input.removeClass("valid").addClass("invalid");} }); &lt;!--Message can't be blank --&gt; $('#contact_message').keyup(function(event) { var input=$(this); var message=$(this).val(); console.log(message); if(message){input.removeClass("invalid").addClass("valid");} else{input.removeClass("valid").addClass("invalid");} }); &lt;!-- After Form Submitted Validation--&gt; $("#contact_submit button").click(function(event){ var form_data=$("#contact").serializeArray(); var error_free=true; for (var input in form_data){ var element=$("#contact_"+form_data[in…
has title: jQuery Validation Form span not working
type: Question
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
score: 0
tagged with: validation

http://stackoverflow.com/comment/45519134
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28607560
type: Comment
has text: Are you sure that `elementRef` is not null here? WebForms has the annoying feature that it will not name your objects with the ID you specify in code.

http://stackoverflow.com/comment/45530742
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28612676
has text: After some further exploration, the issue is actually in my handlebars code

http://stackoverflow.com/a/28618363
type: Answer
answers question: http://stackoverflow.com/q/28618277
score: 0
has body: Browsers use the semicolon for native cookie delimitation, and you're cookie is confusing it. try: document.cookie = [name, encodeURIComponent('=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.'), window.location.host.toString()].join(''); //or document.cookie = encodeURIComponent([name,'=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.', window.location.host.toString()].join('')); You'll have to decode it when reading the cookie back.

youtube-api
tags question: http://stackoverflow.com/q/28659919
type: Tag
tags question: http://stackoverflow.com/q/28599302
tags question: http://stackoverflow.com/q/28737066
tags question: http://stackoverflow.com/q/28648818
tag name: youtube-api
tags question: http://stackoverflow.com/q/28654637
tags question: http://stackoverflow.com/q/28633421

http://stackoverflow.com/q/28746018
score: 0
accepted answer: http://stackoverflow.com/a/28746119
downvote count: 2
has body: I didn't see any useful upload in dropbox example. Can you help me? I'm using AngularJS.
has comment: http://stackoverflow.com/comment/45774678
linked to: http://stackoverflow.com/q/22101651
tagged with: dropbox
tagged with: upload
tagged with: javascript
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28746119
tagged with: file-upload
favorite count: 0
has title: How can I upload files to dropbox using JavaScript?
tagged with: angularjs
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/45774534
answer count: 1

http://stackoverflow.com/q/28637589
favorite count: 0
has comment: http://stackoverflow.com/comment/45576367
tagged with: asp.net-mvc-4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45575220
upvote count: 1
has answer: http://stackoverflow.com/a/28638376
downvote count: 1
type: Question
has title: Why is JQuery not working in my MVC 4 application after Firefox Update?
has body: I have been writing an ASP.NET MVC 4 project in VS. I had it working perfectly in an older version of Firefox and in IE 11. It still works great in IE 11, but after I updated FF to 35.0.1, My script is not working. How do I get my script to work in the newest version of Firefox? My _Layout view contians the following script: ...... @Scripts.Render("~bundles/jquery") &lt;script&gt; $.ajax({ url: '@Url.Action("Action", "Controller")', type: 'post', cache: 'false, async: 'true', data: '{}', success: function(result){ $('#progress').html(result); } }); $(document).ready(function(){ function RefreshPartial(){ setTimeout(function(){ loadPartialView(); RefreshPartial(); }, 3000); } RefreshPartial(); }); &lt;/script&gt; @RenderSection("scripts", required: false) &lt;/body&gt; ...... In Firefox/Fox It hits the "$(document).ready(function () {" line then jumps to the bottom of the script }); before going to the Jquery. It never comes back to my inline JS. It throws the following exception: "SyntaxError: An Invalid or illegal string was specified" at the "if" statment below: 3093 for ( ; list &amp;&amp; firingIndex &lt; firingLength; firingIndex++ ) { 3094 if ( list[ firingIndex ].apply{ data[ ], data[ 1 ] ) == false &amp;&amp; options.stopOnFalse ) { memory = false; break; } } It loops through the for statment several times and then throws an error at the same if statement: "TypeError: Constructor Document requires 'new'". It never runs my inline script so my partial view is never loaded. Again, this only happens in the newest version of FF.
has comment: http://stackoverflow.com/comment/45575788
possible better answer: http://stackoverflow.com/a/28638618
tagged with: javascript
has answer: http://stackoverflow.com/a/28638618
has comment: http://stackoverflow.com/comment/45575494
score: 0
answer count: 2
tagged with: firefox
accepted answer: http://stackoverflow.com/a/28638376
tagged with: jquery
has comment: http://stackoverflow.com/comment/45575013

http://stackoverflow.com/q/28634193
has comment: http://stackoverflow.com/comment/45588808
has body: I am working on a Sitecore site, and for the master file, I want to check to see if I am on the home page or not. If I am, then I want to display a script tag for an animation file's contents (Note: I can't really move the script to a different file--it has to be as it is) I'm not too familiar with server side includes/statements, but I know it's possible to perform such a check with server side if statement: &lt;!--#if is home page, then show the script tag --&gt; &lt;script type="text/javascript" charset="utf-8" src="/scripts/Subpages/Main-Image-2_edgePreload.js"&gt;&lt;/script&gt; &lt;!--#endif --&gt; I have no idea how I could perform the check, though....is there a way to check the page URL or page name or page ID?
answer count: 1
downvote count: 0
linked to: http://stackoverflow.com/q/25037501
tagged with: javascript
favorite count: 0
tagged with: server-side-includes
tagged with: sitecore
type: UnansweredQuestion
upvote count: 1
has title: Use server side includes to check if current page is the home page--if so, display script tag
type: Question
has answer: http://stackoverflow.com/a/28634409
score: 1

http://stackoverflow.com/comment/45501695
type: QuestionComment
has text: Just wondering why not just use opacity 0 then go opacity 1 on click. Why not just use visibility?
score: 0
comment on: http://stackoverflow.com/q/28597629
type: Comment

http://stackoverflow.com/q/28741032
answer count: 2
tagged with: custom-events
has answer: http://stackoverflow.com/a/28742227
tagged with: javascript
has title: custom event for mouse coordinates
score: 0
has body: I'm creating iFrame and in that iFrame script I need to catch mouse coordinates after creation (in very start). I was hoping that it's possible with custom event. I tried var myEvent = new Event('mouseC'); document.addEventListener('mouseC', function(e){ console.log('my event is working'); console.log('mouse x is '+e.pageX); console.log('mouse y is '+e.pageY); }); document.dispatchEvent(myEvent); console is displaying 'my event is working', but mouse coordinates are undefined. I tried wrapping it in window.onload, and I also tried screenX and clientX... always undefined How can I catch mouse coordinates in newly created iFrame imedietly after creation? ...btw, mousemove event is working and writing coordinates when mouse is moved over new iFrame. Could I somehow move mouse for just 1px to trigger that event?
type: UnansweredQuestion
tagged with: iframe
has answer: http://stackoverflow.com/a/28741491
tagged with: mouseevent
type: Question

http://stackoverflow.com/a/28682385
score: 0
has comment: http://stackoverflow.com/comment/45680276
has comment: http://stackoverflow.com/comment/45681944
type: Answer
has body: There are several problems in both the question and what you're trying to do. You may want to either clarify the question or clarify what you really want to do. The short answer to your question: No. A for loop is not, itself, asynchronous. A slightly longer answer: It isn't clear you need the loop itself to be async, but you may just want the contents to be async. So instead of calling readFileSync you may want to use readFile which takes a callback. In this callback, you can append to the file. This will "fire off" 1000 read files, which will call their callback when ready. But there is still a problem. If you read the 1000 files asynchronously, and save them to the same file as you read them in, you won't get the file contents in any order and may even have file content interleaving. I can't imagine why you actually want to do this. Update: Your updated question is still a little vague - if you need to wait until everything is done to send the code 200 reply... then you're going to have to wait until all the files are appended. There really isn't any other solution. If, however, you can return code 200 immediately to indicate you're working on the file appends, and then do the appending in the background, you can execute the loop as part of an asynchronous task. You can do this inside a process.nextTick() call or in a promise or in any other way that makes sense to your flow.
answers question: http://stackoverflow.com/q/28682265
has comment: http://stackoverflow.com/comment/45680875

http://stackoverflow.com/a/28720517
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45728228
type: Answer
accepted answer of: http://stackoverflow.com/q/28720370
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45728393
answers question: http://stackoverflow.com/q/28720370
has body: Your data is a string so you need to parse it before using it as you want: arr = JSON.parse(arr); Now you can use "arr" as you want :) EDIT: You can use this data in another function using global variables or parameters. Examples: var values = []; function myFunction() { var i; loadTextDoc("../menu.txt", function() { if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) { menus.innerHTML = xmlhttp.responseText; values = JSON.parse(xmlhttp.responseText); for(i in values) { alert(values[i]); } } }); } function another() { // Now you can access "values" from here } Or: function myFunction() { var values = []; var i; loadTextDoc("../menu.txt", function() { if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) { menus.innerHTML = xmlhttp.responseText; values = JSON.parse(xmlhttp.responseText); for(i in values) { alert(values[i]); } another(values); } }); } function another(data) { // Now you can access "values" from here // using "data" parameter } But in last example "values" will desapear after myFunction execution.
has comment: http://stackoverflow.com/comment/45728167
upvote count: 1

http://stackoverflow.com/a/28656896
answers question: http://stackoverflow.com/q/28656434
score: 0
type: Answer
has body: This is what you should do, using regular expressions: JSFIDDLE: http://jsfiddle.net/ewh8qe0t/1/ function img_find() { var imgs = '&lt;p&gt;..random content..&lt;/p&gt;&lt;img src="myimage1.jpg" /&gt;&lt;p&gt;..random content..&lt;/p&gt;&lt;img src="myimage2.png" /&gt;&lt;p&gt;..random content..&lt;/p&gt;'; var regex=/src="([A-z]+\d*\.[A-z]{3})"/g; var imgSrcs = [], found; while (found = regex.exec(imgs)) { imgSrcs.push(found[0].split('=')[1].replace(/"/g,'')); } return imgSrcs; } alert(img_find());

http://stackoverflow.com/q/28670235
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28702682
answer count: 1
tagged with: xpath
tagged with: selenium-ide
type: UnansweredQuestion
has body: Hi I'm fairly new in doing automation and I'm starting with Selenium IDE, What I wanted was to to save the configuration of the User and when the user creates a new account, the dropdown value that will be selected will be based on the user's configuration. So what I did is save the attribute by using xpath as locator storeAttribute xpath=//div['divname']/div[2]/div[10]/table/tbody/tr[3]/td[2]@'spanname' Callvariable This is my code when calling it and trying to put it in the dropdown select id=dropdown ${Callvariable} When I try to call it, it gives me an error message: [error] Option with label '${Callvariable}' not found
has title: How to use stored attribute to select dropdown value
type: Question

http://stackoverflow.com/q/28671188
favorite count: 0
upvote count: 8
has answer: http://stackoverflow.com/a/28671237
tagged with: bind
possible better answer: http://stackoverflow.com/a/33892057
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/33892057
has title: JQuery bind on Ajax success
has body: Why do we call bind on AJAX success calls? Take a look at this code: $.ajax({ url: myurl, dataType: 'json', success: function(data){ this.setState({data: data}); }.bind(this) }); If we don't call bind, then does it makes any difference or there is an advantage to use bind here?
type: Question
accepted answer: http://stackoverflow.com/a/28671237
score: 8
tagged with: javascript
tagged with: jquery
tagged with: ajax
answer count: 3
has answer: http://stackoverflow.com/a/36811812
downvote count: 0

http://stackoverflow.com/comment/45505023
has text: @ShijuKBabu No, both controller are parent.
comment on: http://stackoverflow.com/q/28599261
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45980485
has text: @JuanMendes Sorry for that late answer. http://pastebin.com/zbahehZ8 - i'm using this code. In firefox if i press ctrl+F5 i get small images. If you add alert() in the end of function maybe it add understanding why this happend. Alsough you can use instead foreach construction and got same result
comment on: http://stackoverflow.com/q/28675158
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28623874
type: Question
downvote count: 0
has comment: http://stackoverflow.com/comment/45551212
tagged with: javascript
linked to: http://stackoverflow.com/q/28602890
tagged with: ajax
has comment: http://stackoverflow.com/comment/45549379
has comment: http://stackoverflow.com/comment/45550950
answer count: 1
has body: I have a code here of inserting and displaying record without refreshing web page using ajax and plain php but I don't know how to set this up using codeigniter. Please help. Here are the codes inserting.php // HTML code What are you doing? demo_insert.php PHP Code display recently inserted record from the database. <?php include('db.php'); if(isSet($_POST['content'])) { $content=$_POST['content']; mysql_query("insert into messages(msg) values ('$content')"); $sql_in= mysql_query("SELECT msg,msg_id FROM messages order by msg_id desc"); $r=mysql_fetch_array($sql_in); } ?> <?php echo $r['msg']; ?>
favorite count: 0
has comment: http://stackoverflow.com/comment/45552046
has comment: http://stackoverflow.com/comment/45642139
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/45552948
has answer: http://stackoverflow.com/a/28629959
score: 1
tagged with: codeigniter
upvote count: 1
has title: How to Insert and display record without refreshing web page in codeigniter version?

http://stackoverflow.com/q/28736022
has body: The debugger in Chrome/Safari does not show unmangled variable names when using source maps generated with grunt-contrib-uglify. Source code is displayed and debugged correctly. I have verified that the source map contains the variable names. Is this a bug in uglify? Original source: // two function two() { var test = "test"; console.log("this is a " + test); } Generated source: function two(){var a="test";console.log("this is a "+a)} //# sourceMappingURL=all.min.js.map Source map: { "version": 3, "file": "all.min.js", "sources": ["../src/two.js"], "names": ["two","test","console","log"], "mappings":";;AAEA,QAASA,OAEL,GAAIC,GAAO,MAEXC,SAAQC,IAAI,aAAeF", "sourceRoot":"../" }
has title: Mangled names in debugger with source maps
has comment: http://stackoverflow.com/comment/46460106
tagged with: source-maps
tagged with: google-chrome
tagged with: grunt-contrib-uglify
type: Question
upvote count: 15
tagged with: debugging
has answer: http://stackoverflow.com/a/40902193
downvote count: 0
has comment: http://stackoverflow.com/comment/64122307
tagged with: javascript
score: 15
answer count: 1
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/45555695
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28627287
has text: My bad, I couldn't know. Avoid typo on source code if you want proper help.

http://stackoverflow.com/a/55606654
answers question: http://stackoverflow.com/q/28636723
has comment: http://stackoverflow.com/comment/120813057
type: Answer
score: 7
downvote count: 2
upvote count: 9
has body: map._panes.markerPane.remove();

http://stackoverflow.com/a/28650669
answers question: http://stackoverflow.com/q/28648818
accepted answer of: http://stackoverflow.com/q/28648818
score: 2
has body: deletePlaylist appears to be attempting to delete a PlaylistItem (i.e. a video) rather than a Playlist itself. Could you try replacing playlistItems with playlists?
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 2

http://stackoverflow.com/a/28669056
has comment: http://stackoverflow.com/comment/45632759
has comment: http://stackoverflow.com/comment/45645203
has comment: http://stackoverflow.com/comment/45639572
has comment: http://stackoverflow.com/comment/45674392
has body: Try this $(document).click(function (e) { var container = $("#wrapper"); if (!container.is(e.target) &amp;&amp; container.has(e.target).length === 0 &amp;&amp; event.target.id!=="menu-toggle") { container.addClass("toggled"); } }); So what basically it is doing is if e is element you want to toggle the class and if the clicked e is also that then the class wil not toggle otherwise it will.
type: Answer
has comment: http://stackoverflow.com/comment/45633538
answers question: http://stackoverflow.com/q/28669033
has comment: http://stackoverflow.com/comment/45635537
score: 0
has comment: http://stackoverflow.com/comment/45639531

http://stackoverflow.com/a/28680436
accepted answer of: http://stackoverflow.com/q/28679842
type: AcceptedAnswer
downvote count: 0
has body: I am not 100% sure if this is the answer that you were seeking but I'll give it a shot. Instead of programming JavaScript inline you should either use it inside a &lt;script&gt;&lt;/script&gt; tag or in a JavaScript file. So what i did was that i set an Event Listener on the select field and what that does is that it listens to when you click, for instance: var select = document.getElementById('retrieveMarriage'); // Where it says EVENT you can insert any event that you would like select.addEventListener('EVENT', function() {}); And then you just insert some simple logic into the curly brackets. E.g. naming the hidden divs to something like "box-" followed by one of the numbers that you get from this.selectedIndex. var select = document.getElementById('retrieveMarriage'); var currentOption = 0; // Add event listener that listens on when you click "select" select.addEventListener("click", function() { // If one of the other options are selected, then hide it and set it to empty if(currentOption &gt; 0) { document.getElementById('box-' + currentOption).style.display = 'none'; document.getElementById('box-' + currentOption).firstChild.value = ''; } // Set current option to be current option currentOption = this.selectedIndex; // Set box-N to show document.getElementById('box-' + currentOption).style.display = 'block'; }); You can check my solution out in this jsfiddle http://jsfiddle.net/6ypytx2p/ Here is a full list of events that you can use. https://developer.mozilla.org/en-US/docs/Web/Events I hope I was able to answer your question.
score: 1
has comment: http://stackoverflow.com/comment/45654098
type: Answer
has comment: http://stackoverflow.com/comment/45654226
answers question: http://stackoverflow.com/q/28679842
upvote count: 1

promise
tags question: http://stackoverflow.com/q/28730562
tags question: http://stackoverflow.com/q/28607920
tags question: http://stackoverflow.com/q/28686906
tags question: http://stackoverflow.com/q/28601985
tags question: http://stackoverflow.com/q/28703625
tags question: http://stackoverflow.com/q/28724169
tags question: http://stackoverflow.com/q/28716935
tags question: http://stackoverflow.com/q/28729046
tags question: http://stackoverflow.com/q/28727786
tags question: http://stackoverflow.com/q/28609205
tags question: http://stackoverflow.com/q/28747161
tag name: promise
tags question: http://stackoverflow.com/q/28703241
type: Tag
tags question: http://stackoverflow.com/q/28687566
tags question: http://stackoverflow.com/q/28626959
tags question: http://stackoverflow.com/q/28667147
tags question: http://stackoverflow.com/q/28633187
tags question: http://stackoverflow.com/q/28663772
tags question: http://stackoverflow.com/q/28646684
tags question: http://stackoverflow.com/q/28736452
tags question: http://stackoverflow.com/q/28695092
tags question: http://stackoverflow.com/q/28642637
tags question: http://stackoverflow.com/q/28662333
tags question: http://stackoverflow.com/q/28628627
tags question: http://stackoverflow.com/q/28683071
tags question: http://stackoverflow.com/q/28704791
tags question: http://stackoverflow.com/q/28700514
tags question: http://stackoverflow.com/q/28713631
tags question: http://stackoverflow.com/q/28741980
tags question: http://stackoverflow.com/q/28637417
tags question: http://stackoverflow.com/q/28748742

http://stackoverflow.com/q/28650935
has comment: http://stackoverflow.com/comment/45600943
has comment: http://stackoverflow.com/comment/45601069
tagged with: node.js
tagged with: body-parser
type: UnansweredQuestion
has title: app.use(restify.bodyParser()) not working as req object is empty
has comment: http://stackoverflow.com/comment/45599574
upvote count: 1
has answer: http://stackoverflow.com/a/35825245
tagged with: restify
type: Question
has body: I am using restify and for the HTTP POST calls the request object is always empty. Could anyone please let me know what could be the possible reason. Regards
score: 1
has comment: http://stackoverflow.com/comment/45600216
has comment: http://stackoverflow.com/comment/45607923
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45607952
has comment: http://stackoverflow.com/comment/45599884
favorite count: 0

http://stackoverflow.com/comment/45688108
score: 0
has text: please, show us the showing() function code, if that is the one you have the issue in.
type: QuestionComment
comment on: http://stackoverflow.com/q/28698971
type: Comment

http://stackoverflow.com/comment/45639583
comment on: http://stackoverflow.com/q/28673069
has text: `return getRandomAlphabet(alphabet, randomAlphabet)`
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45722287
comment on: http://stackoverflow.com/q/28716921
score: 0
has text: `marker` is defined as an array but then you are using it as a simple variable (`marker = ...`). What I would do: `var markers = [];` (note the **s** in marker**s**) then `var marker = new MarkerWithLabel ...` then `markers.push(marker)` if you aim to keep each marker in an array for further reference.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28729333
type: Question
tagged with: google-apps-script
has comment: http://stackoverflow.com/comment/45746617
tagged with: google-sheets
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45751371
has title: Array overwrite issues in Google Scripts
has comment: http://stackoverflow.com/comment/45746394
favorite count: 0
tagged with: google-api
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28730595
upvote count: 1
has body: I'm coding a google sheets extension. Basically, the script looks at a table like this: "A" | "B" | "C" | "E~F" For every string split by the "~" in column four, I need to create two arrrays so that the last column is E or F, but the remaining values are identical, like so: [["A","B","C","E"],["A","B","C","F"]] Now, theoretically this should be easy: I split the last column and loop over that. However, when I append my array, it overwrites the second value, leaving me with: [["A","B","C","F"],["A","B","C","F"]]. Please note that column E will have an indeterminate number of elements in the future. I appreciate any help! var rangeArr=[["BF-A", "true", 'A kind reminder to make a weather report if you are on duty today', 'Something','2.0', 'Humphrey Bogart~James Dean'], ['BF-B', 'true', 'Kindly report on the condition of the BF now', 'Something else', '4.0', 'Humphrey Bogart~James Dean'], ['R-A6', 'true','A kind reminder to report on the reservoir level', 'Something completely different', '1.0', 'Angela Merkel']]; var newArr=[[]]; var count=0; for(i in rangeArr){ var str=rangeArr[i][5]; var places=str.split("~"); var otherThings=rangeArr[i]; otherThings.pop() for (a in places){ otherThings[5]=places[a] var nextThing=otherThings newArr[count]=nextThing; count=count+1; } } alert(newArr)
score: 1

http://stackoverflow.com/comment/45595032
has text: chaining css() after effect() doesn't work either.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28648640
type: QuestionComment

http://stackoverflow.com/comment/49332950
has text: ? any thoughts about this issue
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28657702
type: Comment

http://stackoverflow.com/comment/45597173
comment on: http://stackoverflow.com/a/28649885
type: Comment
has text: Where would I place the JS, inside of which variable? options?
score: 0
type: AnswerComment

http://stackoverflow.com/q/28746769
has body: Following is parent modal code (code 1): $('#modal_parent').on('shown.bs.modal', function() { ..... }) Following is how I open a modal inside "modal_parent" by calling Js function (code 2): function editEntry(id){ $("#childmodal").modal(); } Now, when code 2 is executed, why is code 1 also getting executed? In short, when child modal is opened in a parent, why does parent modal opening code also get fired? Both these modals have different ids as shown above. Any custom code suggestions so as not to fire code 1 when code 2 gets executed ?
type: Question
has title: Boostrap child modal on opening fires parent modal open event
accepted answer: http://stackoverflow.com/a/28749486
tagged with: twitter-bootstrap
score: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28749486
answer count: 1
tagged with: bootstrap-modal
has comment: http://stackoverflow.com/comment/45775921
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28637042
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45831403
tagged with: javascript
has answer: http://stackoverflow.com/a/28778653
has comment: http://stackoverflow.com/comment/45574091
favorite count: 0
has body: I am trying to save a value on a 'collection' called 'orders'. But when i click 'save', it gives me an error code 121. I have already checked my key-value parameters, but i can't find a $ or a . to make it give me this error... Here is my code (the variable names are in portuguese, but only that) var objRevenda = Parse.Object.extend("resellers"), objPedido = Parse.Object.extend("orders"), query = new Parse.Query(objRevenda), idRevenda = $scope.revenda.id; query.get(idRevenda, { success: function(revenda) { var valores = { status: 'aberto', client: $rootScope.usuarioAtual, reseller: revenda, payment_method: metodo_pgto, items: $scope.itens, total: $scope.totalPedido }; var pedido = new objPedido(); pedido.save(valores, { success: function(pedido) { console.log('Sucesso'); }, error: function(pedido, error) { console.error('Ops... ', error); } }); }, error: function(revenda, error) { console.log(error); } }); Can someone help me find the error? Btw: I am using AngularJS and Ionic Framework. Thanks in advance.
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28854365
has comment: http://stackoverflow.com/comment/45638623
has title: Parse error code 121
score: 2
tagged with: parse-platform
upvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/45831638
has comment: http://stackoverflow.com/comment/45873374
tagged with: ionic-framework
has comment: http://stackoverflow.com/comment/45638570

http://stackoverflow.com/a/28638218
type: Answer
answers question: http://stackoverflow.com/q/28638049
score: 0
has body: As Nikita said, there are a bunch of reserved words you can't use like var and function. What (I think) you can do is put capitals like 'vAr' or 'functioN' but that's about as close as you can get to the actual word.

http://stackoverflow.com/q/28607265
has comment: http://stackoverflow.com/comment/45518822
tagged with: javascript
upvote count: 2
has comment: http://stackoverflow.com/comment/45518613
has answer: http://stackoverflow.com/a/28609236
answer count: 3
favorite count: 0
has title: Execute javascript code ONLY if width is higher than x pixels
has body: I'm trying to execute a javascript function ONLY if the width is bigger than 1200pixels. The code I need to execute works, but the check for the screen size doesn't: window.addEventListener("resize", function(){ if (document.documentElement.clientWidth &gt; 1203) { &lt;&lt;&lt;some other code that's working&gt;&gt;&gt; } }, true); All this code is in a javascript file outside the document.ready function. EDIT: When you drag your screen window around, it isn't working like normal css queries. This is the problem. It works if you refresh your page, but if you change the width of your browser, then it doesn't adjust, it needs the reload right now. That's my issue.
possible better answer: http://stackoverflow.com/a/28607406
has comment: http://stackoverflow.com/comment/45518669
has answer: http://stackoverflow.com/a/28607589
has comment: http://stackoverflow.com/comment/45518525
type: AnsweredQuestion
score: 1
tagged with: media-queries
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45518806
accepted answer: http://stackoverflow.com/a/28609236
has answer: http://stackoverflow.com/a/28607406
has comment: http://stackoverflow.com/comment/45519686
has comment: http://stackoverflow.com/comment/45522137
tagged with: addeventlistener

http://stackoverflow.com/comment/45776073
comment on: http://stackoverflow.com/q/28746441
type: Comment
type: QuestionComment
has text: I recall once seeing a way to do it via the JavaScript SDK, I couldn't find it again.
score: 0

http://stackoverflow.com/comment/45845246
type: AnswerComment
comment on: http://stackoverflow.com/a/28755681
score: 0
type: Comment
has text: That's not the correct way to refer to the `ids` property. I'd recommend taking a look at the [Account Explorer](https://ga-dev-tools.appspot.com/account-explorer/) tool; it can help you figure out which ID to use in which use-case.

http://stackoverflow.com/q/28645997
has title: Wordpress: Making a menu link behave the same as a "more" button
favorite count: 0
type: Question
tagged with: php
tagged with: css
score: 0
has comment: http://stackoverflow.com/comment/45589774
tagged with: wordpress
upvote count: 1
answer count: 1
downvote count: 1
has body: I have a question about a wordpress menu on my site. If you open my site in a mobile resolution (just scale it down) you can see the menu changes to a mobile version, which is nice. I want the Sneakers + and Shop reviews + links to behave the same as the arrow button next to it, so, when mobile users click the Sneakers +, the corresponding menu will fold, just like when you tap the arrow button. I tried checking the code but the arrow button just consists of this: &lt;i class="next-level"&gt;&lt;/i&gt; The site is www.nieuwesneakers.nl What is the proper code or href="" to use on the menu item? The href right now is "#" because it's only use is to indicate next level menu. Thanks in advance.
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45589964
has answer: http://stackoverflow.com/a/28646164

http://stackoverflow.com/q/28664379
score: 1
accepted answer: http://stackoverflow.com/a/28664435
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/9381926
answer count: 3
has title: How do I return HTML to shown as HTML and not as text when using $http Angular
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has answer: http://stackoverflow.com/a/28664435
favorite count: 0
has comment: http://stackoverflow.com/comment/45625906
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/28664492
upvote count: 1
tagged with: php
has answer: http://stackoverflow.com/a/28664492
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28664570
has body: I've been stuck on this for days. Basically I have a $http.post with Angular, posting an e-mail address and message to be emailed from post.php. Post.php is then echoing text depending on the result of the mail(), but when I return Success for example, it will actually show the HTML on the DOM instead of process it. Appreciate any help. app.controller('contactsController', function($scope, $rootScope, $http) { $rootScope.currentPage = "contact"; $scope.postData = {}; $scope.data = "Send"; $scope.runScript = function() { $http({ url: "post.php", method: "POST", headers: {'Content-Type': 'application/x-www-form-urlencoded'}, data: $.param({"postData":$scope.postData}) }).success(function(data) { $scope.data = data; console.log(data); $scope.contactForm.$valid = false; }).error(function(data, status, headers, config) { $scope.status = status; }); }; }); <?php // get the raw POST data $inputData = $_POST['postData']; if(isset($inputData["email"])&&isset($inputData["message"])) { $email = $inputData["email"]; $message = $inputData["message"]; $to = "XXXXXXXXXXXXX@XXXXXXXXXX.COM"; // required $from = $email; // required $body = $message; $subject = "Online Query Submission"; // create email headers if(mail($to,$subject,$body,"From:$from/r/nReply-to:$from")) echo " Success - Thanks! "; else echo " Error - Sorry! "; } ?>

http://stackoverflow.com/comment/45589559
has text: It is actually executed and I don't understand why this is the case
comment on: http://stackoverflow.com/q/28645314
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45501586
type: QuestionComment
comment on: http://stackoverflow.com/q/28597462
has text: Actually, I think your code works just fine! You defined array, it exists, so it's "true". !x should return false.
score: 0
type: Comment

http://stackoverflow.com/comment/45591509
type: QuestionComment
comment on: http://stackoverflow.com/q/28646533
score: 0
has text: It's not an opinion. If you need to iterate, you need to iterate. Implementation details don't matter. If you meant to compare `for-in` vs `Object.keys() + for`, that's a little different but implementation details still don't matter. What would matter would be laying out your concerns and comparing the two.
type: Comment

http://stackoverflow.com/comment/46029360
type: AnswerComment
score: 0
has text: See the update to my original question for my final solution. This one still has a few false positives and one big problem is that it doesn't accept a 0 in the first three digits, e.g. "10,123" will fail. My fault.
type: Comment
comment on: http://stackoverflow.com/a/28721726

http://stackoverflow.com/comment/45573384
has text: Try placing the `slideDown()` method inside the `complete` setting of the `slideUp()` method
score: 0
comment on: http://stackoverflow.com/q/28636844
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45667922
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28687668
has text: @ArunPJohny, I'm not going to speculate why `assistanceRequired` should change. Just suffice that it **could** do so between rapid successive calls of the function.
type: Comment

http://stackoverflow.com/comment/45756221
type: Comment
score: 1
type: AnswerComment
has text: after using ur code, I am getting the close button, but the problem now is whenever I click on details button value is gettting repeated, like if I clicked details n closed it n again opened it gives "some text twice"
comment on: http://stackoverflow.com/a/28735716

http://stackoverflow.com/q/28630480
answer count: 2
linked to: http://stackoverflow.com/q/500504
has answer: http://stackoverflow.com/a/28630605
tagged with: arrays
linked to: http://stackoverflow.com/q/24563837
has title: Javascript updating object with another object
has comment: http://stackoverflow.com/comment/45561116
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28630605
has body: I have two objects, the first one: prods = [ { 'id':1, 'category_ID' : 26, 'name':'prod1', 'descripcion' : 'sadasdsad', }, { 'id':2, 'category_ID' : 26, 'name':'prod2', 'descripcion' : '21312d', }, { 'id':3, 'category_ID' : 6, 'name':'prod3', 'descripcion' : 'ergrd', }, { 'id':4, 'category_ID' : 12, 'name':'prod4', 'descripcion' : 'wwwwwwww', } ] And the second one, with its elements ordered randomly orders = [ { 'id':2, 'category_ID' : 26, 'name':'producto2', 'descripcion' : '21312d', 'units': 1, 'isSelected' : 1 }, { 'id':4, 'category_ID' : 12, 'name':'producto4', 'descripcion' : 'wwwwwwww', 'units': 21, 'isSelected' : 1 }, { 'id':1, 'category_ID' : 26, 'name':'producto1', 'descripcion' : 'sadasdsad', 'units': 34, 'isSelected' : 1 } ] I'm trying to update the elements of the first object with the ones of the second matching id's and adding new propierties, so the result would be prods = [ { 'id':1, 'category_ID' : 26, 'name':'prod1', 'descripcion' : 'sadasdsad', 'units': 34, 'isSelected' : 1 }, { 'id':2, 'category_ID' : 26, 'name':'prod2', 'descripcion' : '21312d', 'units': 1, 'isSelected' : 1 }, { 'id':3, 'category_ID' : 6, 'name':'prod3', 'descripcion' : 'ergrd', }, { 'id':4, 'category_ID' : 12, 'name':'prod4', 'descripcion' : 'wwwwwwww', 'units': 21, 'isSelected' : 1 } ] I'm getting dizzy in a sea of loops... with no result... any clues?
possible better answer: http://stackoverflow.com/a/28631080
type: Question
tagged with: object
has answer: http://stackoverflow.com/a/28631080
has comment: http://stackoverflow.com/comment/45561164
tagged with: javascript
score: 0

http://stackoverflow.com/a/28720134
has body: have a look to this Demo you can call ValidateColour() function without "CarCtrl." since it is in scope function CarCtrl($scope) { $scope.ValidateColour = function(colour){ return colour === "Red"; } }
score: 0
answers question: http://stackoverflow.com/q/28719035
type: Answer

http://stackoverflow.com/a/28678282
upvote count: 5
type: Answer
downvote count: 0
score: 5
answers question: http://stackoverflow.com/q/28678027
has body: I hope this is what you expected. $(document).ready(function(){ var animals=["cat","dog","pikachu","charmaner"]; $.each(animals,function(index,value){ var checkbox=" "+value+" " $(".checkBoxContainer").append($(checkbox)); }) });

http://stackoverflow.com/q/28657287
favorite count: 0
has title: Passing Values in Angular JS
tagged with: angularjs
has answer: http://stackoverflow.com/a/28657470
type: AnsweredQuestion
score: 2
possible better answer: http://stackoverflow.com/a/28657447
upvote count: 2
has answer: http://stackoverflow.com/a/28657447
type: Question
accepted answer: http://stackoverflow.com/a/28657470
has body: I'm a newbie to Angular JS. I've created a form in my index.html page, when I fill the details in the form and press submit, it should redirect to details.html page. Where I can able to show the details filled on the form. HTML First Name: Last Name: Age: Email : Location SUBMIT CONTROLLER var FormApp = angular.module('FormApp', []); FormApp.controller('CustomerDetailsController', ['$scope',function($scope) { $scope.submit = function() { } }]); What will be the best way to do this? Any help would appreciated, Thanks.
tagged with: javascript
answer count: 2
has comment: http://stackoverflow.com/comment/45610922
tagged with: http://stackoverflow.com/tag/html
downvote count: 0

http://stackoverflow.com/comment/45807953
type: QuestionComment
comment on: http://stackoverflow.com/q/28745511
has text: can't you resolve them with the context needed? The array of resolves will be `arguments` in `$.when.done`
score: 0
type: Comment

http://stackoverflow.com/comment/45499646
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28596169
has text: @Ted [link](http://postimg.org/image/jig2ya8zj/). i'm trying to click that but it wont roll

http://stackoverflow.com/comment/45701287
comment on: http://stackoverflow.com/q/28705618
type: Comment
score: 0
has text: @MattBurland good spot
type: QuestionComment

http://stackoverflow.com/comment/45575412
type: Comment
has text: Will you show the part of your markup that is affected by the JavaScript?
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28637896

http://stackoverflow.com/q/28667990
has comment: http://stackoverflow.com/comment/45630531
has comment: http://stackoverflow.com/comment/45630504
has comment: http://stackoverflow.com/comment/45630266
has answer: http://stackoverflow.com/a/28668001
has comment: http://stackoverflow.com/comment/45630478
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45630641
possible better answer: http://stackoverflow.com/a/28668037
type: Question
has comment: http://stackoverflow.com/comment/45630357
has answer: http://stackoverflow.com/a/28668065
has title: Better solution for dealing with large number of click events with Jquery
has comment: http://stackoverflow.com/comment/45630623
score: 0
answer count: 3
tagged with: anonymous-function
linked to: http://stackoverflow.com/q/1687296
has body: I have a large number of buttons in my page and i want to add a click event to each of the buttons , that is when the user click the buttons it shows the corresponding button value. i have already implement a method with the help of anonymous functions. i have included my code below HTML &lt;div id="div1"/&gt; Javascript $(document).ready(function(){ for(var i =0;i&lt;100;i++) { $("#div1").append("&lt;input type='button' class='myclass' id='mybutton" + i + "' value='mybutton" + i + "'&gt; "); }; $(".myclass").click(function(e){ alert(e.target.id); }); }); It is working perfectly, the problem is an anonymous function is created for each button on this Form, that is if i have 10k elements in my page then anonymous function will created 10k times, i think i causes big memory wastage. Is there any better way for achieving this ? please help me to solve this , any help will be greatly appreciated . Thanks
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28668001
has answer: http://stackoverflow.com/a/28668037

http://stackoverflow.com/q/28634469
has comment: http://stackoverflow.com/comment/45568843
tagged with: javascript
answer count: 3
has comment: http://stackoverflow.com/comment/45569113
tagged with: jquery
has answer: http://stackoverflow.com/a/28634563
type: UnansweredQuestion
has body: All I want is set getElementById by var (it must be automatic because I have got multiple of this range inputs (brightness, contrast, sharpen, etc.). How can I do this? function showVal(value, id) { var spanId = "#" + id + "Id"; document.getElementById("\"" + spanId + "\"").innerHTML = value; } Jasność: 0
has answer: http://stackoverflow.com/a/28634534
score: 0
tagged with: dom
type: Question
has answer: http://stackoverflow.com/a/28634654
has title: How can I select JavaScript "Id" by var?

http://stackoverflow.com/q/28730090
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28730764
linked to: http://stackoverflow.com/q/10730362
has title: Use http cookie value in an Angular template
tagged with: angularjs
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28730764
tagged with: cookies
has answer: http://stackoverflow.com/a/28730182
has body: I have angular working in one of my ASP.NET MVC applications. I am using two html templates with Angular Routing. One is a list of current Favorites that comes from the database and is serialized into json from my Web API and used by angular to list those items from the database. The second html template is a form that will be used to add new favorites. When the overall page that includes my angular code loads, it has a cookie named currentSearch which is holding the value of whatever the last search parameters executed by the user. I would like to inject this value into my angular html template (newFavoriteView.html) for the value of a hidden input named and id'd searchString. I have tried using jQuery, but had problems, plus I would much rather do this inside of angular and somehow pass the value along to my template or do the work inside the view(template). However, I know the latter would be bad form. Below is the code I think is important for one to see in order to understand what I am doing. Index.cshtml (My ASP.NET VIEW) @{ ViewBag.Title = "Render Search"; ViewBag.InitModule = "renderIndex"; } @section ngScripts { } Setting the cookie in the MVC Controller private void LastSearch() { string lastSearch = null; if (Request.Url != null) { var currentSearch = Request.Url.LocalPath + "?" + Request.QueryString; if (Request.Cookies["currentSearch"] != null) { lastSearch = Request.Cookies["currentSearch"].Value; ViewBag.LastSearch = lastSearch; } if (lastSearch != currentSearch) { var current = new HttpCookie("currentSearch", currentSearch){ Expires = DateTime.Now.AddDays(1) }; Response.Cookies.Set(current); var previous = new HttpCookie("lastSearch", lastSearch) { Expires = DateTime.Now.AddDays(1) }; Response.Cookies.Set(previous); } } } render-index.js angular .module("renderIndex", ["ngRoute"]) .config(config) .controller("favoritesController", favoritesController) .controller("newFavoriteController", newFavoriteController); function config($routeProvider) { $rout…
tagged with: forms
type: Question
tagged with: asp.net-mvc-5
possible better answer: http://stackoverflow.com/a/28730182
answer count: 2

http://stackoverflow.com/comment/45764591
score: 0
type: Comment
type: QuestionComment
has text: use phantom.js a headless browser, it will load and render the page. you can access different elements on the page using its javascript API.
comment on: http://stackoverflow.com/q/28739098

http://stackoverflow.com/q/28669960
has answer: http://stackoverflow.com/a/28670057
type: Question
has comment: http://stackoverflow.com/comment/45633940
has answer: http://stackoverflow.com/a/28670033
tagged with: javascript
has answer: http://stackoverflow.com/a/28670094
score: 0
has body: so, I have an array of 15 links, and I want to pass them as img src into my html elements. My elements are all of class. card, and I figured I'd write a loop instead of hard coding it (I have to do this 45 times with different links). so it looks like this var picks1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; for(x=0;x&lt;picks1.length;x++) { $(".card:eq(x)").src = "picks1[x]"; } is there a way to do it like this? I figure this isn't working because of the quotation marks at .card:eq(x). (there are 45 picks arrays and their .length changes from 1-15). Is there another way to do this? This is a part of a bigger webpage, can post source if needed, basically what it does it read a log file that another program makes, then makes links to images on a third party website from it and puts them in arrays.
has answer: http://stackoverflow.com/a/28670055
tagged with: jquery
has answer: http://stackoverflow.com/a/28670021
answer count: 5
has title: writing a for loop with .class:eq()
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28670057
has comment: http://stackoverflow.com/comment/45633936
accepted answer: http://stackoverflow.com/a/28670021

http://stackoverflow.com/a/28606319
answers question: http://stackoverflow.com/q/28606149
has comment: http://stackoverflow.com/comment/45519820
has body: JSON is invalid - see correction { "universities" : [ { "title": "Aberystwyth University", "web": "www.aber.ac.uk", "phone": "+44 (0)1970 623 111", "lat": 52.415524, "lng": -4.063066 }, { "title": "Bangor University", "web": "www.bangor.ac.uk", "phone": "+44 (0)1248 351 151", "lat": 53.229520, "lng": -4.129987 }, { "title": "Cardiff Metropolitan University", "website": "www.cardiffmet.ac.uk", "phone": "+44 (0)2920 416 138", "lat": 51.482708, "lng": -3.165881 } ] }
score: 0
type: Answer

http://stackoverflow.com/comment/45671911
type: QuestionComment
has text: Even jQuery is pure JavaScript, I think you wanted to say plain JS or vanilla JS ( or when talking about browsers native JS API ). And if you are talking about browsers... I think you will need some work in accessing the local files which are supposed to be out of browser sandbox.
comment on: http://stackoverflow.com/q/28690096
score: 0
type: Comment

http://stackoverflow.com/comment/45747978
has text: Thank you for the help, I actually just figured it out - first i had an error calling my jquery library, then it only worked using the document.ready.... but it is fixed and working now! thanks!
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28730164

http://stackoverflow.com/q/28627975
type: Question
score: 0
answer count: 1
type: UnansweredQuestion
has body: I got a problem with ajax in mootools. Is it possible to load some content same as in jQuery in mootools becouse i cant find anything about ajax in mootools. My request is simple , its look like that. Can some1 help me? ///////////////////////////////////////////// var json = (function () { var json = null; $.ajax({ 'async': false, 'url': '/a/b/c.json', 'dataType': "json", 'success': function (data) { json = data; } }); return json; })(); //////////////////////////////
has title: Ajax using in mootools to load file
has answer: http://stackoverflow.com/a/28628146
has comment: http://stackoverflow.com/comment/45557218
tagged with: javascript
tagged with: jquery
tagged with: ajax

http://stackoverflow.com/q/28695572
has comment: http://stackoverflow.com/comment/45736492
has body: I am struggling with flash and firefox (latest, 35.0.1) and can't find any solution. I want to call an ActionScript function with javascript, using ExternalInterface. So I wrote this simple javascript function (App is just an object to wrap my functions): App.swfCall = function(callbackName, params) { var callback = $('#swf object, #swf embed')[0][callbackName]; if(typeof(callback) === "function") { callback.apply(null, params); // executed but throws NPObject error... } } And Firefox throws an error: Bad NPObject as private data! The only help I found about this error is not relevant with my issue, as: Everything is ready at this moment; actually the action is first initiated by a user action on the swf itself There is no cross-domain issues (everything on the same domain) Actually, if I do not use the Function javascript object (either with call() or apply()), everything works fine. So this is working: App.swfCall = function(callbackName, data) { var swf = $('#swf object, #swf embed')[0]; if(typeof(swf[callbackName]) === "function") { swf[callbackName](data); } }; Anyway there are many problems with this: I can just pass a single argument to the function ...And I have to check if the parameter is the "data" parameter is not null I cannot pass null parameters beacause of that (not the biggest issue) So all I need is to be able to pass parameters to the swf (0, one or more!) And I'd really like to understand what is happening, too. I said there is no cross-domain issues, actually it is an iframe within facebook. But obviously everything is inside it and on the same domain, so it shouldn't be a problem.. should it? Thank you!
score: 3
has comment: http://stackoverflow.com/comment/45772405
tagged with: externalinterface
upvote count: 3
tagged with: flash
tagged with: firefox
has title: Firefox "Bad NPObject" error with swf only when using Function.apply()
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45713972
tagged with: actionscript-3
has comment: http://stackoverflow.com/comment/45756525
linked to: http://stackoverflow.com/q/1038668
downvote count: 0
has answer: http://stackoverflow.com/a/37238721
type: UnansweredQuestion
type: Question

http://stackoverflow.com/q/28607209
tagged with: google-chrome
has body: I have a parent page Page.aspx with input type submit button what i need is to before sumbit return true i need to call its iframe __PostBack. in IE it is working quit fine but in chrome it is not firing iFrame __PostBack. here is my code: PageA.aspx &lt;input type="submit" id="btnNext" class="buttons" onclick="return SubmitForm('uwtNav');"&gt; function SubmitForm(ctlName){ window.frames[iframe.id].SubmitForm(); return true;} PageB.aspx(iFrame) function SubmitForm() { try { __doPostBack('', 'MyCustomArgument_0'); } catch(error){} } Here __doPostBack for Iframe is not being fired. Thanks
type: Question
tagged with: javascript
has title: Asp.net call iframe __doPostBack before parent Submit in chrome
downvote count: 0
tagged with: asp.net
favorite count: 0
type: UnansweredQuestion
answer count: 0
score: 1
tagged with: iframe
upvote count: 1

wordpress
tags question: http://stackoverflow.com/q/28651168
tags question: http://stackoverflow.com/q/28701402
tags question: http://stackoverflow.com/q/28685402
tags question: http://stackoverflow.com/q/28686005
tags question: http://stackoverflow.com/q/28705602
tags question: http://stackoverflow.com/q/28626152
tags question: http://stackoverflow.com/q/28608558
tags question: http://stackoverflow.com/q/28644523
tags question: http://stackoverflow.com/q/28737066
tags question: http://stackoverflow.com/q/28620764
tags question: http://stackoverflow.com/q/28703983
tags question: http://stackoverflow.com/q/28692375
tags question: http://stackoverflow.com/q/28698960
tags question: http://stackoverflow.com/q/28612767
tags question: http://stackoverflow.com/q/28612032
tags question: http://stackoverflow.com/q/28717609
tags question: http://stackoverflow.com/q/28597137
tags question: http://stackoverflow.com/q/28718225
tags question: http://stackoverflow.com/q/28674361
tags question: http://stackoverflow.com/q/28677098
tags question: http://stackoverflow.com/q/28708463
tags question: http://stackoverflow.com/q/28703240
tag name: wordpress
tags question: http://stackoverflow.com/q/28665529
tags question: http://stackoverflow.com/q/28670527
tags question: http://stackoverflow.com/q/28645997
tags question: http://stackoverflow.com/q/28597994
tags question: http://stackoverflow.com/q/28679350
tags question: http://stackoverflow.com/q/28595912
tags question: http://stackoverflow.com/q/28702432
tags question: http://stackoverflow.com/q/28689701
tags question: http://stackoverflow.com/q/28610755
tags question: http://stackoverflow.com/q/28697460
tags question: http://stackoverflow.com/q/28733158
tags question: http://stackoverflow.com/q/28649533
tags question: http://stackoverflow.com/q/28680597
tags question: http://stackoverflow.com/q/28717907
tags question: http://stackoverflow.com/q/28615140
tags question: http://stackoverflow.com/q/28644235
tags question: http://stackoverflow.com/q/28624293
tags question: http://stackoverflow.com/q/28742278
type: Tag

http://stackoverflow.com/a/28729396
has comment: http://stackoverflow.com/comment/45778921
type: Answer
upvote count: 1
score: 1
has body: As said by RienNeVaPlu͢s & Ken Fyrstenberg, make sure you give your image time to load with onload. Here's a proof-of-concept allowing html drag-drop of a spliced image-canvases: https://jsfiddle.net/m1erickson/g9nfuved/ Drag 1+ of the image strips Drop Here.
downvote count: 0
answers question: http://stackoverflow.com/q/28726450

http://stackoverflow.com/comment/45696347
type: Comment
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28702128
has text: I guess I just "saw it"

http://stackoverflow.com/a/28678766
score: 1
answers question: http://stackoverflow.com/q/28639888
has body: Thanks Franky! I was able to make create it, eventRender: function (event, element) { if (event.description == "(S)") { //SOFTWARE DEPARTMENT element.css('background-color', '#00FF00'); } else if (event.description == "(E)") { // ELECTRONICS DEPARTMENT element.css('background-color', '#0000FF'); } else if (event.description == "(J)") { // JP element.css('background-color', '#FF0000'); } else if (event.description == "(H)") { // HARDWARE DEPARTMENT element.css('background-color', '#FFFF00'); } else if (event.description == "(A)") { // ADMIN DEPARTMENT element.css('background-color', '#FF00FF'); } else { // ANYONE ELSE NOT IN EITHER OF THE DEPARTMENTS ABOVE element.css('background-color', '#000000'); } },
downvote count: 0
has comment: http://stackoverflow.com/comment/63977384
type: Answer
has comment: http://stackoverflow.com/comment/63978549
upvote count: 1

http://stackoverflow.com/q/28629496
tagged with: javascript
has answer: http://stackoverflow.com/a/28630003
score: 0
has comment: http://stackoverflow.com/comment/45559090
answer count: 3
tagged with: jquery
has body: IE 8 &amp; IE11 there is alot of diff Can anyone help me why there is variance please? Refer below Image link below for ie8 &amp; 11 output difference &amp; whole code : http://postimg.org/image/e26ikiv1l/ (or) http://tinypic.com/r/2a4nxp3/8 Note : First alert works only in IE8 but second alert works in both IE8 &amp; IE11 Reference java script code : $(document).ready(function(){ $("a.explode").click(function(){ var _rule = $(this).val(); var _overrule = $(this).attr('value'); alert(_rule); alert(_overrule); }); });
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28630121
has title: Jquery this.val not work in IE11
has answer: http://stackoverflow.com/a/28629588
type: Question
tagged with: internet-explorer-8
tagged with: internet-explorer-11

http://stackoverflow.com/comment/45635884
score: 0
type: AnswerComment
type: Comment
has text: Thanks for the information, this helps my understanding as well! To get your calcPayInner function working I had to return pay at the end of it as well.
comment on: http://stackoverflow.com/a/28670594

http://stackoverflow.com/q/28716624
has comment: http://stackoverflow.com/comment/45722071
tagged with: css-shapes
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28717726
accepted answer: http://stackoverflow.com/a/28717449
has comment: http://stackoverflow.com/comment/45721595
has answer: http://stackoverflow.com/a/28717238
has answer: http://stackoverflow.com/a/39392288
downvote count: 3
possible better answer: http://stackoverflow.com/a/28717408
has body: Here is my code for small circle: &lt;div id="circle"&gt;&lt;/div&gt; #circle { width: 40px; height: 40px; background: green; -moz-border-radius: 20px; -webkit-border-radius: 20px; border-radius: 20px; } Here is jsfiddle link for big circle: http://jsfiddle.net/x1n15791/14/ I need to fit small circle into my big circle at center position. And after fitting, i need some space between small and big circles. May i know, how to do that? Any help would be highly appreciated. Thanks in advance.
has answer: http://stackoverflow.com/a/28717408
type: Question
linked to: http://stackoverflow.com/q/28718697
answer count: 8
has comment: http://stackoverflow.com/comment/45720921
has answer: http://stackoverflow.com/a/28716776
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/45720751
has comment: http://stackoverflow.com/comment/45721277
linked to: http://stackoverflow.com/q/28646858
has answer: http://stackoverflow.com/a/28717449
has comment: http://stackoverflow.com/comment/45722201
has answer: http://stackoverflow.com/a/28716794
has comment: http://stackoverflow.com/comment/45720929
favorite count: 0
has title: How to add small circle into big circle in css3?
upvote count: 2
has comment: http://stackoverflow.com/comment/45721408
has comment: http://stackoverflow.com/comment/45721896
linked to: http://stackoverflow.com/q/27943053
has answer: http://stackoverflow.com/a/28717137
tagged with: css

http://stackoverflow.com/q/28747087
upvote count: 3
accepted answer: http://stackoverflow.com/a/28747230
downvote count: 3
possible better answer: http://stackoverflow.com/a/28747398
type: Question
has answer: http://stackoverflow.com/a/28747398
has answer: http://stackoverflow.com/a/28747541
has comment: http://stackoverflow.com/comment/45776479
tagged with: javascript
has comment: http://stackoverflow.com/comment/45776476
score: 0
has answer: http://stackoverflow.com/a/28747230
has comment: http://stackoverflow.com/comment/45776774
favorite count: 0
has answer: http://stackoverflow.com/a/28747402
answer count: 5
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28748200
has title: Rollover effect using JavaScript
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45777014
has body: This may be an easy question and I am over thinking it. I have a situation where I want to implement a Rollover effect. I have Img1 which is a button. When a user hovers on Img1 another img in the container (Img2) will change to (Img3). When the user is no longer hovering over Img1 then Img3 will change back to Img2. I hope that makes sense. EDIT: Thank you all for the help, it has been a pleasure knowing that there are so many people willing to help. I ended up choosing the answer that was simplest for me to use, so I apologize to offend anyone. Here is my final answer (with code): &lt;!--SECTION 3--&gt; &lt;!--////////////////////////////////////////////////////////////////////////////////////////////////////////--&gt; &lt;section id="s3"&gt; &lt;div class="container"&gt; &lt;a href="/shopping.asp"&gt;&lt;img class="btn" id="btn" src="/common/&lt;%=site_version%&gt;/img/s3_order_btn.png" draggable="false" alt=""&gt;&lt;/a&gt; &lt;img class="bulb" id="bulb" src="/common/&lt;%=site_version%&gt;/img/s3_bulb_noglow.png" draggable="false" alt=""&gt; &lt;/div&gt; &lt;/section&gt; &lt;!--////////////////////////////////////////////////////////////////////////////////////////////////////////--&gt; &lt;!--END OF SECTION 3--&gt; &lt;script&gt; $("#btn").hover(function(){ // when mouseover $("#bulb").attr("src","/common/&lt;%=site_version%&gt;/img/s3_bulb_glow.png"); }, function() { // when mouseout $("#bulb").attr("src","/common/&lt;%=site_version%&gt;/img/s3_bulb_noglow.png"); }); &lt;/script&gt;

http://stackoverflow.com/comment/45719086
type: Comment
comment on: http://stackoverflow.com/q/28715650
score: 0
type: QuestionComment
has text: add these alert in some kind of event `click` or `change` otherwise they will always be empty. as you haven't entered any value

http://stackoverflow.com/q/28729092
tagged with: jquery
upvote count: 2
has title: jQuery click event handle both class element and element inside
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has body: I have the following HTML: Denna vecka ... And the following jQuery: eventID = null; $('.eventContainer p, .eventContainer').click(function (e) { //eventID = $(this).attr('id'); eventID = e.target.id; $('.eventList#' + eventID + '_table').fadeIn(300); //alert(e.target.id); }); I want: When div class eventContainer or the paragraph inside it is clicked, I want to use the ID of eventContainer (id="dennaVecka") to display the div class eventList beneath it. My problem with the current setup is that I don't know how to get the ID of eventContainer if the paragraph is clicked. If I click the paragraph I will get the ID of the paragraph ("undefined"). Is there a way to get the ID of eventContainer in jQuery no matter if I click the div or the paragraph? Maybe I should setup the HTML in another way?
has answer: http://stackoverflow.com/a/28729182
accepted answer: http://stackoverflow.com/a/28729182
score: 2
type: AnsweredQuestion
downvote count: 0
type: Question
tagged with: javascript

http://stackoverflow.com/q/28632689
tagged with: function
has comment: http://stackoverflow.com/comment/45565475
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45565417
has answer: http://stackoverflow.com/a/28632986
accepted answer: http://stackoverflow.com/a/28632986
has answer: http://stackoverflow.com/a/28632740
has body: I have a function in Javascript that I need to repeat every 5 seconds. Here is the simple code: function myFunk() { $('body').addClass('polyonloaded'); setTimeout(myFunk, 5000); } myFunk(); It runs the function once, and does not repeat it anymore. What went wrong with my code?
has comment: http://stackoverflow.com/comment/45565463
downvote count: 4
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/45565418
has comment: http://stackoverflow.com/comment/45565390
has comment: http://stackoverflow.com/comment/45565501
score: -4
has comment: http://stackoverflow.com/comment/45565505
has comment: http://stackoverflow.com/comment/45565440
type: Question
has title: Function not repeating in Javascript?
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28632824
has answer: http://stackoverflow.com/a/28632824
answer count: 3

titanium
type: Tag
tag name: titanium
tags question: http://stackoverflow.com/q/28615055
tags question: http://stackoverflow.com/q/28679460
tags question: http://stackoverflow.com/q/28642425
tags question: http://stackoverflow.com/q/28697203
tags question: http://stackoverflow.com/q/28662876

assemble
tags question: http://stackoverflow.com/q/28595193
tag name: assemble
type: Tag
tags question: http://stackoverflow.com/q/28682091

http://stackoverflow.com/comment/45631865
type: QuestionComment
has text: Can you post some code of your attempt at solving this problem?
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28668763

http://stackoverflow.com/comment/45746680
type: QuestionComment
has text: Any error in the console? [This post](http://stackoverflow.com/questions/22710627/tainted-canvases-may-not-be-exported) talks about the same problem I have when I try your code _[with a video file, not the camera]_. Try on a server instead of your machine, it will rule that out if it doesn't work.
comment on: http://stackoverflow.com/q/28730048
score: 0
type: Comment

http://stackoverflow.com/comment/45764782
type: Comment
comment on: http://stackoverflow.com/a/28739487
has text: Have found myself in exactly the same situation :)
score: 0
type: AnswerComment

http://stackoverflow.com/a/28598716
type: Answer
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28597887
answers question: http://stackoverflow.com/q/28597887
has body: Actually iron:router have a method called Location.back() Also seems like history.back() its a good option too. Check this Add 'previousPage' and 'backMethods' or this feature request If you only want to do this on the search template try with this code. // onStop offshoot is executed whenever we LEAVE a lane Router.onStop(function(){ // register the previous route into a Session Session.set("previousLocation",this.location.path); }); // onBeforeAction is executed before indeed going to a new lane Router.onBeforeAction(function(){ // getting the previous route var previousLocationPath=Session.get("previousLocation"); // now lets back to search route. if(previousLocation ==="/search"){ this.redirect("search"); } this.next(); }); Take this code from this Previous Page location on ironRouter tutorial
score: 2
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28709081
has title: failing to use setTimeout in a for-loop
answer count: 2
tagged with: for-loop
downvote count: 0
has comment: http://stackoverflow.com/comment/45707343
favorite count: 0
linked to: http://stackoverflow.com/q/5226285
possible better answer: http://stackoverflow.com/a/28709133
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28709133
has answer: http://stackoverflow.com/a/28709273
tagged with: settimeout
upvote count: 3
accepted answer: http://stackoverflow.com/a/28709273
type: Question
has body: I've been trying to create a JavaScript function which loops fast through all the 24bit of the rgb-values and displays them in form of a dynamiclly changing div-background In order to slow the process down enough to see something I was thinking of using the setTimeout method. I did some research on using setTimeout in loops and found this. setTimeout in for-loop does not print consecutive values Seems to be describing my problem perfectly. I tried to use the solutions given there. But for some reason it does not work. Edit: It works now (It uses setInterval, because that makes probably more sense here) &lt;script&gt; function setColor(i) { var c = i.toString(16); switch(c.length) { case 1: c = "00000" + c; break; case 2: c = "0000" + c; break; case 3: c = "000" + c; break; case 4: c = "00" + c; break; case 5: c = "0" + c; break; default: c; } document.getElementById("colorContainer").style.background = "#" + c; } function loopThroughColors() { var i = 0x000000; setInterval(function(intervalId) { setColor(i); i += 1; if (i &gt;= 0xffffff) { clearInterval(intervalId); } }, 100); } &lt;/script&gt;
score: 3
has comment: http://stackoverflow.com/comment/45708264
tagged with: javascript
has comment: http://stackoverflow.com/comment/45708069

http://stackoverflow.com/comment/45562240
type: AnswerComment
comment on: http://stackoverflow.com/a/28612712
type: Comment
has text: although I do want to pass it without (), you explained well what the consequences are, thanks again!
score: 0

instantiation
type: Tag
tags question: http://stackoverflow.com/q/28717483
tag name: instantiation

http://stackoverflow.com/a/28652462
score: 4
type: Answer
upvote count: 4
has body: OK, here is how I ended up solving it: var cnt = 0; var processingStream = combine(unzip(), latin1Decoder(), part1(), part2()); inputStream.pipe(processingStream); inputStream.on('data', function(x) { var lineCnt = x.toString().split(/\r\n|\r|\n/).length; cnt += lineCnt; if (cnt &gt; 5) { inputStream.close(); inputStream.unpipe(processingStream); processingStream.end(); } }); Probably not the most efficient way, but it meets my requirements. Please note that inputstream reads in blocks so multiple lines are read at once.
downvote count: 0
answers question: http://stackoverflow.com/q/28621175

http://stackoverflow.com/comment/45688164
type: Comment
has text: Hello, I think it is what I am looking for or near. You supposed well. The player which never changes fight different enemies. Each enemies have different variables. Using an array would be great of course but I am not sure how to write it. I am going to edit my first message
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28698717

http://stackoverflow.com/q/28665258
has body: Hello I try to make a angularjs application so i retrieve a data from a json folder but it's display lik this ["adventure","sci-fi"] how can I please remove [" "] from this ["adventure","sci-fi"] this is my json folder [ { "title": "Interstellar", "genre": [ "adventure", "sci-fi" ], "watched": false }, { "title": "Inception", "genre": [ "action", "mystery", "sci-fi" ], "watched": true } ] and this my service.js var app = angular.module('appMovies', [] ); app.service('moviesService', function($http,$q){ var deferred =$q.defer(); $http.get('movies.json').then(function (data) { deferred.resolve(data); }); this.getPlayers = function () { return deferred.promise; } }) and this my controller app.controller('appcontrolles', function($scope,moviesService){ var promise = moviesService.getPlayers(); promise.then(function(data) { $scope.players =data.data; console.log($scope.players); }); }) and this is my index.html title genre watched {{movie.title}} {{movie.genre}} thanks for your help
tagged with: http://stackoverflow.com/tag/json
downvote count: 1
type: Question
tagged with: javascript
score: -1
has title: retrieve the data from json folder with angularjs
upvote count: 0
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28665332
tagged with: angularjs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28638993
has title: Check if user is EST timezone and within a set EST time range using JS
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28639216
has answer: http://stackoverflow.com/a/28639962
tagged with: javascript
has body: I have a situation where I'm trying alert users that are not in an EST timezone that try to submit a post between the hours 12am EST to 3am EST. pseudo code: var systemTimeZone = get current EST time ?? var currentUserTime = new Date(); If(currentUserTime &gt; 12am EST &amp;&amp; &lt; 3am EST){ // show alert modal } How would I go about achieving this an also taking daylight savings into account.
possible better answer: http://stackoverflow.com/a/28639042
has answer: http://stackoverflow.com/a/28639042
has answer: http://stackoverflow.com/a/28639236
downvote count: 0
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28639962
tagged with: timezone
answer count: 4
type: AnsweredQuestion
score: 1

http://stackoverflow.com/q/28604176
has title: Ajax Syntax error
has body: please i need help in my ajax code, i have an error in sending the data in ajax. it give me an error in data syntax, i tried to change it many time and i did't success-ed this is my code : $.ajax({ type: "POST", url: "customer.php", data: {content : '"msisdn = '+mob+'"' , type : 'GetCustomer' }, dataType: "json", success:function(data){ alert(data); }, error: function(error) { } });
linked to: http://stackoverflow.com/q/12991969
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28604477
has comment: http://stackoverflow.com/comment/45513265
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28604534
has answer: http://stackoverflow.com/a/28604534
score: 0
has comment: http://stackoverflow.com/comment/45513214
answer count: 2
has answer: http://stackoverflow.com/a/28604477
tagged with: ajax
has comment: http://stackoverflow.com/comment/45513274

http://stackoverflow.com/comment/45700034
type: QuestionComment
comment on: http://stackoverflow.com/q/28705192
type: Comment
has text: I'm not familiar with jQuery or the select2 library but shouldn't you have your ` ` elements outside of the ` ` tags?
score: 4

http://stackoverflow.com/comment/45721824
has text: np, you can try it also wihtout moment.js - http://stackoverflow.com/questions/15083548/convert-12-hour-hhmm-am-pm-to-24-hour-hhmm
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28713732

http://stackoverflow.com/q/28610732
favorite count: 0
has comment: http://stackoverflow.com/comment/45525557
type: Question
has answer: http://stackoverflow.com/a/60630454
upvote count: 7
tagged with: php
has answer: http://stackoverflow.com/a/28613024
linked to: http://stackoverflow.com/q/15102796
has comment: http://stackoverflow.com/comment/45526098
has comment: http://stackoverflow.com/comment/45525408
has comment: http://stackoverflow.com/comment/45525298
answer count: 5
possible better answer: http://stackoverflow.com/a/28613024
has answer: http://stackoverflow.com/a/28611352
has comment: http://stackoverflow.com/comment/45526023
has body: I had someone run a pentest against an application recently and one of the critical problems it found was when some garbage was passed in a URL like this: http://example.com/index.php/ %27%3e%3c%69%4d%67%20%53%72%43%3d%78%20%4f%6e%45%72%52%6f%52%3d%61%6c%65% 72%74%28%34%37%34%31%32%29%3e The problem is that the attacker simply adds a slash then some encoded javascript (an image tag with alert box), which kills the page. Simple and effective attack. How do I code against it? I am already cleaning all expected user inputs (such as when a user passes index.php?id= ). That part works fine. How do I protect against unexpected data quoted below the first paragraph above? (Also, is there a specific name for this type of XSS attack?)
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45525491
has title: How to protect against this type of attack?
tagged with: xss
tagged with: security
has comment: http://stackoverflow.com/comment/45525579
has answer: http://stackoverflow.com/a/60679178
linked to: http://stackoverflow.com/q/45952778
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28611352
has answer: http://stackoverflow.com/a/60690753
score: 7

http://stackoverflow.com/comment/45583603
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28642457
has text: try to set `set_time_limit(0);` in php.

http://stackoverflow.com/comment/133936532
comment on: http://stackoverflow.com/a/58255146
type: Comment
has text: Does this work without a special reciever in the iFrame document? So just any document unaltered in the iFrame?
score: 1
type: AnswerComment

http://stackoverflow.com/a/28689014
has comment: http://stackoverflow.com/comment/45670134
upvote count: 24
answers question: http://stackoverflow.com/q/28688932
accepted answer of: http://stackoverflow.com/q/28688932
has comment: http://stackoverflow.com/comment/45670164
type: AcceptedAnswer
downvote count: 0
has body: As of Angular 1.2, you just need to add the strict parameter (true) to the filter so that it looks for an exact match, and pass 2 as a number instead of a string: filter:{age:2}:true angular.module('myApp', []) .controller('myCtrl', function($scope) { $scope.friends = [ {name: "Peter", age: 2 }, {name: "Pablo", age: 55}, {name: "Linda", age: 20}, {name: "Marta", age: 37}, {name: "Othello", age: 20}, {name: "Markus", age: 32} ]; }) ; {{friend.name}}
type: Answer
has comment: http://stackoverflow.com/comment/45670096
has comment: http://stackoverflow.com/comment/45670151
score: 24
has comment: http://stackoverflow.com/comment/45670170

http://stackoverflow.com/a/28684825
score: 1
answers question: http://stackoverflow.com/q/28684786
has body: You create the deleteAllCookies function, but do not execute it. Simply call it (or do not create a function but just execute the code).
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/q/28602971
tagged with: php
has body: I have a dropdown, on its change it should redirect to a page with the dropdown's value say as a POST I tried something like this: $(document).ready(function() { $('some_dropdown').change(function() { var id = $(this).val(); var datastring = 'id=' + id; $.ajax({ type: "POST", url: "xyz.php", data: datastring, cache: false, success: function(html) { window.location.href("xyz.php"); } }); }); }); On the xyz.php page: if ($_POST['id']) { Blah Blah.. } It's not recognizing that id value on the xyz page. I want it's value on the redirected page. Edited - To make things more clear, I tried out to print the xyz.php's contents on my original page (instead of redirecting) like this - $.ajax({ type: "POST", url: "xyz.php", data: datastring, cache: false, success: function(html) { $(".somediv").html(html); } FYI, "somediv" was &lt;div class="somediv"&gt;&lt;/div&gt; in my original page(no-redirecting) and it worked!! It could identify the id. Some how can't work it out with redirecting. It can't identify the id. Edited -- Last thing, if I don't redirect and use $.ajax({ type: "POST", url: "xyz.php", data: datastring, cache: false, success: function(html) { $(".somediv").html(html); } The data loads perfect, my question is can I make some changes in the dynamically loaded textboxes and insert them in the database
has comment: http://stackoverflow.com/comment/45513244
has answer: http://stackoverflow.com/a/28603025
has title: Using jQuery or Javascript redirect to given page with a value
type: Question
has comment: http://stackoverflow.com/comment/45511919
tagged with: javascript
has comment: http://stackoverflow.com/comment/45512905
has answer: http://stackoverflow.com/a/28603565
has answer: http://stackoverflow.com/a/28604926
tagged with: jquery
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45514009
has comment: http://stackoverflow.com/comment/45513735
type: UnansweredQuestion

http://stackoverflow.com/q/28617985
tagged with: java
has body: In java it is common to call methods without explicitly declaring objects for them. eg: new Foo().bar("foobar"); I am new to javascript, it is fair enof to call it the same way ? Is new Foo().bar("foobar"); allowed in javascript OR Do I need to declare a variable var foo = new Foo(); foo.bar("foobar"); ?
has comment: http://stackoverflow.com/comment/45538918
type: Question
has answer: http://stackoverflow.com/a/28618042
tagged with: javascript
upvote count: 1
has answer: http://stackoverflow.com/a/28619660
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28618083
answer count: 4
has answer: http://stackoverflow.com/a/28618060
has title: Do I need to declare an object in javascript?
downvote count: 0
score: 1

http://stackoverflow.com/comment/45642257
score: 0
type: QuestionComment
type: Comment
has text: i checked the folder permission and its 0755 which can be writable.
comment on: http://stackoverflow.com/q/28674181

jython-2.5
tags question: http://stackoverflow.com/q/28623243
tag name: jython-2.5
type: Tag

http://stackoverflow.com/comment/45509590
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28598865
has text: So, how do I check that the src has changed? Maybe it is working and I'm not looking at it the right way to notice.
type: AnswerComment

http://stackoverflow.com/a/28717740
downvote count: 0
has body: try some like this jQuery("body").on("submit", "form", function(e){ e.preventDefault(); if(jQuery(this).attr("id") == "bookingform") { alert('this has worked'); } });
has comment: http://stackoverflow.com/comment/45730051
accepted answer of: http://stackoverflow.com/q/28717205
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28717205
type: Answer
has comment: http://stackoverflow.com/comment/45722584
has comment: http://stackoverflow.com/comment/45723633
score: 1
upvote count: 1

http://stackoverflow.com/comment/45647733
type: QuestionComment
has text: @Bergi: Too damn fast xD
score: 1
comment on: http://stackoverflow.com/q/28677325
type: Comment

http://stackoverflow.com/q/28724451
tagged with: transparency
type: Question
tagged with: three.js
upvote count: 1
has title: Three.js touching faces artifacts
answer count: 1
has answer: http://stackoverflow.com/a/28735394
accepted answer: http://stackoverflow.com/a/28735394
tagged with: artifacts
tagged with: javascript
type: AnsweredQuestion
downvote count: 0
has body: I've created two transparent boxes whose faces touch. This works great unless the boxes' faces touch. // inner object var mesh2 = new THREE.Mesh(geometry, material); mesh2.position.x = 0; mesh2.position.y = 0; mesh2.position.z = 0; mesh2.scale.x = 100; mesh2.scale.y = 50; mesh2.scale.z = 100; scene.add( mesh2 ); // outer object var mesh1 = new THREE.Mesh(geometry, material); mesh1.position.x = 0; mesh1.position.y = 0; mesh1.position.z = 0; mesh1.scale.x = 100; mesh1.scale.y = 100; mesh1.scale.z = 100; scene.add( mesh1 ); Here's the code: http://jsfiddle.net/unkya/14/ How do I get rid of these artifacts and still have the faces touch? Also, is there a way to add the boxes to the scene without having to insert the inner most ones first? Many thanks!
score: 1
favorite count: 0

http://stackoverflow.com/q/28654688
tagged with: javascript
score: -1
tagged with: google-maps-api-3
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45607229
favorite count: 0
has comment: http://stackoverflow.com/comment/45607338
has body: I want to filter the markers based on categories from the database. The infowindow are displayed on window load. The infowindow loads perfectly in the first filter, that is when i select a category from the select dropdown, the markers are filtered with the infowindow on their top. However, the second filter acts strange, the infowindow doesnot get displayed on the markers on second consecutive filter. Heres how i've filtered the markers: filterMarkers = function (category) { for (i = 0; i &lt; markers1.length; i++) { #markers1 is a list of markers marker = gmarkers1[i]; #gmarkers is an array of different markers infowindow_content = InfoWindow1[i]; // If is same category or category not picked if (marker.category == category || category.length === 0) { marker.setVisible(true); } // Categories don't match else { marker.setVisible(false); infowindow_content.close(); } } } I am also able to get the infowindow contents in the console. If this snippets of code is not enough i am glad to upload the entire code of mine. Thanks in advance for any help. UPDATE: Rest of my code: var gmarkers1 = []; var markers1 = []; var InfoWindow1 = []; // Our markers markers1 = [ {% for d in data %} [ '{{d.current_address_gr}}', {{ d.current_address_lat }}, {{ d.current_address_lng }},"{% profile_name_tag d.profile.id "False" "False" %}", '{{ d.current_department.name }}', '{{d.employee_level.name}}' ], {% endfor %} ]; /** * Function to init map */ function initialize() { var center = new google.maps.LatLng(27.7033, 85.3224); var mapOptions = { zoom: 12, center: center, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('googleMap'), mapOptions); for (i = 0; i &lt; markers1.length; i++) { addMarker(markers1[i]); } // autocomplete the place input field var input = /** @type {HTMLInputElement} */( document.getElementById('place-input')); var types = document.getElementById('type-selector'); map.controls[google.maps.ControlPosition.TOP_LEFT].push(in…
has title: Filtering markers doesnot show infowindow in second filter
accepted answer: http://stackoverflow.com/a/28655760
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/28655760
type: Question
tagged with: google-maps

http://stackoverflow.com/a/28638912
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28633104
answers question: http://stackoverflow.com/q/28633104
has body: eval seems to achieve this rather elegantly. function caller(func) { function printMessage(message) { console.log(message); } eval('(' + func.toString() + ')();'); } function callee() { printMessage('hello world'); } caller(callee);

http://stackoverflow.com/comment/56989766
type: QuestionComment
comment on: http://stackoverflow.com/q/28630108
has text: Related: https://docs.google.com/presentation/d/1r7QXGYOLCh4fcUq0jDdDwKJWNqWK1o4xMtYpKZCJYjM
score: 0
type: Comment

http://stackoverflow.com/q/28664363
has comment: http://stackoverflow.com/comment/46686049
score: 2
tagged with: performance
has body: I have an appliction, we generate swing objects(jtables, jbuttons,jlabels,jtextfields.etc) from pure java models in an erp like application. the models are generated dynamically depending on business rules and user iteractions on the fly. Now he have to port it to a web-based application, where we have to generate dynamically generated html pages from java servlets, which will be run on ipads and tablets on browsers (google chrome, ipad safari). we have a servlet which generates the html objects (tables, buttons etc) as counterpart of jtable, jbutton respectively. As i said before, the rendered pages have to be dynamic, and users can change the objects on the fly, they can also change the font, color, size and position of the objects depending on the business rules. As a result i can not use static .css files. The servlet gets the request, creates the html objects containing html, js and the objects are send to the client browser using json with ajax responses. We have already a working infrastructure, but the problem is, we have network problems on users because they do not always use line based or wireless connection, they use cellular gprs and the network performance is a big issue. Especially, the table objects, (our normalisation of database tables is not well organised) may contain up tp 30-40 columns. I am using paginators for the tables, so at one screen i limit the visible row number by 20, but we see 20*40 cells at one time. And the business rules demand, that each cell may have different colors, (for example we have all cells in the fifth column have background blue, but the cell on the second row has the color green for example) and another example, all cells are disabled, but only one cell can be becomed editable depending on the user action on the fly. A example of current table is as following: <td id="mytable1_0_0"... I generate this content as a json and send to client browser, it handles the response by the following notation: response={ {"mytable1…
linked to: http://stackoverflow.com/q/20676831
type: Question
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/15768047
tagged with: jquery
linked to: http://stackoverflow.com/q/8749236
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
answer count: 0
has title: jquery dynamic generation of tables, performance issues, string compression
upvote count: 2
type: UnansweredQuestion
tagged with: compression

http://stackoverflow.com/q/28690021
tagged with: google-analytics-api
has title: seperate google analytics for mobile and desktop
has comment: http://stackoverflow.com/comment/45676818
answer count: 0
type: Question
tagged with: google-analytics
has comment: http://stackoverflow.com/comment/45682867
score: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45712361
has comment: http://stackoverflow.com/comment/45712273
has comment: http://stackoverflow.com/comment/45674848
type: UnansweredQuestion
has body: I want to have 2 separate google analytic accounts for a website one for mobile and one for desktop. I have separate code for both but the URL is same. I would like to know if i can create 2 google analytic account from same URL. If google allows that, then I can paste js code for 2 accounts in separate codes.

http://stackoverflow.com/a/28654653
downvote count: 0
has body: Pass functions to setTimeout(), not strings: setTimeout(function() { document.getElementById('err_box').innerHTML = selected_troops.length+" Men"; }, 1000); Your code wasn't working because you didn't account for the fact that the string constants would need to be "double quoted" in order to work. That's really not the right way to do it anyway, however; it's much easier to avoid having to put JavaScript code into JavaScript strings.
answers question: http://stackoverflow.com/q/28654641
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/28614341
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45532726
tagged with: prototype
score: 0
tagged with: function
answer count: 1
has comment: http://stackoverflow.com/comment/45531950
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45532052
has comment: http://stackoverflow.com/comment/45531942
has body: I'm trying to make a complementary library to jQuery but not jQuery plugin, nor jQuery extension: First Function: function w(id) { return $(id); } It works as jQuery plugin: $.prototype.test = function(){ console.log("testing"); } w("div").test(); // test What I want is this, as a prototype function of w(), but doesn't works: w.prototype.test = function(){ console.log("testing"); } w("div").test(); // test Thanks, ......................................... It works with: w.prototype = jQuery.prototype; Thanks SLaks! But when it does, doesn't works with: w.prototype = { test: function(){ console.log("testing"); }} ....................... Now it's works; function w(id) { return $(id); } w.prototype = jQuery.prototype; w.prototype.extend({ test:function(){ console.log("testing"); } }); Thanks for help!!!
has title: Jquery prototype conflict with new function
has comment: http://stackoverflow.com/comment/51570917
has comment: http://stackoverflow.com/comment/45533288
has answer: http://stackoverflow.com/a/28614393
accepted answer: http://stackoverflow.com/a/28614393

http://stackoverflow.com/a/28621083
type: Answer
score: 1
upvote count: 1
has body: I am suggesting you to create new route to handle the forgot password request because you will not have "var password = req.body.password;" in case of forgot password so better to create new route for it:- router.post('/forgot', function(req, res) { var email = req.body.email; //calls a login.js function and passes it the params login.login(email, password, req, res); }); We use next() in the case of Middleware in node.
answers question: http://stackoverflow.com/q/28620984
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28620984

infinite-scroll
tag name: infinite-scroll
type: Tag
tags question: http://stackoverflow.com/q/28682685

http://stackoverflow.com/q/28644795
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45587842
type: Question
tagged with: responsive-design
tagged with: javascript
has body: Hi I am trying to get my website to be responsive. I have two different divs one on the left and one on the right on my website like so... http://jsfiddle.net/1fupx7aa/2/ HTML &lt;div class="menu"&gt;&lt;/div&gt; &lt;div class="view"&gt;&lt;/div&gt; CSS .menu { width:100px; height:100px; float: left; background-color: red; } .view { width: 200px; height:300px; background-color: yellow; float:left; } On the website, when I click on the red div, content appears on the yellow div. I am now trying to make my website responsive, so what I would like to do is on a smaller screen, the yellow div I set to display:none; and the red div width:100% like so... http://jsfiddle.net/3jmbxumb/ HTML &lt;div class="menu"&gt;&lt;/div&gt; &lt;div class="view"&gt;&lt;/div&gt; CSS @media (max-width: 600px) { .menu { width:100%; } .view { display: none; } } Now what I need to do is, when I click on the red div, I would like the content in the yellow div to appear where I would create a back button that would lead back to the red div. Is this possible? I have been looking at the bootstrap carousel option, but I don't think this works for my website. What would I call this and is this possible? Might there be a way where if I click on the red div on a mobile device the red div becomes hidden and only the yellow div appears?
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28644882
has comment: http://stackoverflow.com/comment/45587703
has title: Click one div and goes to another on responsive website
possible better answer: http://stackoverflow.com/a/28644859
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28644859
has answer: http://stackoverflow.com/a/28644963
accepted answer: http://stackoverflow.com/a/28644963

http://stackoverflow.com/comment/45532137
has text: @cesarpachon URl provided, and no it has content as I can see the html for the input items created within the fieldset, just no labels created.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28614331

http://stackoverflow.com/q/28633104
type: Question
has title: JavaScript accessing variables declared in calling function
score: 0
has answer: http://stackoverflow.com/a/28633429
has answer: http://stackoverflow.com/a/28633228
has answer: http://stackoverflow.com/a/28638912
tagged with: javascript
favorite count: 0
tagged with: scope
has answer: http://stackoverflow.com/a/28634150
possible better answer: http://stackoverflow.com/a/28633228
answer count: 4
has comment: http://stackoverflow.com/comment/45566168
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45566344
accepted answer: http://stackoverflow.com/a/28638912
upvote count: 1
has body: It's hard to explain my question, so I'm posting some code. function caller(func) { function printMessage(message) { console.log(message); } func(); } function callee() { printMessage('hello world'); } caller(callee); I want to access printMessage from callee, but as it currently stands, this throws a ReferenceError. I'd like to avoid declaring printMessage globally, if possible.
downvote count: 1

http://stackoverflow.com/q/28747005
has comment: http://stackoverflow.com/comment/45776930
score: 1
favorite count: 0
linked to: http://stackoverflow.com/q/14028959
type: Question
duplicate of: http://stackoverflow.com/q/14028959
has comment: http://stackoverflow.com/comment/45776283
has body: I'm new to develope in javascript, I'm sure this is a banal question and probably it has a very simple answer but I'm stuck and it seems I can't figure it out in any way. Can anyone give me an explaination on this? here's my code: function getURLParameter(name) { return decodeURIComponent((new RegExp('[?|&amp;]' + name + '=' + '([^&amp;;]+?)(&amp;|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null } myvar = getURLParameter('searchbox'); document.getElementById('field').value = myvar; I keep on receiving a "Uncaught TypeError: Cannot set property 'value' of null" in the last line at document.getElementById('field').value = myvar; Why? where I'm getting wrong?
has comment: http://stackoverflow.com/comment/45777053
has comment: http://stackoverflow.com/comment/45776511
upvote count: 1
has title: Why I get " Uncaught TypeError: Cannot set property 'value' of null"?
has comment: http://stackoverflow.com/comment/45776315
answer count: 0
downvote count: 0
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/comment/45556393
type: QuestionComment
has text: I'm checking if i understood you. So if I put 10 listener on 10 different elements is less a perf problem than put one listener on 10 elements with the same class?
comment on: http://stackoverflow.com/q/28627606
type: Comment
score: 0

http://stackoverflow.com/q/28740265
has comment: http://stackoverflow.com/comment/45764074
has answer: http://stackoverflow.com/a/28740564
has body: The following script is playing a soundfile when i click on a img (onclick). How do i pause it by clicking on the same img? I´ve tried audio.pause(), but it won´t work. function play(){ var audio = document.getElementById("myaudio"); audio.style.display="block"; audio.play(); } &lt;a href="#" onclick="play()"&gt;&lt;img src="Bilder/play2.png"&gt;&lt;/a&gt;
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45764196
has comment: http://stackoverflow.com/comment/45764248
has title: Play and Pause with onclick on the same Img
tagged with: audio
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45764253
has comment: http://stackoverflow.com/comment/45764423
tagged with: onclick
score: 0
type: Question
accepted answer: http://stackoverflow.com/a/28740564
has answer: http://stackoverflow.com/a/28744740
tagged with: javascript
has comment: http://stackoverflow.com/comment/45797929
answer count: 2
possible better answer: http://stackoverflow.com/a/28744740

http://stackoverflow.com/a/28639549
answers question: http://stackoverflow.com/q/28639314
type: Answer
has body: See the comments in the code for explanations: var rock = 0 var paper = 1 var scissors = 2 var computerMove = rock; var playerMove = paper; //declare variable outside the function if you want to be able to access it from outside of the function (look into variable scope) var winner; function getWinner(playerMove,computerMove) { if (computerMove == playerMove){ // set a value in case of draw winner = "draw" } else if ((playerMove - computerMove + 3) % 3 == 1){ // don't redeclare the variable! winner = "player" } else { winner = "computer" } return winner; } //call the function so it actually executes getWinner(playerMove,computerMove); //this should print out your answer now console.log(winner);
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28639314
score: 0

http://stackoverflow.com/a/28622298
has comment: http://stackoverflow.com/comment/45546630
type: Answer
score: 3
has body: Use var yr = DateTest.getFullYear();
upvote count: 3
has comment: http://stackoverflow.com/comment/45546629
has comment: http://stackoverflow.com/comment/45546750
accepted answer of: http://stackoverflow.com/q/28622265
has comment: http://stackoverflow.com/comment/45546561
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28622265

http://stackoverflow.com/a/28827926
type: Answer
score: 2
has body: I'm the developer of the visjs network view. This is not possible yet within the public API. We are working on a version 4.0 that will allow you to easily inject your own code inside the renderloop. If you need it sooner (we expect 4.0 around April) please post an issue on our GitHub page and I can help you insert this into the source yourself. We would like to keep all our questions on GitHub so it is easier for people to find answers. Edit: additionally you could of course just change the color and or use the focus functionality to focus on the node. But that was not your question. A workaround could be to overlay a div on top op the node, where the doc could have a gif with the animation and a click handler. You can get the position of said node using the vis API.
upvote count: 2
has comment: http://stackoverflow.com/comment/45958466
has comment: http://stackoverflow.com/comment/48309216
has comment: http://stackoverflow.com/comment/73196463
answers question: http://stackoverflow.com/q/28655385
downvote count: 0
has comment: http://stackoverflow.com/comment/73244001
has comment: http://stackoverflow.com/comment/73144454

http://stackoverflow.com/a/36900087
answers question: http://stackoverflow.com/q/28689023
score: 0
type: Answer
has body: The problem was with the naming of the fields. You capitalized 'Name' in the sorters, but the actual field is 'name'. fields: [ {name:'name'}, {name:'summaryId'}, {name: 'id'}, {name:'email'}, {name:'phone'}, ], When I changed it to 'name', it sorted with that and any other sorters supplied. sorters: [{ property: 'name', direction: 'ASC' },{ property:'email', direction: 'DESC' }],

http://stackoverflow.com/q/28748568
favorite count: 0
has answer: http://stackoverflow.com/a/28748981
accepted answer: http://stackoverflow.com/a/28748981
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45779305
has comment: http://stackoverflow.com/comment/45779471
tagged with: css
has title: jquery toggle not clickable
downvote count: 4
has comment: http://stackoverflow.com/comment/45779363
type: AnsweredQuestion
upvote count: 0
score: -4
has comment: http://stackoverflow.com/comment/45779529
type: Question
has comment: http://stackoverflow.com/comment/45779631
has comment: http://stackoverflow.com/comment/45779584
has comment: http://stackoverflow.com/comment/45779267
tagged with: javascript
has body: I have implimented a Jquery hide/show toggle that is supposed to effect the menu and submenu. The code works, but for some reason it is not successful within the context of my broader site code. I cannot seem to figure out what the problem is. Any suggestions? http://studiopowell.net/TEST_gradient.html JQuery: $('.menu').click(function(e){ $(this).find('.submenu').fadeToggle(); }); $('.submenu').click(function(e){ e.stopPropagation(); }); html: W o r k I m a g e I n f o css: #contain{ padding-top: -10px; display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; -webkit-box-direction: normal; -moz-box-direction: normal; -webkit-box-orient: vertical; -moz-box-orient: vertical; -webkit-align-content: center; -ms-flex-line-pack: center; align-content: center; -webkit-box-align: center; -moz-box-align: center; -webkit-align-items: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -moz-box-pack: center; -webkit-justify-content: center; -ms-flex-pack: center; justify-content: center; position: relative; -webkit-flex-direction: column; -ms-flex-direction: column; flex-direction: column; } .titles { font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 14px; color:#33; text-align:left; padding-left: 0px; padding-top: 25px; padding-bottom: 20px; margin-top: 50px; display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; -webkit-box-direction: normal; -moz-box-direction: normal; -webkit-box-orient: vertical; -moz-box-orient: vertical; -webkit-flex-direction: column; -ms-flex-direction: column; flex-direction: column; -webkit-flex-wrap: nowrap; -ms-flex-wrap: nowrap; flex-wrap: nowrap; -webkit-box-pack: start; -moz-box-pack: start; -webkit-justify-content: flex-start; -ms-flex-pack: start; justify-content: flex-start; -webkit-align-content: center; -ms-flex-line-pack: center; align-content: center; -webkit-box-align: center; -moz-box-align: …
answer count: 1
tagged with: jquery

http://stackoverflow.com/comment/45716281
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28714010
has text: add timestamp in import statement so that request will be unique everytime and browser will not cache
score: 0

http://stackoverflow.com/comment/45766248
comment on: http://stackoverflow.com/a/28741491
type: AnswerComment
score: 0
type: Comment
has text: no, I need to catch it from iFrame... not outside of it.

http://stackoverflow.com/q/28727278
downvote count: 0
answer count: 1
score: 1
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/28774801
tagged with: react-router
type: Question
tagged with: reactjs
tagged with: javascript
has body: I'm playing with my web app and react-router package and I would like to do some nested routes. Here is what I've done This example doesn't work because of DefaultRoute. When I changed it to normal Route component everything is ok. I cant find example where DefaultRoute has some childrens. Does DefaultRoute can have nested Routes? If yes then what I'm doing wrong?
has title: Nested Routes in DefaultRouter component

http://stackoverflow.com/q/28730245
has answer: http://stackoverflow.com/a/28730405
type: Question
has comment: http://stackoverflow.com/comment/45746832
tagged with: javascript
has body: Right, basically I have a countdown timer that doesn't do exactly what it says on the tin. The PHP outputs correctly, but once it's echo'd within the Javascript, the date constantly changes. I will load the page, and it will show one ETA, and I'll refresh and it could jump forward an hour or jump back several hours? I just need the timer to countdown to the 20th March 2015. The PHP Code &lt;?php $futureDate = '2015-03-20'; $d = new DateTime($futureDate); ?&gt; The Javascript $('#counter').countdown({ timestamp : (new Date()).getTime() + &lt;?php echo $d-&gt;diff(new DateTime())-&gt;format('%a*%h*%i*%s*1000'); ?&gt; }); Here's a Live Preview Preview Please, somebody help lol
answer count: 2
has title: Countdown keeps changing
downvote count: 0
has answer: http://stackoverflow.com/a/28730410
tagged with: jquery
tagged with: countdown
favorite count: 0
has comment: http://stackoverflow.com/comment/45746829
type: UnansweredQuestion
tagged with: countdowntimer
tagged with: php
has comment: http://stackoverflow.com/comment/45746957
linked to: http://stackoverflow.com/q/9335140
score: 1
upvote count: 1

http://stackoverflow.com/q/28691766
answer count: 2
score: -2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28693007
favorite count: 0
has body: I have a slider with 4 images, and I want to use the slider markup, to generate thumbnails on another part of my document. For this case I used data attributes with the needed information for the thumbnails. Here is the Code from the Slider Part: This Markup should be used, to generate the following: The question is, how I could "copy" and "modify" the markup. My first try was to get the children of the slider div using jquery: var images = $('#slider').children('div').map(function(){ console.log($(this).attr('src')); }).get(); But this isn't working so good. I hope someone can help me to achieve this. How can I get all four divs and use the data attributes to generate the needed markup? Thanks!
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28693007
tagged with: css
upvote count: 2
has title: copy and modify elements to use them on another part of an html document
has answer: http://stackoverflow.com/a/28692065
accepted answer: http://stackoverflow.com/a/28692065
type: AnsweredQuestion
type: Question
downvote count: 4

http://stackoverflow.com/a/28692630
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45677376
has body: you have to use ajax script to achieve this process. on button click ajax script is executed and the result is fetched in ajax response then you have to append the results to other form fields.
upvote count: 2
score: 2
answers question: http://stackoverflow.com/q/28692490

http://stackoverflow.com/comment/45515712
has text: Unless this is for an assignment, please don't do it. Unexpected sounds in webpages are just about the most annoying thing in the world.
score: 1
comment on: http://stackoverflow.com/q/28605659
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45756356
comment on: http://stackoverflow.com/a/28734620
type: AnswerComment
has text: @JamesLemon prop is the right choice https://forum.jquery.com/topic/please-explain-attr-vs-prop-change-in-1-6
type: Comment
score: 1

http://stackoverflow.com/a/28673692
type: AcceptedAnswer
has body: I think there is no need for a promise in your particular case, and I would design it in another way : I would store an "authenticatedUser" inside the $rootScope, with some parameters that I might find usefull (user culture, roles, ...(or just a boolean if there is no other requirement)). In a kind of "applicationController", I would have a $watch* looking for its value : $rootScope.$watch('authenticatedUser', function(newVal, oldVal){ if (newVal == oldVal) return; if (newVal == null){ //User has been disconnected //Remove everything from screen //Display login form } }); So, inside your controller, I would just have : function logout() { AuthService.logout(); } That way, if ever one day you decide to be able to logout from another controller (we never know what can happen ;-) ), you will just have to call your service, and everything will be done. There will be no need to duplicate code. Also, there is something I don't understand in your code : // inherit var service = Object.create(ApiService); In angular, every service is a singleton instanciated during angular bootstrap. Are you sure you want to override this default behaviour? : pay attention to $watches, they cost lots of processing time during angular digest.
has comment: http://stackoverflow.com/comment/45641747
type: Answer
accepted answer of: http://stackoverflow.com/q/28673312
answers question: http://stackoverflow.com/q/28673312
has comment: http://stackoverflow.com/comment/45641015
score: 0

http://stackoverflow.com/comment/45614143
has text: @Arkantos Control doesn't reach there. It doesn't enter the if or else block.(Using chrome)
comment on: http://stackoverflow.com/q/28659258
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45787331
type: Comment
comment on: http://stackoverflow.com/a/28726881
score: 1
type: AnswerComment
has text: I think hankduan described the problem perfectly, check it out. Thanks again for your help!

http://stackoverflow.com/comment/47429948
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28647253
has text: As per the documentation on pdfmake (https://github.com/bpampuch/pdfmake#images) it's recommended to use dataURI images. Did you already try that ?

http://stackoverflow.com/a/28612850
downvote count: 0
answers question: http://stackoverflow.com/q/28612737
has body: ((foo &amp;&amp; foo.bar !== baz) || !foo) ? funtion1() : function2());
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/45640369
has text: Ok I have tried to minimize the object code down to the part that causes the problem to the best of my ability (it's a complex structure).
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28672505

http://stackoverflow.com/a/28605081
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28604988
has body: You need a local copy of jQuery or a link to a cdn version of it. The current link you're including is to a relative path within your project so it's looking for a copy of jQuery within your js folder. You can download jQuery here and place it in that folder, but it might be easier just while you're getting used to it to use a cdn, this means you use a copy of jQuery hosted by someone like Google. It's not always the fastest or most stable method but it's definitely the easiest. Replace With

http://stackoverflow.com/comment/45649789
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28677335
type: QuestionComment
has text: @blex - horrible code. I fixed it - http://jsfiddle.net/ywy9ndao/1/

http://stackoverflow.com/a/28743158
has comment: http://stackoverflow.com/comment/45841826
has comment: http://stackoverflow.com/comment/45844924
type: AcceptedAnswer
downvote count: 0
has body: The main problem is that you need to initialize your Selector from the webdriver's page_source and not the response passed into the callback: from scrapy.contrib.spiders import CrawlSpider from scrapy.http import Request from scrapy import Selector from selenium import webdriver class MachineSpider(CrawlSpider): name = 'nc-spider' allowed_domains = ['ncservice.com'] def start_requests(self): yield Request('http://www.ncservice.com/en/second-hand-milling-machines', callback=self.parsencmilllist) def parsencmilllist(self, response): driver = webdriver.Firefox() driver.get(response.url) driver.find_element_by_id("mas-resultados-fresadoras").click() sel = Selector(text=driver.page_source) driver.quit() links = sel.xpath('//div[@id="resultados"]//a/@href').extract() for link in links: yield Request(link, meta={'type': 'Milling'}, callback=self.parsencmachine) def parsencmachine(self, response): print response.url
has comment: http://stackoverflow.com/comment/45787819
has comment: http://stackoverflow.com/comment/45787858
type: Answer
has comment: http://stackoverflow.com/comment/45840348
answers question: http://stackoverflow.com/q/28742906
score: 1
accepted answer of: http://stackoverflow.com/q/28742906
upvote count: 1

loops
tags question: http://stackoverflow.com/q/28698507
tags question: http://stackoverflow.com/q/28697674
tags question: http://stackoverflow.com/q/28729147
tags question: http://stackoverflow.com/q/28610062
tags question: http://stackoverflow.com/q/28640729
tags question: http://stackoverflow.com/q/28674943
type: Tag
tags question: http://stackoverflow.com/q/28686029
tags question: http://stackoverflow.com/q/28652567
tags question: http://stackoverflow.com/q/28736704
tags question: http://stackoverflow.com/q/28614011
tags question: http://stackoverflow.com/q/28642542
tags question: http://stackoverflow.com/q/28721703
tags question: http://stackoverflow.com/q/28662116
tag name: loops
tags question: http://stackoverflow.com/q/28604132
tags question: http://stackoverflow.com/q/28650208
tags question: http://stackoverflow.com/q/28748910
tags question: http://stackoverflow.com/q/28697839
tags question: http://stackoverflow.com/q/28725554
tags question: http://stackoverflow.com/q/28672642

http://stackoverflow.com/a/28700300
score: 2
has comment: http://stackoverflow.com/comment/45690774
has body: next will only look at the immediate next element. You need to use nextAll to test all the following siblings. Using this instead of a selector will make sure that you are dealing with the div that was actually clicked rather than another one with the same class name. $(this).parent().nextAll(".col-1-2").removeClass("col-1-2").addClass("col-1-3"); You may also wish to filter the results to apply the change to only the first match.
downvote count: 0
answers question: http://stackoverflow.com/q/28700115
accepted answer of: http://stackoverflow.com/q/28700115
has comment: http://stackoverflow.com/comment/45690720
has comment: http://stackoverflow.com/comment/45693198
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45693226
type: Answer

http://stackoverflow.com/comment/45544536
comment on: http://stackoverflow.com/q/28620900
type: Comment
type: QuestionComment
has text: did you use it correctly?
score: 0

http://stackoverflow.com/a/28721649
type: Answer
answers question: http://stackoverflow.com/q/28719691
score: 0
accepted answer of: http://stackoverflow.com/q/28719691
type: AcceptedAnswer
has body: Here is the code snippet from firefox.js that is responsible for listening to the URL protocols: var workers = [], content_script_arr = []; pageMod.PageMod({ /* page */ include: ["*"], contentScriptFile: [data.url("content_script/inject.js")], contentScriptWhen: "start", contentStyleFile : data.url("content_script/inject.css"), onAttach: function(worker) { array.add(workers, worker); worker.on('pageshow', function() { array.add(workers, this); }); worker.on('pagehide', function() { array.remove(workers, this); }); worker.on('detach', function() { array.remove(workers, this); }); content_script_arr.forEach(function (arr) { worker.port.on(arr[0], arr[1]); }); } }); Changing the include: line to include: ["*","file://*"], will do the trick for local files.

http://stackoverflow.com/comment/45699267
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28704663
has text: @Drifter yes and you can also make your server tell the browser to cache certain image types using Expires Headers, would make it faster next time user lands on the page.
score: 0

http://stackoverflow.com/q/28743617
has comment: http://stackoverflow.com/comment/45770168
has comment: http://stackoverflow.com/comment/45769894
has comment: http://stackoverflow.com/comment/45770172
type: Question
possible better answer: http://stackoverflow.com/a/28743785
has answer: http://stackoverflow.com/a/28743785
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28743797
answer count: 3
has title: Multiple hidden menus that open and close using jQuery?
tagged with: jquery
has answer: http://stackoverflow.com/a/28743798
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: please see this fiddle http://jsfiddle.net/rabelais/tw6sdod9/ $(document).ready(function() { $('li ul').slideUp(0); $('.no-js li a').on("click", function() { $('ul#inner-li ul').slideUp(400); if ($(this).siblings('ul').is(":visible")) $(this).siblings('ul').slideUp(400); else $(this).siblings('ul').slideDown(400); }); }); $('#nav li a').on('click', function() { $('li a.current').removeClass('current'); $(this).addClass('current'); }); $(document).ready(function() { $('li ul#inner-li-texts').slideDown(0); $('.no-js li a#texts').on("click", function() { $('ul ul').slideUp(400); if ($(this).siblings('ul').is(":visible")) $(this).siblings('ul').slideUp(400); else $(this).siblings('ul').slideDown(400); }); }); Works blog Portraits Paintings Drawings Photography Texts Essay one Essay two Essay three News Biography On this fiddle there is a menu with two sub-menus hidden under the 'Works' and 'Text' links. What I am trying to achieve is this: On load I want the text sub menu open and the works menu closed. When the users clicks on either link the sub menu to that link opens or closes. $(document).ready(function () { $('li ul').slideUp(0); $('.no-js li a').on("click", function () { $('ul#inner-li ul').slideUp(400); if($(this).siblings('ul').is(":visible")) $(this).siblings('ul').slideUp(400); else $(this).siblings('ul').slideDown(400); }); });
accepted answer: http://stackoverflow.com/a/28743797
type: AnsweredQuestion

http://stackoverflow.com/comment/45719327
type: AnswerComment
has text: are you using `canvas` or just `img` ?
type: Comment
comment on: http://stackoverflow.com/a/28715233
score: 0

http://stackoverflow.com/a/28643784
has body: $(this) is the jQuery object referring to the matching element in each iteration of the "each" loop. Therefore, it doesn't have an 'id' property per-se. It is a jQuery object. Try this to access the id attribute of the element instead: $(this).attr("id");
answers question: http://stackoverflow.com/q/28643703
type: Answer
score: 0

http://stackoverflow.com/comment/45691230
has text: Because 64 is smaller than 256.
score: 1
type: Comment
comment on: http://stackoverflow.com/q/28700575
type: QuestionComment

http://stackoverflow.com/a/28671778
has body: The code for select and ngOptions is correct. However I assume that you want $scope.Search function to be called on every option change. In this case you need to set up ngChange handler:
has comment: http://stackoverflow.com/comment/45638335
has comment: http://stackoverflow.com/comment/45641562
has comment: http://stackoverflow.com/comment/45638020
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28671629

http://stackoverflow.com/comment/45599243
type: Comment
score: 0
has text: https://jsfiddle.net/armadadamra/om1zh5bL/
comment on: http://stackoverflow.com/q/28650208
type: QuestionComment

http://stackoverflow.com/comment/45527223
type: QuestionComment
comment on: http://stackoverflow.com/q/28611173
score: 0
has text: @ByteHamster The domain is not being used anymore, eventually it will never be used and removed.
type: Comment

http://stackoverflow.com/comment/45645306
type: Comment
comment on: http://stackoverflow.com/a/28675711
type: AnswerComment
score: 0
has text: i dont knw how you run `mongod` in it.Check http://stackoverflow.com/questions/8495293/whats-a-clean-way-to-stop-mongod-on-mac-os-x

http://stackoverflow.com/q/28689873
has body: I have a div with display:none as style attribute value. In css, a background image url is set for this div. I simply don't want the request for the image to be fired until the div is visible later through some JS code. In Firefox , the network tab shows that the request is not issued which is as expected. But in Chrome developer tools I found that the request for the image is actually fired after the DOMContentLoaded event. What could be the possible reason of different behaviors with hidden elements in these two different browsers ? Markup: Screenshots: Chrome: Firefox:
answer count: 3
has answer: http://stackoverflow.com/a/28690149
tagged with: firefox
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28690092
tagged with: http://stackoverflow.com/tag/html
has title: Different behavior with hidden html elements in different browsers
tagged with: css
score: 2
has comment: http://stackoverflow.com/comment/45671791
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28690121
tagged with: google-chrome
type: Question
linked to: http://stackoverflow.com/q/12158540

http://stackoverflow.com/comment/45695759
has text: @JusticeGödelConder: There's no reason to do that in the example you've quoted. Function declarations would be clearer and less of a maintenance hassle. There's an argument for doing that if setting up a lot of functions as properties of an object (http://jsfiddle.net/s0vva8dm/2/), but that's not the same thing. And you wouldn't have been putting function declarations in the middle of an object initializer anyway; they wouldn't be valid there.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28696895
score: 1

http://stackoverflow.com/a/28635565
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45574463
upvote count: 2
has body: That code only check the first value of the nested array. If it's fine to you, you have just to store the whole nested array, instead the first value. So: var result = array.reduce(function(max, arr) { return max[0] &gt;= arr[0] ? max : arr; }); Notice that I removed -Infinity, in that case the first iteration would start already with the first item of the array ([1, 5] in your case). So now you can access to 12 using result[0] and 4 using result[1].
accepted answer of: http://stackoverflow.com/q/28635477
has comment: http://stackoverflow.com/comment/45574164
has comment: http://stackoverflow.com/comment/45574538
answers question: http://stackoverflow.com/q/28635477
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45574376

http://stackoverflow.com/comment/45515292
type: Comment
comment on: http://stackoverflow.com/q/28605338
score: 0
has text: @DanielRoseman Yes. I am getting all the values using `request.GET.getlist('ids')` and my part of functionality is working fine for me. But showing the url in the above said format is needed for me. By using the and <submit> actions I will get by default formats of url passing the parameters. I need to override it
type: QuestionComment

http://stackoverflow.com/comment/45541771
score: 0
comment on: http://stackoverflow.com/q/28619433
type: Comment
type: QuestionComment
has text: Stop lecturing me. Every language has it's own syntax so yes it is javascript specific. Obviously I don't know javascript syntax in its most entry level form, which is why I'm asking. Please don't post on this topic anymore. I don't want your two cents.

http://stackoverflow.com/a/28667141
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28666946
has body: I don't know why but remove the quotes for document.body it working.. $(document.body).on('click','a[data-toggle="modal1"]', function(e) {};

http://stackoverflow.com/comment/45632838
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28669083
has text: Ok I've confirmed that two separate stylesheets does in fact do the ticket - updated my question with some code i pulled out of jss's source

http://stackoverflow.com/a/28744474
has comment: http://stackoverflow.com/comment/45771836
score: 1
has body: You can't pass in a function to a directive through an attribute, you can however pass it through an isolate scope. Pass a reference to the function you wish to call to the directive: sampleApp.directive('hello', function () { return { restrict: 'A', scope:{ onScrollEnd:'&amp;' }, link: function (scope, element, attrs) { var raw = element[0]; element.bind('scroll', function () { console.log(raw.scrollTop +'-------'+raw.offsetHeight+'----'+raw.scrollHeight); if (raw.scrollTop + raw.offsetHeight &gt;= raw.scrollHeight) { scope.onScrollEnd(); } }); } }; }); Now assuming you have the addMoreData() function defined on your controller, you can pass it to the directive this this: &lt;div hello on-scroll-end='addMoreData()'&gt;&lt;/div&gt; EDIT I think the problem is that the hello directive can't access functions on the parent controller since the modalDialog directive is using an isolated scope, therefore making everything o the parent controller invisible. Pass the function to through the isolate scope of the modalDialog Directive as well: scope: { show: '=', onScrollEnd:'&amp;' },
answers question: http://stackoverflow.com/q/28744334
downvote count: 0
has comment: http://stackoverflow.com/comment/45771980
type: Answer
upvote count: 1

http://stackoverflow.com/q/28744938
favorite count: 0
score: 0
has comment: http://stackoverflow.com/comment/45772842
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28745053
upvote count: 1
downvote count: 1
tagged with: alert
has comment: http://stackoverflow.com/comment/45772443
has title: jQuery alerts is not working on jquery 1.11.2 , "TypeError: n.browser is undefined"
has comment: http://stackoverflow.com/comment/45772707
type: Question
has comment: http://stackoverflow.com/comment/45773043
answer count: 1
has body: I use to work well with jQuery alerts inside jQuery 1.8.2 , from :- / jQuery Alert Dialogs Plugin // // Version 1.1 // // Cory S.N. LaViska // A Beautiful Site (http://abeautifulsite.net/) but now i have upgraded to jQuery 1.11.2 , and i start receiving this error when calling jAlert :- TypeError: n.browser is undefined ...er").addClass(n.alerts.dialogClass);var e=n.browser.msie&amp;&amp;parseInt(n.browser.ver... now i checked the related scripts and i found that it use $browser which is no more available inside jQuery 1.9 :- _show: function(title, msg, value, type, callback) { $.alerts._hide(); $.alerts._overlay('show'); $("BODY").append( '&lt;div id="popup_container"&gt;' + '&lt;h1 id="popup_title"&gt;&lt;/h1&gt;' + '&lt;div id="popup_content"&gt;' + '&lt;div id="popup_message"&gt;&lt;/div&gt;' + '&lt;/div&gt;' + '&lt;/div&gt;'); if( $.alerts.dialogClass ) $("#popup_container").addClass($.alerts.dialogClass); // IE6 Fix var pos = ($.browser.msie &amp;&amp; parseInt($.browser.version) &lt;= 6 ) ? 'absolute' : 'fixed'; $("#popup_container").css({ position: pos, zIndex: 99999, padding: 0, margin: 0 }); so can anyone adivce on this please? not sure if i can upgrade my jAlert to a newer version that works on jquery 1.9 + ?
tagged with: javascript
has comment: http://stackoverflow.com/comment/45772936
tagged with: jquery

http://stackoverflow.com/a/28648700
score: 1
has body: This is your server-side code, which will execute exactly once when the page is requested: $name = "Test"; $name = "Error"; After this code executes, $name will be "Error". Every time. This is your client-side code, which will execute exactly once when the page renders in the browser: var name = 'Test'; if(name === 'Test'){ } else { } After this code executes, name will be 'Test'. Every time. You're trying to mix server-side code and client-side code. They don't mix like that. They execute on two completely different platforms at two completely different times in two completely different contexts. Whatever you're trying to do (which we don't know), this isn't how you do it.
downvote count: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28648656

http://stackoverflow.com/comment/45719498
comment on: http://stackoverflow.com/q/28715871
type: Comment
score: 0
has text: The return value of an assignment (=) is always the assigned value. In your case the stripped if will look like `if ("white")`. In JS this will be handled as true.
type: QuestionComment

http://stackoverflow.com/comment/45707955
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28709460
has text: can u make a js fiddle?
type: Comment

http://stackoverflow.com/q/28650330
has body: The data looks like this: [ { "passports": [ { "identifier": "2238006043", "protocol": "oauth", "tokens": { "token": "2238006043-fACsU7gVtpZnkuerodfsfdsfsdfdffsfOck1R9Z", "tokenSecret": "BQN25aRkJcyES3yWFCa7sSpq212PKbB52Mplxpg58hICs" }, "provider": "twitter", "user": "54e8bca1513ab1841ab6da01", "createdAt": "2015-02-21T17:13:05.371Z", "updatedAt": "2015-02-21T17:13:05.371Z", "id": "54e8bca1513ab1841ab6da02" } ], "username": "myUsername", "createdAt": "2015-02-21T17:13:05.362Z", "updatedAt": "2015-02-21T17:13:05.362Z", "id": "54e8bca1513ab1841ab6da01" }, And I'm trying to output something from passports like this: console.log(util.inspect(res.passports[0].identifier, { showHidden: true, depth: null })); res is the JSON object containing the data show below.
has comment: http://stackoverflow.com/comment/45598094
score: 0
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28650401
has title: Trouble accessing JSON array
tagged with: sails.js
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28650363
type: Question
answer count: 2
tagged with: node.js

http://stackoverflow.com/comment/45567048
has text: RSVP is by no measure the fastest one. That benchmark is broken since it does not invoke the JIT. The JSPerf is indicative of nothing. Moreover - bluebird will be much much much faster than RSVP in this example since you are promisifying the function manually which allocates another closure. You're also ignoring errors but that's another story.
comment on: http://stackoverflow.com/a/28633352
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/comment/46787702
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29288389
type: AnswerComment
has text: `$scope.$watch('search', function(newVal, oldVal) { $scope.selectedAll = false; $scope.filter.FirstName = newVal; $scope.filter.Emails.main = newVal; $scope.filteredArray = $filter('filter')($scope.users, $scope.search, newVal); });` didn't work

http://stackoverflow.com/a/28712130
answers question: http://stackoverflow.com/q/28711627
type: AcceptedAnswer
score: 0
type: Answer
has body: Try the following in your success section: var root = $('.doclistdiv'); root.html(html); root.find('table').dataTable();
accepted answer of: http://stackoverflow.com/q/28711627

http://stackoverflow.com/a/28734737
upvote count: 12
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28734648
has body: Whenever you know you're not in a digest loop, it's always safe (and the best practice) to call $scope.$apply() or $scope.digest(). How do you know? Any async call that is not done through an Angular API. This is how angular handles these situations internally (look at the code for the ngEvent directives). Use $timeout only when you aren't sure whether the code you are running will be "inside" angular or not. This should be very, very rare. I've only needed this once and I'm still not very happy about it... var app = angular.module('MyApp',[]); var socket = io.connect('http://localhost:3000'); app.controller('MyAppController',['$scope',function($scope) { $scope.connections = 0; socket.on('connect',function(sock) { sock.on('event',function() { //wraps your code in a try catch that is handled by angular's error service. Calls $rootScope.$digest() $scope.$apply(function() { $scope.connections++; }); //OR - errors in your code will not be handled by angular //also calls $rootScope.$digest() $scope.connections++; $scope.$apply(); //OR - errors in your code will not be handled by angular //Only processes watchers for $scope and it's children //Fastest, but may have unintended consequences. $scope.connections++; $scope.$digest(); }; }; }]); I prefer the first option, because it gets your code "inside angular". However, all three will work.
score: 12

http://stackoverflow.com/comment/45625985
has text: That's a proposal for a feature set, not documentation of actual features.
comment on: http://stackoverflow.com/q/28651870
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45640373
has text: Perfect, now it does work as expected, thanks. However, there is still one point. I have multiple comboboxes in my page. If I open one of them, I don't select any item, and I click on another combobox (either the input field or the arrow), the firstly opened list doesn't disappear.
type: Comment
comment on: http://stackoverflow.com/a/28655141
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45659304
score: 0
has text: https://github.com/sindresorhus/gulp-ruby-sass/issues/196
comment on: http://stackoverflow.com/q/28683069
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28663694
type: Answer
has comment: http://stackoverflow.com/comment/45622507
upvote count: 1
has body: I believe you can solve your problem by locating the gradient div above the rest of the document, and using position:absolute as @blex mentioned in his comment: http://jsfiddle.net/qj1nz13p/ HTML &lt;div id="gradient"&gt; &lt;/div&gt; &lt;div class="titles"&gt; &lt;img src="archive-icon.png" width="185" height="185" alt="studio powell michael powell studiopowell art artist books installation video" /&gt;&lt;br/&gt;&lt;br/&gt; M I C H A E L &amp;nbsp; P O W E L L&lt;br/&gt;&lt;br/&gt; &lt;/div&gt; &lt;a class="fancybox" rel="group" href="archive-icon.png"&gt;&lt;img src="ruby ball.jpg" alt="" width="200" /&gt;&lt;/a&gt; CSS body { padding:0; margin:0; } #gradient { width: 100%; height: 100%; padding: 0px; margin: 0px; opacity: 0.1; position:absolute; z-index: -99999; } JavaScript var colors = new Array( [62,35,255], [60,255,60], [255,35,98], [45,175,230], [255,0,255], [255,128,0]); var step = 0; //color table indices for: // current color left // next color left // current color right // next color right var colorIndices = [0,1,2,3]; //transition speed var gradientSpeed = 0.0004; function updateGradient() { if ( $===undefined ) return; var c0_0 = colors[colorIndices[0]]; var c0_1 = colors[colorIndices[1]]; var c1_0 = colors[colorIndices[2]]; var c1_1 = colors[colorIndices[3]]; var istep = 1 - step; var r1 = Math.round(istep * c0_0[0] + step * c0_1[0]); var g1 = Math.round(istep * c0_0[1] + step * c0_1[1]); var b1 = Math.round(istep * c0_0[2] + step * c0_1[2]); var color1 = "rgb("+r1+","+g1+","+b1+")"; var r2 = Math.round(istep * c1_0[0] + step * c1_1[0]); var g2 = Math.round(istep * c1_0[1] + step * c1_1[1]); var b2 = Math.round(istep * c1_0[2] + step * c1_1[2]); var color2 = "rgb("+r2+","+g2+","+b2+")"; $('#gradient').css({ background: "-webkit-gradient(linear, left top, right top, from("+color1+"), to("+color2+"))"}).css({ background: "-moz-linear-gradient(left, "+color1+" 0%, "+color2+" 100%)"}); step += gradientSpeed; if ( step &gt;= 1 ) { step %= 1; colorIndices…
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28663485
answers question: http://stackoverflow.com/q/28663485

http://stackoverflow.com/comment/45542465
score: 0
comment on: http://stackoverflow.com/a/28619585
type: Comment
has text: That means 5 milliseconds.. see my update. 5 seconds would be 5000
type: AnswerComment

http://stackoverflow.com/comment/45541550
score: 0
type: Comment
has text: I've posted basic angular example. It's mostly used to execute / insert a bit more of a code - the directives. For such small elements it's still maybe worth having plain js parser, if you can't live with directive markup
type: AnswerComment
comment on: http://stackoverflow.com/a/28615152

http://stackoverflow.com/comment/45822864
comment on: http://stackoverflow.com/q/28731733
score: 0
type: Comment
type: QuestionComment
has text: When you say 'if one row fails' what are you referring to? Is this an expected scenario? It seems this is an XY problem?

http://stackoverflow.com/q/28634513
has answer: http://stackoverflow.com/a/28634828
has answer: http://stackoverflow.com/a/28634813
downvote count: 0
has title: AJAX request json fail
tagged with: jquery
has comment: http://stackoverflow.com/comment/45569727
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/45569303
has comment: http://stackoverflow.com/comment/45569930
has comment: http://stackoverflow.com/comment/45569000
score: 1
upvote count: 1
type: Question
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has body: I have a problem with an ajax request, when I do the request with the property dataType: 'json', my response come with an error, parsererror, my function in PHP returns the data like json_encode(), pls, can you help me? when I do the request without property dataType: 'json' my data is ALL THE DOCUMENT HTML. My request: var dataAr = {Latitude: Latitude, Longitude: Longitude};/ console.log(dataAr); $.ajax({ data: dataAr, dataType: 'json', type: 'POST', url: 'http://localhost/GPS/Server.php/GPS/Coords', success: function (data, response) { console.log('Data: '+data); console.log('Response: '+response); }, error: function (textStatus, errorThrown) { console.log('Status: '+textStatus); console.log('Error: '+errorThrown); } }); My function in PHP: class GPS { function Coords() { $Res=$_POST['data']; $Latitude=$_POST['Latitude']; $Longitude=$_POST['Longitude']; return json_encode($Res); } }
answer count: 2

http://stackoverflow.com/a/28653808
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28653528
has body: Here's a simple example of doing this relying more on CSS. $(function() { $('a').click(function() { $('div').removeClass('ellipsis'); }); }); div { border: solid 1px orange; width: 200px; overflow: hidden; } .ellipsis { white-space: nowrap; text-overflow: ellipsis; } Some really really long text that just is way too long so we must use ellipses to shorten it until the user wants to see it all. Show All
upvote count: 1
has comment: http://stackoverflow.com/comment/45604673
score: 1

http://stackoverflow.com/comment/45799708
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28717442
has text: Did search quite a bite around. But I am not sure if the commands are really logical, which makes it difficult to find the right ones: A tickInterval is in my opinion only the interval for the ticks. In my case, I don't display any ticks. So, my logic would be: I don't need tickInterval, when tickWidth is 0. However, the label->step is what I need, as I want to display only every Xth label. Has nothing to do with ticks. Hmmm...

http://stackoverflow.com/comment/45683303
comment on: http://stackoverflow.com/q/28696330
score: 0
type: Comment
type: QuestionComment
has text: If the results do not change, why not cache them in your java tier?

http://stackoverflow.com/a/28649356
answers question: http://stackoverflow.com/q/28646716
type: Answer
has body: You don't show much code :-/ So at least 2 possibilities come to mind: The user is spinning the mousewheel too quickly for the canvas to redraw all the requested draws. If this is the case you'll want to throttle the mousewheel events with a technique called "debouncing". Google: debounce events If you're forcing the canvas to redraw the entire original image at increasing size, then canvas is being slowed because it must calculate every pixel outside the canvas so that it knows which pixels to draw inside the canvas. You can fix this by using the clipping version of context.drawImage to select a smaller piece of the original image &amp; scale that smaller piece instead of the whole image.
score: 0

http://stackoverflow.com/comment/45708818
comment on: http://stackoverflow.com/q/28700071
has text: what are you sending to `THREE.ImageUtils.loadTexture()` ?
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45623502
type: Comment
type: AnswerComment
has text: Or even better, put `===` instead of `=` :)
score: 0
comment on: http://stackoverflow.com/a/28664238

http://stackoverflow.com/comment/45574957
has text: Thanks for being quick on the draw. I've toyed with closures, but it seems I lose the benefits of the prototyping. The method you've presented is valid, but it requires us to create a new set of functions for every object, right?
comment on: http://stackoverflow.com/a/28637576
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45672938
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28690564
has text: Why do you want to disable the context menu? This can be turned off in browsers (preventing scripts to disable it). Then there are (shortcut) keys (F12 for win/linux) to do element inspection.

http://stackoverflow.com/a/28720827
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28703516
answers question: http://stackoverflow.com/q/28703516
has body: The solution: cmp.el.on('click', function(event, target) { cmp.fireEvent('openRel', cmp); }, null, {delegate: 'a'}); It's a little modification of this answer: How do you attach click events to ExtJS template elements? Needs to get the DOM of the component and then delegate a click event to the tag.
type: AcceptedAnswer

http://stackoverflow.com/a/28671306
answers question: http://stackoverflow.com/q/28671174
upvote count: 21
downvote count: 1
score: 20
has body: Try this for Express 4.0 : // this middleware will be executed for every request to the app app.use(function (req, res, next) { res.header("Content-Type",'application/json'); next(); });
type: Answer

http://stackoverflow.com/a/28697947
answers question: http://stackoverflow.com/q/28697839
type: Answer
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/45690275
has comment: http://stackoverflow.com/comment/45687112
has body: The reason is that your settimeout ends all at the same time (after 5 seconds) because your timeout code is based on 5 seconds for(var i = 1; i &lt;= 5; i++) { (function(index) { setTimeout(function() { alert(index); }, 5000); })(i); } What you want to do is change the timeout time based on your index (hence will have different start times. for(var i = 0; i &lt; 3; i++) { (function(index) { setTimeout(function() { alert(index); }, index*5000); })(i); } (Also needs 3 iterations, so edited out the loop for you)
score: 4
has comment: http://stackoverflow.com/comment/45690778
has comment: http://stackoverflow.com/comment/45690874

http://stackoverflow.com/a/28753309
score: 1
has comment: http://stackoverflow.com/comment/46002145
has comment: http://stackoverflow.com/comment/45958259
downvote count: 0
has body: This is the code for page1.php: &lt;form action="page2.php" method="get"&gt; &lt;input name="userfield" id="thiscanbedifferent" type="text"&gt; &lt;/form&gt; This code for page2.php will make the user input safe to use: $userPrice = $_GET['userfield'];//The $_GET variable has all the values from your form as long as you specify method: get. Remember that users are both incompetent and devious, and that you can never trust their input. Always clean and check it!! $userPrice = preg_replace('/[^0-9.]/','',$userPrice);//This is called a regular expression, it filters out stuff we don't want. This one gets rid of characters that are not in the range 0-9, or "." $userPrice = floatval($userPrice);//This turns the cleaned value into a number This code will convert an arbitrary number into a range. $rangeLabels = ["$0 - $100,000", "$101,000-$200,000", "$201,000-$300,000"];//labels for pricing. can be extended indefinately, as needed $rangePricing = [125,175,195];//pricing steps. can be extended indefinately, as needed $rangeIndex = floor($userPrice/100000);//100000 can be adjusted to any increment you would like, just be sure to update labels accordingly //$rangeIndex = floor(($userPrice-1000)/100000);//this alternate equation makes values such as 100,999 fall below $101,000. My literal (probably wrong) interpretation of your range labels. if($rangeIndex &lt; 0 || $rangeIndex &gt; count($rangePricing)){ die('Number is out of range!');//Use better error handling in production } echo 'The user has selected the price $' . floatval($userPrice) . ' which falls under into the range ' . $rangeLabels[$rangeIndex] . ', for which the pricing is ' . $rangePricing[$rangeIndex] . '&lt;br&gt;';
answers question: http://stackoverflow.com/q/28749343
has comment: http://stackoverflow.com/comment/45793266
has comment: http://stackoverflow.com/comment/45901076
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45984407

http://stackoverflow.com/comment/116798721
type: Comment
has text: There is no messages below, I think you was thinking about post above. I changed post marking as "Solution" from my post to post above. I hope you are right, I am not able to test it now :-)
type: AnswerComment
comment on: http://stackoverflow.com/a/28998513
score: 0

http://stackoverflow.com/a/28614909
type: Answer
upvote count: 1
score: 1
has body: If you want to select first option then below is the code: $('select option:first-child').attr("selected", "selected"); But if you want to select the current value then below is the code: $('#eexist option:first').val($eexist); this should only work if $eexist exists as value in dropdown Since you didn't provide much so it's hard to tell..At least provide a jsfiddle link when you ask a question
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28614706
answers question: http://stackoverflow.com/q/28614706

http://stackoverflow.com/a/28745408
score: 1
upvote count: 1
has body: Even though the question was really aimed at finding a solution other than using an additional framework I've come to the conclusion that this is not feasible. I've decided to just go with angular.js and I couldn't recommend more this 3 part tutorial more.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28707368
type: Answer
answers question: http://stackoverflow.com/q/28707368

http://stackoverflow.com/comment/45779317
has text: If chrome keeps extensions loaded when in chrome background-mode (browser closed but icon in taskbar), then you could perhaps detect when the extension page closes. Have a look at [background pages](https://developer.chrome.com/extensions/background_pages) and [event pages](https://developer.chrome.com/extensions/event_pages). But I'm not sure if chrome keeps extensions in memory.
score: 0
comment on: http://stackoverflow.com/q/28748236
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28668352
has answer: http://stackoverflow.com/a/28668578
has body: Is there any way to search the javascript array which has the element which starts with the particular char without looping the array. Example: var fruits = ["Banana", "Orange", "Apple", "Mango"]; From this array I want to check any element starts with the character 'M'. Note: Should not loop the array.
has comment: http://stackoverflow.com/comment/45630883
has answer: http://stackoverflow.com/a/28668478
type: Question
has comment: http://stackoverflow.com/comment/45631500
tagged with: arrays
has comment: http://stackoverflow.com/comment/45631151
tagged with: javascript
has title: Array Search by first character
has answer: http://stackoverflow.com/a/28668593
has comment: http://stackoverflow.com/comment/45630990
has comment: http://stackoverflow.com/comment/45631104
score: 0
answer count: 7
has answer: http://stackoverflow.com/a/28668442
has answer: http://stackoverflow.com/a/28668421
has answer: http://stackoverflow.com/a/28668594
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28668420

http://stackoverflow.com/a/28690557
has comment: http://stackoverflow.com/comment/45705584
downvote count: 0
type: Answer
upvote count: 1
has body: ionic-angular.js has overridden the addClass function. Here is the snippet. jqLite.prototype.addClass = function(cssClasses) { var x, y, cssClass, el, splitClasses, existingClasses; if (cssClasses &amp;&amp; cssClasses != 'ng-scope' &amp;&amp; cssClasses != 'ng-isolate-scope') { //............ Because of the if condition ng-scope and ng-isolate-scope classes are not getting added even if the debuggingInfo is enabled.
answers question: http://stackoverflow.com/q/28688483
score: 1
has comment: http://stackoverflow.com/comment/45674872

http://stackoverflow.com/comment/45700403
type: AnswerComment
type: Comment
has text: Thanks for the response, but that didn't hide it, either.
comment on: http://stackoverflow.com/a/28704976
score: 0

http://stackoverflow.com/comment/94445902
score: 1
type: AnswerComment
has text: @Golo I am unable to comprehend. Don't we have `promises` for that? or `async`?
type: Comment
comment on: http://stackoverflow.com/a/28656848

http://stackoverflow.com/comment/45500072
score: 0
type: AnswerComment
has text: You can take a look at this cool W3S article about `background-image` :) -> http://www.w3schools.com/cssref/pr_background-image.asp
type: Comment
comment on: http://stackoverflow.com/a/28596595

http://stackoverflow.com/q/28696574
upvote count: 1
has body: Hi in the below code how to give the space to two tr rows and i want to divide with this symbol.and background color should occupy the full table.first row no need this | i want to divide all the left side row with full | symbol and then right side td's can any one help me Expected output: About Us | Latest News Facilities Events Doctors Gallery Our Blogs Contact Us html About Us Latest News Facilities Events Doctors Gallery Our Blogs Contact Us css #slider1 footer { background-color:#00008B; width:100%; #footer tr { position: relative; list-style-type: none; display: inline; } #footer tr:before { content: " | "; } #footer td { border: 1px dotted blue; } #footer tr.row2 td { padding-top: 40px; } #footer tr:first-child:before { content: none; }
downvote count: 1
has comment: http://stackoverflow.com/comment/45683749
has title: how to give space between tr tag and divide by | in html
type: Question
possible better answer: http://stackoverflow.com/a/28697057
answer count: 2
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28696728
score: 0
has comment: http://stackoverflow.com/comment/45683495
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/45683676
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28696728
has answer: http://stackoverflow.com/a/28697057

http://stackoverflow.com/comment/45617622
type: Comment
has text: Currently, the list only contains items matching the previously inserted text. Actually, I would like to see the full list every time I click on the arrow.
comment on: http://stackoverflow.com/a/28655141
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45732512
score: 0
has text: @charlietfl sorry for lack of clarity -- I edited the question. In essence, the problem is that `Click here` does not work elegantly due to the base tag (it works as the spec says it should, but extra routing code would need to be added to server to handle changed url)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28708097

http://stackoverflow.com/comment/45674604
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28691230
has text: one liner are handy but trickier to debug, may not suit beginners :)
type: AnswerComment

http://stackoverflow.com/a/28726422
type: Answer
answers question: http://stackoverflow.com/q/28726082
accepted answer of: http://stackoverflow.com/q/28726082
type: AcceptedAnswer
score: 0
has body: var song = null; function a() { song = new Audio("audio/ring.wav"); song.controls = false; song.loop = true; song.autoplay = true; document.body.appendChild(song); } a(); // Pause the audio, please note there is no stop event song.pause();

http://stackoverflow.com/comment/111635247
has text: This removes the entire map.
score: 12
comment on: http://stackoverflow.com/a/62545643
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45795304
type: AnswerComment
score: 0
type: Comment
has text: No, it's not that i want. In your example if i type 'b' it will show only black, I want all data.
comment on: http://stackoverflow.com/a/28740285

ratchet
type: Tag
tag name: ratchet
tags question: http://stackoverflow.com/q/28717253

http://stackoverflow.com/a/28707248
type: Answer
has body: you need put some var in success function success: function(data) { alert(data); } then, when you read var "data" u can do anything with the text
answers question: http://stackoverflow.com/q/28706389
score: 0

http://stackoverflow.com/comment/45643003
has text: First of all check mongo is running or not. Then make change "localhost" instead of "127.0.0.1" and make sure port 3000 is free! and it should be number
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28674771

http://stackoverflow.com/comment/45709697
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28709212
has text: Please forgive my ignorance but I am very new to javascript and have never used jsfiddle. I tried to use the jsfiddle but there are no results. I have a php script on this same page that reads what is posted once a checkbox is clicked then creates a new query based on which boxes are checked. There is no spot in jsfiddle for all these script types so not sure what to do? Everything works fine I am just now trying to implement the save/repopulate function which works fine but it just doesn't post which boxes are checked to the php script..
type: AnswerComment

http://stackoverflow.com/comment/45670075
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28688557
has text: Try creating new element and then change the innerHTML of tthat element on every click. You can check my answer. Try this fiddle http://jsfiddle.net/codeSpy/nzqxcoL0/
score: 0

http://stackoverflow.com/comment/45618611
type: QuestionComment
comment on: http://stackoverflow.com/q/28661708
has text: and make sure all the property names follows the same notation.
score: 0
type: Comment

http://stackoverflow.com/a/28685091
downvote count: 0
score: 3
accepted answer of: http://stackoverflow.com/q/28684310
answers question: http://stackoverflow.com/q/28684310
type: AcceptedAnswer
upvote count: 3
type: Answer
has body: I think you should try rendering React components on server-side using PHP. Here is a PHP lib to do that. But, yes, you'll basically need to use V8js from your PHP code. However, it's kind of experimental and you may need to use other around. (And this "other way around" may be using Node/Express to render your component. Here is some thoughts on how to do it.)

http://stackoverflow.com/comment/45536479
type: QuestionComment
score: 3
has text: What is your problem with calling `.then` in the controller? This is normal. The controller is clearly dealing with just assigning data to the ViewModel (inside `.then`, in this case), and the service is dealing with the backend. Clear separation of concerns
comment on: http://stackoverflow.com/q/28616433
type: Comment

http://stackoverflow.com/a/28676727
type: Answer
upvote count: 6
answers question: http://stackoverflow.com/q/28676489
accepted answer of: http://stackoverflow.com/q/28676489
has comment: http://stackoverflow.com/comment/45646851
type: AcceptedAnswer
downvote count: 0
score: 6
has body: This should work, but I can't really be certain that the property is set if I access it from somewhere else, correct? Correct Is there a way to deal with that. Like if I need to use attr1 somewhere, can I wait for the ajax to return or something? Yup: Where you want to use attr, have the accessor accept a callback (directly, or indirectly by returning a promise), and have it call the callback (or resolve the promise) when the attribute is available. It looks like you want to keep the code that initiates the ajax call separate from the code that uses the attribute value later. If so, a promise-based mechanism will probably be more useful in this situation. As you're using jQuery, here's a jQuery example using jQuery's Deferred and Promise: var Class = function(){ this.attr1LoadDeferred = $.Deferred(); } Class.prototype.setAttr1 = function(){ var self = this; $.ajax({ url:'http://api.something.com?get=somedata', success: function(data){ self.attr1 = data.name; self.attr1LoadDeferred.resolveWith(self); } }); } Class.prototype.accessAttr1 = function() { return this.attr1LoadDeferred.promise(); }; Usage: // Create an instance var c = new Class(); // At some point, initiate loading the value c.setAttr1(); // At some point, look to use the value c.accessAttr1().then(function(inst) { console.log(inst.attr1); }); // Somewhere else, look to use the value c.accessAttr1().then(function(inst) { doSomethingElseWith(inst.attr1); }); Unfortunately, jQuery's Deferred/Promise implementation has an issue that most promises libraries don't: The callback you pass then will sometimes be called asynchronously, other times synchronously. (Specifically: If the promise is already resolved, the callback is synchronous.) Either just keep that in mind when using it, or use a different promise implementation.

http://stackoverflow.com/a/28615404
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28615366
has body: The function ... function wrapValue2(n) { var localVariable = n; return function() { return localVariable; }; } returns a function (see return function()) ... that will need executed to get the answer.

http://stackoverflow.com/q/28708919
upvote count: 2
has comment: http://stackoverflow.com/comment/45708056
tagged with: http://stackoverflow.com/tag/json
downvote count: 2
type: Question
has answer: http://stackoverflow.com/a/28727894
tagged with: arrays
has title: How does one send a [][]byte in Golang to the browser to be decoded as an image
tagged with: javascript
score: 0
answer count: 1
tagged with: web
has comment: http://stackoverflow.com/comment/45708878
accepted answer: http://stackoverflow.com/a/28727894
has comment: http://stackoverflow.com/comment/45708242
favorite count: 0
tagged with: go
has comment: http://stackoverflow.com/comment/45707184
has body: In my back-end golang web server I have converted and processed a directory of images that i have read in using os.ReadDir These images are stored as a [][]byte. I want to be able to send these images through a GET request to be displayed in the browser using Javascript. I am having trouble figuring out how to begin the process to send the data from the Golang web server. The resources I am currently using are the typical net/http package, and Gorilla Mux/Websockets. Here is some sample code that shows how I am currently doing a get request which return some json. How can I similarly send a [][]byte array instead of rendering a template or JSON? import ( "html/template" "log" "net/http" "encoding/json" "github.com/gorilla/mux" ) func ViewSample(rw http.ResponseWriter, req *http.Request) { type Sample struct { Id int `json:"id"` Name string `json:"name"` User string `json:"user } params := mux.Vars(req) sampleId := params["id"] sample := Sample{ Id: 3, Name: "test", User: "testuser" } json.NewEncoder(rw).Encode(sample) }
type: AnsweredQuestion

http://stackoverflow.com/a/28745820
has body: Why don't you put your search in a loop? Like this: checkString = function(str) { var result; for (loopIndex = 0; loopIndex &lt; str.length; loopIndex++) { if (loopIndex = 0) { //Takes the full string result = myCollection.findOne({name: str}); } else { //Takes a smaller string result = myCollection.findOne({name: str.slice(0,(str.length - loopIndex)}); } if (Object.size(result) &gt; 0) { //Stop with looping because an entry has being found break; } } return result; } Note: Please, don't ask me question about meteor itself. For this case create new questions.
score: 0
has comment: http://stackoverflow.com/comment/45774198
type: Answer
answers question: http://stackoverflow.com/q/28744903

http://stackoverflow.com/q/28649542
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has answer: http://stackoverflow.com/a/28651202
upvote count: 0
downvote count: 2
type: Question
has answer: http://stackoverflow.com/a/28651210
score: -2
has title: onchange calculations for dynamic form inputs using PHP and jQuery
has body: The scenario: I'm allowing a user to select a number of pizzas, they then go to a page where they can choose different options for each pizza. The idea is that as they change an option for a pizza the results are shown in a results div for that pizza with the price. If the user has chosen 3 pizzas there will be lots of options with three divs to show the results for each, and a grand total div. I have successfully looped through and created the option boxes, but I am struggling to see the best way to get the selections of the dynamic form values so I can do calculations and run some ajax to populate the result divs. This is the generated forms(though they could probably all go into one form) &lt;?php $boxNum = 0; ///to append to form input id names ///start loop foreach(loops through array){///start loop $theid = ///this successfully assigns the id $pizzaname = /// this successfully assigns the pizza name ?&gt; &lt;div id="pizza_option_&lt;?php echo $boxNum; ?&gt;" &gt; &lt;form action="" method="post"&gt; &lt;input name="theid_&lt;?php echo $boxNum; ?&gt;" id="theid_&lt;?php echo $boxNum; ?&gt;" type="text" value="&lt;?php echo $theid; ?&gt;" class="bk" &gt; &lt;input name=" pizzaname _&lt;?php echo $boxNum; ?&gt;" id=" pizzaname _&lt;?php echo $boxNum; ?&gt;" type="text" value="&lt;?php echo $pizzaname?&gt;" class="bk"&gt; &lt;select name="sizes_&lt;?php echo $boxNum; ?&gt;" id="sizes_&lt;?php echo $boxNum; ?&gt;" class="bk"&gt; &lt;?php avaliable_sizes($id); ///fuction to get available sizes ?&gt; &lt;/select&gt; &lt;select name="topping_&lt;?php echo $boxNum; ?&gt;" id="topping_&lt;?php echo $boxNum; ?&gt;" class="bk"&gt; &lt;?php avaliable_toppings($id); ///fuction to get available toppings ?&gt; &lt;/select&gt; &lt;/form&gt; &lt;/div&gt; &lt;?php $boxNum ++; } // end of loop ?&gt; &lt;div id="pizza_results_&lt;?php echo $boxNum; ?&gt;" &gt; Display selection choices and cost for pizza &lt;/div&gt; &lt;div id="grand_total_for_pizzas" &gt; Display total of all p…
answer count: 2
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28645162
answer count: 1
tagged with: parse-platform
tagged with: android
has comment: http://stackoverflow.com/comment/45588829
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45589391
accepted answer: http://stackoverflow.com/a/28646226
tagged with: javascript
score: 0
has body: I have class named Profiles on Parse, which contains a Boolean column isDefault. Basically what I am trying to achieve is, if a save is called on Profiles, I want to check the object added/updated before it's saved, if it's isDefault is true, then change all other rows in Profiles to false, then save the new or updated object. For this scenario, I used beforeSave, Everything work in beforeSave except that it doesn't run the query which updates all Profiles data, here is the code I use: Parse.Cloud.beforeSave("Profiles", function(request, response) { if (request.object.get("imageUrl") == null || request.object.get("imageUrl") == "") { request.object.set("imageUrl", "http://www.imran.com/xyper_images/icon-user-default.png"); } if (!request.object.get("isDefault")) { request.object.set("isDefault", false); }else{ var query = new Parse.Query("Profiles"); query.equalTo("user", request.object.get("user")); query.find().then(function(results) { for (var i = 0; i &lt; results.length; i++) { var pro = results[i]; pro.set("isDefault", false); pro.save(); } } ); } response.success(); });
has answer: http://stackoverflow.com/a/28646226
has title: Parse cloud beforeSave update class

http://stackoverflow.com/comment/45767382
comment on: http://stackoverflow.com/a/28741451
score: 0
type: AnswerComment
type: Comment
has text: not really... sorry. I'm quite new to all of this. Have only be working with it for a couple of weeks

http://stackoverflow.com/q/28724647
answer count: 2
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28725040
has comment: http://stackoverflow.com/comment/45736995
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has body: I'm trying to implement history.pushState into our website to replace hash bangs but I'm puzzled as to why every time I click on a link that instead of appending the href value onto the current url e.g. www.abc.com/123.php/20 it instead makes it www.abc.com/20 even though I am still on the 123.php page (hopefully that makes sense). I should also point out the the html below is created via php. I have read quite a few tutorials explaining how to implement this and read a lot of articles, but still no luck. Also all the tutorials I have found show this working with the main menu but this is working with a grid of projects that load in data with Ajax. Any help would be hugely appreciated! Western Power Distribution - Brechfa Connection var e, p; $(function(){ p = $(".projectItem").click(function() { e = $(this); if(!e.hasClass('active')){ getResults(); history.pushState(null, null, e.attr('href')); } return false; }); }); window.addEventListener("popstate", function(){ e = $('a[href="'+location.pathname.split("/").pop()+'"]'); getResults(); }); function getResults(){ p.removeClass('active'); e.addClass('active'); $.get('projectT.php', {id: e.attr('href')}, function(data){ $('#projectContent').html(data); }); }
has comment: http://stackoverflow.com/comment/45736853
has comment: http://stackoverflow.com/comment/45736794
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28725224
has title: history.pushState removing part of the url
type: Question
possible better answer: http://stackoverflow.com/a/28725224
has answer: http://stackoverflow.com/a/28725040
tagged with: javascript
score: 0

http://stackoverflow.com/comment/46185338
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28941420
has text: Need I tel you that SO is a resource where questions and answers can interest people beyond the original poster? You received an answer in a comment (good for you, and even better because you improved the "horrible code" proposed by @blex). But your question wasn't formally answered, and I wanted to explain a bit (not very much in words, true, but I hope the example was self-explanatory, if not optimized to suit your taste). But I see you are an angry guy with a sermon for everyone.
type: AnswerComment

http://stackoverflow.com/q/28628286
has answer: http://stackoverflow.com/a/62220275
possible better answer: http://stackoverflow.com/a/28669203
has answer: http://stackoverflow.com/a/29322057
has answer: http://stackoverflow.com/a/28669203
type: Question
tagged with: javascript
tagged with: sharepoint
answer count: 3
accepted answer: http://stackoverflow.com/a/29322057
downvote count: 0
favorite count: 0
has body: I am having a script as below:- function getColorValue(aId,atitle) { try{ var clientContext = new SP.ClientContext(); var oWebsite = clientContext.get_web(); var oList = oWebsite.get_lists().getByTitle('Item type'); var oListItem = oList.getItemById(parseInt(aId)); clientContext.load(oListItem); clientContext.executeQueryAsync(function () { var listItem = oListItem; var colorname = listItem.get_item('Color_x0020_Name'); if (typeof colorname != 'undefined') { if (colorname != null) { $("div[title$='" + atitle + "']").css("background-color", colorname); } } }, onColorQueryFail); } catch(e){ } } I need to call this script each time after a SharePoint Calendar Item is created. Can anyone help?
has title: Call Javascript After Saving Calendar Item
upvote count: 2
tagged with: csom
score: 2
type: AnsweredQuestion

http://stackoverflow.com/comment/45735355
type: Comment
type: QuestionComment
has text: @FelixKling I've just updated with `jwt.verify` functioin
comment on: http://stackoverflow.com/q/28724169
score: 0

http://stackoverflow.com/a/28661265
type: Answer
answers question: http://stackoverflow.com/q/28658002
score: 0
has body: You can also set different timeouts for each it that will override the exports.config value like this- it('should take less than 500', function (done) { setTimeout(done, 500); browser.get('#/dashboard'); },500);

http://stackoverflow.com/q/28638491
has comment: http://stackoverflow.com/comment/45578232
has comment: http://stackoverflow.com/comment/45578102
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45578023
tagged with: php
has body: I have written an AJAX script that needs to send out some variables to a PHP script and then report back a little script to connect with a server. However I can seem to use the store variables I have passed on from my AJAX script &lt;script&gt; function executeSsh() { var username = "&lt;?php echo $connect_d["username"] ?&gt;"; var password = "&lt;?php echo $connect_d["password"] ?&gt;"; var ip = "&lt;?php echo $connect_d["dedicatedip"] ?&gt;"; $.ajax({ url: "functions.php", dataType: 'text', type: "post", data: { username: username, password: password, ip: ip }, success: function(data) { $('#sshcall').html( data ); }, error: function(jqXhr, textStatus, errorThrown) { alert("Request failed: " + textStatus); } }); $('.blinstbtn').fadeToggle(1000); } &lt;/script&gt; So now you can see the three variables who are passed to PHP as they should and stored as they should in separate variables. However at this point I can't use them any longer and I get a connection error. &lt;?php include('Net/SSH2.php'); $username = $_POST['username']; $password = $_POST['password']; $ip = $_POST['ip']; echo $username. "&lt;br&gt;&lt;br&gt;". $password; $ssh = new Net_SSH2($ip); if (!$ssh-&gt;login($username, $password)) { exit('Login Failed'); } $ssh-&gt;read('/.*@.*[$|#]/', NET_SSH2_READ_REGEX); $ssh-&gt;write("uptime\n"); $ssh-&gt;setTimeout(10); $output = $ssh-&gt;read('/.*@.*[$|#]|.*[P|p]assword.*/', NET_SSH2_READ_REGEX); echo "&lt;pre&gt;". $output . "&lt;/pre&gt;"; ?&gt; So when I echo out each variable it should the correct value, but when I try to used then further down the script I keep getting the message that login didn't work. I know the script to connect to the server is working as I tested it with just the raw info. Any idea what I am missing here and how I can solve it. Is there also a way to encrypt the data string that is being send by AJAX so now one can pickup the values with something like Firebug? Thanks for the help.
has answer: http://stackoverflow.com/a/28640046
has comment: http://stackoverflow.com/comment/45579124
has comment: http://stackoverflow.com/comment/45578208
has comment: http://stackoverflow.com/comment/45576955
has title: ajax variable not usable in php script
type: Question
answer count: 1
tagged with: javascript
tagged with: variables
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/45578515

http://stackoverflow.com/comment/45563966
type: QuestionComment
has text: Which browser are you using? Just tried to [reproduce](http://jsfiddle.net/m06x0x8b/), no issues tho.
comment on: http://stackoverflow.com/q/28631631
score: 0
type: Comment

http://stackoverflow.com/comment/45545300
score: 0
type: Comment
has text: https://github.com/kriskowal/q/wiki/API-Reference#qpromiseresolver and https://github.com/kriskowal/q#using-qpromise VS http://www.html5rocks.com/en/tutorials/es6/promises/ and https://github.com/petkaantonov/bluebird/blob/master/API.md#new-promisefunctionfunction-resolve-function-reject-resolver---promise
comment on: http://stackoverflow.com/a/28596255
type: AnswerComment

http://stackoverflow.com/comment/45758084
comment on: http://stackoverflow.com/a/28736779
type: AnswerComment
score: 0
has text: Then for one button change: `bottom:0` to `bottom:40` or whatever amount of pixels fits best.
type: Comment

http://stackoverflow.com/q/28706299
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45703366
has body: I have a simple service which grab data from HTTP end point send it back to controller. I also implemnted caching in the service however, i get this error TypeError: undefined is not a function on this line of code in my controller myappApi.getItems().then(function(data) I tried to figure out why i couldn't. here is the controller code: .controller('ItemsCtrl',['$scope','myappApi',function($scope, myappApi){ myappApi.getItems().then(function(data){ $scope.items = data; }); }]) As am using Ioniframework here how i injected my services in the app.js: angular.module('myApp', ['ionic', 'myApp.controllers', 'myApp.services', 'angular-data.DSCacheFactory']) and here is the code of my service: (function() { 'use strict'; angular.module('myApp.services',[]).factory('myappApi', ['$http', '$q', '$ionicLoading', 'DSCacheFactory', myappApi]); function myappApi($http, $q, $ionicLoading, DSCacheFactory) { self.itemsCache = DSCacheFactory.get("itemsCache"); //to re-use expired cached data if no internet connection self.itemsCache.setOptions({ onExpire: function (key, value) { getItems() .then(function () { console.log("items items Cache was automatically refreshed.", new Date()); }, function () { console.log("Error getting data. Putting expired item back in the cache.", new Date()); self.itemsCache.put(key, value); }); } }); function getItems() { var deferred = $q.defer(), cacheKey = "items", itemsData = self.itemsCache.get(cacheKey); if (itemsData) { console.log("Found data inside cache", itemsData); deferred.resolve(itemsData); } else { $http.get("services/data.json") .success(function(data) { console.log("Received data via HTTP"); self.itemsCache.put(cacheKey, data); deferred.resolve(data); }) .error(function() { console.log("Error while making HTTP call."); deferred.reject(); }); } return deferred.promise; } return { getItems: getItems }; }; })(); Thank you for your time.
has title: AngularJS fail to inject a service
has comment: http://stackoverflow.com/comment/45703286
tagged with: ionic-framework
type: Question
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/28707018
score: 0
has answer: http://stackoverflow.com/a/30624238
tagged with: angularjs

http://stackoverflow.com/q/28747183
possible better answer: http://stackoverflow.com/a/28747322
has answer: http://stackoverflow.com/a/28747256
linked to: http://stackoverflow.com/q/11312316
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3345457
has comment: http://stackoverflow.com/comment/45776645
has body: As you see below I have code for a clock including the date that is set 2 weeks in advance, however it is not working either locally or on a server. Could somebody please tell me what I am doing wrong? The code is also below &lt;script type="text/javascript"&gt; 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() + &lt;?php date_default_timezone_set('Europe/London'); echo date('Z'); ?&gt;); 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('clockbox').innerHTML=""+tday[nday]+", "+tmonth[nmonth]+" "+ndate+", "+nyear+" "+nhour+":"+nmin+":"+nsec+ap+""; } window.onload=function(){ GetClock(); setInterval(GetClock,1000); } &lt;/script&gt; &lt;div id="clockbox"&gt;&lt;/div&gt;
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28747256
upvote count: 0
tagged with: clock
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45776643
score: -1
answer count: 2
has answer: http://stackoverflow.com/a/28747322
has title: Why is my javascript clock not working?
has comment: http://stackoverflow.com/comment/45777126
has comment: http://stackoverflow.com/comment/45776885
favorite count: 0

http://stackoverflow.com/comment/45510666
has text: Not sure if it's a bulletproof solution: http://jsfiddle.net/yL45ds8j/4/. You have to check this post: http://stackoverflow.com/questions/152975/how-to-detect-a-click-outside-an-element?page=1&tab=active#tab-top
type: Comment
comment on: http://stackoverflow.com/q/28602532
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45653221
type: QuestionComment
has text: @DesignerGuy using this along with bootstrap img-reponsive did the trick. Post as an answer and I will accept :)
score: 0
comment on: http://stackoverflow.com/q/28624129
type: Comment

http://stackoverflow.com/a/28676353
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28676026
has comment: http://stackoverflow.com/comment/45646665
accepted answer of: http://stackoverflow.com/q/28676026
upvote count: 1
type: AcceptedAnswer
has body: There is too much wrong with your code. Basically your code should look like this: var Fighter = function (life, armor, initiative, dmg) { this.life = life; this.armor = armor; this.initiative = initiative; this.dmg = dmg; }; Fighter.prototype.fight = function(opponent) { if (opponent.initiative&gt;this.initiative) { this.life-=(opponent.dmg-this.armor); if(this.life&lt;=0) { updateStats(); return; // &lt;- ANSWER TO YOUR QUESTION } opponent.life-=(this.dmg-opponent.armor); updateStats(); } else if (this.initiative&gt;=opponent.initiative) { opponent.life-=(this.dmg-opponent.armor); if(opponent.life&lt;=0) { updateStats(); return; // &lt;- ANSWER TO YOUR QUESTION } this.life-=(opponent.dmg-this.armor); updateStats(); } }; But I would strongly recommend to have a look at guides and documentation on "Object Oriented Javascript" before you continue, e.g. here.
type: Answer

http://stackoverflow.com/q/28690497
tagged with: angularjs
tagged with: android
tagged with: cordova
type: UnansweredQuestion
has title: JSON load issue with phonegap
upvote count: 1
has body: I'm using phonegap to create an app on android, ios and windows. I'm using this js for the JSON, calling for business hours (shours1, shours2, shours3): (function(){ 'use strict'; var app = angular.module('app', ['onsen', 'angular-images-loaded', 'ngMap', 'angular-carousel']); app.controller('restaurantController', function($http, $scope, $compile, $sce){ $scope.getHours = function(){ $scope.isFetching = true; $scope.shours1 = ''; $scope.shours2 = ''; $scope.shours3 = ''; $http.jsonp('http://signsrestaurant.ca/api/get_posts/?post_type=restaurant&posts_per_page=-1&callback=JSON_CALLBACK').success(function(response) { // Get's the first restaurant $scope.restaurantJson = response.posts[0]; $scope.isFetching = false; console.log( $scope.restaurantJson.custom_fields.shours1[0] ); $scope.shours1 = $scope.restaurantJson.custom_fields.shours1[0]; $scope.shours2 = $scope.restaurantJson.custom_fields.shours2[0]; $scope.shours3 = $scope.restaurantJson.custom_fields.shours3[0]; }); } }); })(); Here is my html: Location Rate Favorite Call Directions Monday {{ shours1 }} Tuesday-Thursday {{ shours2 }} Friday-Sunday {{ shours3 }} It seems to be working partially. The shours do load, but only after I rotate my android or click on the menu. It doesn't load off-hand immediately. It basically needs some sort of a refresh to get it to load. I would appreciate it if someone can help me out with this.
score: 1
tagged with: http://stackoverflow.com/tag/json
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28690849

http://stackoverflow.com/a/28595959
has body: You have to make browser go to full screen mode to achieve that. For mobile FF you have to create manifest and at there: "fullscreen": "true" https://developer.mozilla.org/en-US/Apps/Build/Manifest#fullscreen
downvote count: 0
has comment: http://stackoverflow.com/comment/45499353
answers question: http://stackoverflow.com/q/28595161
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/a/28654716
type: Answer
has body: before adding parse string as Integer. function salesPerson(name, id, amount) { this.name = name; this.id = id; this.amount = amount; }; //Create car array for each brand var Car = new Array(4); //Create array of salePersons var Person = new Array(2); //Every element in the array is a object type salesPerson for (var i = 0; i &lt; Person.length; i++) { Person[i] = new salesPerson("", 0, 0); } var temp = 0; var m = 0; var a = 0; var p = 0; var b = 0; for(var i = 0; i &lt; Person.length; i++){ Person[i].name = prompt("Enter salesman name: "); Person[i].id = prompt("Enter salesman id: "); temp = parseInt(prompt("Enter Mercedes-Benz amount: ")); Person[i].amount += temp; m += temp; temp = parseInt(prompt("Enter Audi amount: ")); Person[i].amount += temp; a += temp; temp = parseInt(prompt("Enter Porsche amount: ")); Person[i].amount += temp; p += temp; temp = parseInt(prompt("Enter BMW amount: ")); Person[i].amount += temp; b += temp; } var max = 0; var name = ""; for (var i = 0; i &lt; Person.length; i++) { if (Person[i].amount &gt; max) { max = Person[i].amount; name = Person[i].name; } } alert("The best salesperson of the month is " + name + ", with the sales amount of $" + max);
score: 0
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45624189
answers question: http://stackoverflow.com/q/28654675

http://stackoverflow.com/comment/48459452
score: 1
comment on: http://stackoverflow.com/a/28722697
type: AnswerComment
has text: Don't forget to set `tagName: 'li'` in the component. Otherwise, a div will be used, which could mess up your list.
type: Comment

http://stackoverflow.com/q/28667641
tagged with: javascript
tagged with: gulp
favorite count: 0
type: AnsweredQuestion
has body: My folder structure: dashboard &gt; components &gt; accounts &gt; accounts.js, accountsDirectives.js dash &gt; dashApp.js settings &gt; settings.js, settingsDirectives.js etc... My function in the Gulpfile function compile_js(minify, folder) { var jsLibs = gulp.src('client/'+folder+'/_sources/js/libs/*.js'); var jsPlugins = gulp.src('client/'+folder+'/_sources/js/plugins/*.js'); var jsCustom = gulp.src('client/'+folder+'/_sources/js/custom/*.js'); var jsComponents = gulp.src('client/'+folder+'/components/*.js'); // Order the streams and compile return streamqueue({ objectMode: true }, jsLibs, jsPlugins, jsCustom, jsComponents ) .pipe(concat(folder+'.module.js')) .pipe(gulpif(minify, uglify())) .pipe(gulp.dest('client/'+folder+'/assets/js')); }; The issue is this line, that targets the components directory: var jsComponents = gulp.src('client/'+folder+'/components/*.js'); I've also tried /components/**/*.js but still doesn't work. I found this answer here, which they talk about symlinks, but I want to avoid using that. 1) It seems like a hack, and 2) this requires all current and future devs to create the exact symlinks on their computers as well. Is there another way to easily target and compile all js files in a directory with sub directories?
downvote count: 0
accepted answer: http://stackoverflow.com/a/28667773
type: Question
linked to: http://stackoverflow.com/q/27526891
has answer: http://stackoverflow.com/a/28667773
score: 1
has title: How to compile JS in sub directories using Gulp?
tagged with: gulp-concat
upvote count: 1
answer count: 1

http://stackoverflow.com/comment/45683070
has text: placed at the bottom before ending body tag
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28695229

http://stackoverflow.com/q/28596104
score: 1
has comment: http://stackoverflow.com/comment/45499312
has body: I can get the loader too work with the code now - but it does not replace in and call the URL. So the ajax url call should be called within searchable: LOAD <?php include 'hotels/hotelList.php';?>
type: Question
has title: jQuery Loader on ajax call
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28596512
accepted answer: http://stackoverflow.com/a/28596512
favorite count: 0
downvote count: 0
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45498856

http://stackoverflow.com/a/30224972
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/81185068
type: Answer
score: 67
answers question: http://stackoverflow.com/q/28676631
upvote count: 67
has body: In the state definition in app.js you can add cache:false to disable caching (See Disable cache within state provider in the Ionic docs. Or, you can keep caching except when you know data has changed. If you're already on the page, you can do, $state.go($state.currentState, {}, {reload:true}) If you're on another state and want to go back to the state that is normally cached but you want it to be refreshed, you can do, $ionicHistory.clearCache().then(function(){ $state.go('app.fooState') }) Note, the latter requires clearCache to return a promise. See the changes I made in this pull request and compare the implementation of clearCache that you have now with mine: https://github.com/driftyco/ionic/pull/3724
accepted answer of: http://stackoverflow.com/q/28676631
has comment: http://stackoverflow.com/comment/68476387
has comment: http://stackoverflow.com/comment/68435605

http://stackoverflow.com/a/28627118
downvote count: 1
answers question: http://stackoverflow.com/q/28627060
has body: The problem is the document.write call. Try this: var date = new Date().getFullYear(); document.getElementById("year").innerHTML = date;
score: 0
type: Answer
upvote count: 1

http://stackoverflow.com/a/28632683
has body: You can simply add the loading content next to your table and set him absolute position with full size content and hidden. You need to define parent with relative position too. Then when you click on button make him display. Better way to bind element on js file than inline on markup with onclick. html: ... Click Me! Please Wait css: section { position: relative; } .loading{ display: none; color: #FFF; position: absolute; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); } js: $('#action').on('click', function() { $('.loading').show(); }); http://jsfiddle.net/Pik_at/fywk4gLu/
downvote count: 0
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28632408

http://stackoverflow.com/comment/45509994
type: AnswerComment
type: Comment
score: 2
comment on: http://stackoverflow.com/a/28602286
has text: I didn't downvote, but it definitely isn't correct. Your regular expression checks whether the string starts with a backslash.

file
tags question: http://stackoverflow.com/q/28611281
type: Tag
tags question: http://stackoverflow.com/q/28618964
tags question: http://stackoverflow.com/q/28692695
tag name: file
tags question: http://stackoverflow.com/q/28638913
tags question: http://stackoverflow.com/q/28658388
tags question: http://stackoverflow.com/q/28653195
tags question: http://stackoverflow.com/q/28732767

http://stackoverflow.com/q/28658552
accepted answer: http://stackoverflow.com/a/28658762
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45612959
type: Question
tagged with: javascript
score: 0
answer count: 1
has title: Remove / Replace class with another class without having an ID - Javascript only
has body: Basicly i have two buttons one who will create divs with the class "TargetDummy" and another who should be able to remove the created "TargetDummy". The problem is i cant seem to edit the "TargetDummy"divs since they don't have an ID and i can't give them one since there are several of them. I am looking for a solution in javascript only. My code for creating the "TargetDummy"divs is below var Div = document.createElement("div"); document.body.appendChild(Div).className = "TargetDummy"; I thought something like var Dummies = document.getElementsByClassName("TargetDummy"); Dummies.className = "something"; or Dummies.remove(); would do it, but unfortunately not. I am still learning Javascript so go easy on me :)
has comment: http://stackoverflow.com/comment/45613269
has comment: http://stackoverflow.com/comment/45613065
has answer: http://stackoverflow.com/a/28658762

http://stackoverflow.com/q/28651020
tagged with: javascript
has answer: http://stackoverflow.com/a/28651046
score: 0
linked to: http://stackoverflow.com/q/7424155
type: UnansweredQuestion
has body: I'm trying to excute a code right after loading the page. The "SetInterval" won't do it:\ This is the code: var inter1; function start() { inter1 = setInterval(function() { counter++; slidernum = '#slider' + counter; imgnum = '#img' + counter; $('body').children(slidernum).fadeIn(1500); }, 2000); } start(); I also tried to wrap it with a function but it's still loading after 2000 milliseconds. Any help or alternatives? Thanks!
duplicate of: http://stackoverflow.com/q/7424155
tagged with: loading
has title: SetInterval won't start immediately JS
type: Question
has comment: http://stackoverflow.com/comment/45599538
answer count: 1

http://stackoverflow.com/comment/45538626
has text: and similar to second offset call to set it, it can faster use directly css with position relative/absolute and top, left properties
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28617715

http://stackoverflow.com/comment/45592746
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28646837
type: QuestionComment
has text: @Jjm http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem

http://stackoverflow.com/q/28662333
linked to: http://stackoverflow.com/q/23803743
tagged with: node.js
type: AnsweredQuestion
score: 7
tagged with: rsvp-promise
tagged with: rsvp.js
type: Question
tagged with: javascript
has body: I'm new to promises and using the rsvp implementation. I want to asynchronously read a list of files, then proceed to another task only when all files have been read. I've got as far as the basic structure to read one file, and chain to the next task: var loadFile = function (path) { return new rsvp.Promise(function (resolve, reject) { fs.readFile (path, 'utf8', function (error, data) { if (error) { reject(error); } resolve(data); }); }); }; loadFile('src/index.txt').then(function (data) { console.log(data); return nextTask(data); }).then(function (output) { //do something with output }).catch(function (error) { console.log(error); }); I want to do something like this: loadFile(['src/index.txt', 'src/extra.txt', 'src/another.txt']).then( ... I've seen arrays of promises and hash of promises in the docs, but I don't know which is most relevant, or how to use them. I need an example of their use in the context of my problem above to understand them.
has title: How to read multiple files asynchronously with promises, then proceed
upvote count: 7
answer count: 1
has answer: http://stackoverflow.com/a/28662363
downvote count: 0
accepted answer: http://stackoverflow.com/a/28662363
linked to: http://stackoverflow.com/q/28633187
favorite count: 0
tagged with: promise

http://stackoverflow.com/comment/45707762
has text: And `$scope` as parameter in your controller function
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28709024
type: QuestionComment

http://stackoverflow.com/q/28668883
accepted answer: http://stackoverflow.com/a/28669053
has comment: http://stackoverflow.com/comment/45632765
upvote count: 1
has title: Angularjs $scope and this functions
has comment: http://stackoverflow.com/comment/45632130
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28669053
score: 1
possible better answer: http://stackoverflow.com/a/28669318
type: Question
answer count: 2
has body: I am working on a small application in angularjs :- I am working on deleting a contact. Everything works fine but the this.openModal() throws an error as undefined even though it is defined in the same JS. Have some confusions on how to use this and $scope together. Can anyone help ? $scope.deleteContact = function () { var delNo = $scope.contactNumber; var delName = $scope.contactName; var person = {}; person['phone'] = delNo; ... ... $timeout(function(){ delete $scope.contacts[person['phone']]; }); $scope.activeChats={}; $scope.showContactName = false; this.openModal(); console.log("Delete success"); } EDIT: this.openModal is a function I have defined as follows this.openModal = function (input) { this.modalOpen = !this.modalOpen; // RESET this.showNewMessage = false; this.showEditGroup = false; this.showAddContact = false; this.showPersonSettings = false; this.showUserProfile = false; if (input == "newmessage"){ this.showNewMessage = true; } else if (input == "showEditGroup"){ this.showEditGroup = true; } else if (input == "newcontact"){ this.showAddContact = true; } else if (input == "userprofile"){ this.showUserProfile = true; } else if (input == "usersettings"){ this.showPersonSettings = true; } }
tagged with: this
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28669318
tagged with: scope
has comment: http://stackoverflow.com/comment/45631938
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/comment/72697507
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28625477
type: Comment
has text: This information should be part of React documentation.

http://stackoverflow.com/comment/45776241
comment on: http://stackoverflow.com/a/28745177
has text: Can you load a full version of jquery before loading angularjs, the $.param comes from jquery.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45538050
comment on: http://stackoverflow.com/q/28617135
type: Comment
type: QuestionComment
has text: Nope that still a chat app its just a real-time chat
score: 0

http://stackoverflow.com/q/28688932
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/28689014
accepted answer: http://stackoverflow.com/a/28689014
has answer: http://stackoverflow.com/a/42188596
linked to: http://stackoverflow.com/q/17480526
type: Question
score: 14
has title: Angular.js filter by exact values (strict equality)
tagged with: javascript
has comment: http://stackoverflow.com/comment/45670018
upvote count: 14
has body: I have following html code &lt;ul ng-repeat="friend in friends | filter: { age: '2' } | orderBy: 'name' "&gt; &lt;li&gt;{{friend.name}}&lt;/li&gt; &lt;/ul&gt; Here is my $scope variable $scope.friends = [ { name: "Peter", age: 2 }, { name: "Pablo", age: 55 }, { name: "Linda", age: 20 }, { name: "Marta", age: 37 }, { name: "Othello", age: 20 }, { name: "Markus", age: 32 } ]; It returns Linda Markus Othello Peter How the comparison work in ng filter and How do i get friend having age 2 only Peter
answer count: 2
possible better answer: http://stackoverflow.com/a/42188596
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/q/28610448
has answer: http://stackoverflow.com/a/28610787
answer count: 1
type: UnansweredQuestion
has body: I apologize in advance for this question - it seems so basic but I just can't figure it out myself, or find anything anywhere on the internet that answers my question. My Background I'm generally used to using excel until very recently, when I moved jobs to a department that uses Google Docs. My knowledge of Javascript is very basic, based on the stuff I've come across during the past 4 weeks trying to do some basic code. Background of the sheet I'm working on We have a large sheet of names with associated info, input onto each row. So 1 row = 1 person. Each row goes from Column A to Column T. My boss would like any historical data kept, very much like a database. I'm aware Spreadsheets isn't the best place for this, but my knowledge of database software is less than that of Javascript. What I've managed to do, as a temporary solution, is create an additional column (Column U: Archive) which cuts and pastes the entire row into a sheet named ARCHIVE when 'yes' is input. It also then deletes the empty row left behind, keeping the table nice and tidy. See code here (sheet name changed to Sheet 1 for example purposes): function onEdit(event) { var ss = SpreadsheetApp.getActiveSpreadsheet(); var s = event.source.getActiveSheet(); var r = event.source.getActiveRange(); if(s.getName() == "Sheet1" &amp;&amp; r.getColumn() == 21 &amp;&amp; r.getValue() == "yes") { var row = r.getRow(); var numColumns = s.getLastColumn(); var targetSheet = ss.getSheetByName("Archive"); var target = targetSheet.getRange(targetSheet.getLastRow() + 1, 1); s.getRange(row, 1, 1, numColumns).moveTo(target); s.deleteRow(row); } } What I would like to do now (and what I need the code for) My colleagues would like to be able to view the archive sheet and see, at-a-glance, which cell was changed. We thought the best and simplest way to do this would be to highlight the cell. However, before we archive the row, we're having to copy it, insert a line below and paste the copied data. Then we change whiche…
has title: How to change the background colour of the cell above the edited cell (Javascript, Google Spreadsheets)
type: Question
tagged with: cell
tagged with: edit
tagged with: database
tagged with: javascript
score: 0

http://stackoverflow.com/comment/133861453
comment on: http://stackoverflow.com/a/28607462
has text: Does it also work with Interface? Custom types? in TypeScript? I tried but failed :(
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45558841
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28629294
has text: hey I can not provide you example right now. But you can go through some docs here: http://www.w3schools.com/jquery/jquery_ajax_intro.asp

http://stackoverflow.com/comment/45752318
type: AnswerComment
score: 1
has text: Thanks, your solution worked perfectly, it was a silly error of bad typing from my part.
type: Comment
comment on: http://stackoverflow.com/a/28732066

http://stackoverflow.com/q/28744682
tagged with: reset
score: 2
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28744841
has body: I am a sort of making a game in javascript, but.. I have a problem. When you start the html script you see blue canvas with a white rectangle on it. When you mousemove over the white rect the game starts. But now you will go gameover if you go left and right beyond the road. And you go gameover if you hit another car. Sooo.. My problem now. When you go gameover and you mousemove again over the white rectangle everything is still the same.. It is not reset of course. Now I am asking you guys if you know a good way to reset all the variables, or just something to reset the game. EDIT: I am specially talking about how to do it, so what commands I should use Thnx Here is the game (a sort of) online: http://rekenopjetoekomst.nl/temp/javascript14a.html This is the javascript part: var autoafb1 = new Image(); var autoafb2 = new Image(); var autoafb3 = new Image(); var autoafb4 = new Image(); var bg = new Image(); autoafb1.src = "auto2.png"; autoafb2.src = "auto3.png"; autoafb3.src = "auto4.png"; autoafb4.src = "auto5.png"; bg.src = "snelweg.png"; function Canvas(){ var ctx = document.getElementById('my_canvas').getContext('2d'); var snelheid = 1 //var autos = [{"src":autoafb1, "w":100, "h":175, "y":0+175, "x":Math.floor(Math.random()*450-100)+1, "plusafst":0}, // {"src":autoafb2, "w":100, "h":175, "y":0+175, "x":Math.floor(Math.random()*450-100)+1, "plusafst":0.5}, // {"src":autoafb3, "w":100, "h":175, "y":0+175, "x":Math.floor(Math.random()*450-100)+1, "plusafst":1}, // {"src":autoafb4, "w":100, "h":175, "y":0+175, "x":Math.floor(Math.random()*450-100)+1, "plusafst":1.5}] function Menu() { this.x=0, this.y=0, this.w=ctx.canvas.width, this.h=ctx.canvas.height, this.color="blue", this.count=1, this.value="on"; this.stattX,this.stattY,this.blokx=(ctx.canvas.width*0.5)-(100*0.5), this.bloky=(ctx.canvas.height*0.5)-(100*0.5), this.blokw=100, this.blokh=100; this.draw = function(){ ctx.fillStyle = this.color; ctx.fillRect(this.x,this.y,this.w,this.h); ctx.fillStyle = "white"; c…
upvote count: 2
answer count: 2
accepted answer: http://stackoverflow.com/a/28744854
tagged with: canvas
downvote count: 0
tagged with: javascript
favorite count: 0
has title: The best way to reset your javascript game after gameover, and how
has answer: http://stackoverflow.com/a/28744854
possible better answer: http://stackoverflow.com/a/28744841

http://stackoverflow.com/comment/45510575
comment on: http://stackoverflow.com/q/28602532
score: 1
has text: Something like [this fiddle](http://jsfiddle.net/yL45ds8j/2/)?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45955329
score: 0
has text: I could not find anything mentioning flash player causing the event to fire. One possibility is to look at the evt object that is passed to the beforeunload callback to see if anything specifies it is from the flash player and to do something accordingly.
type: Comment
comment on: http://stackoverflow.com/a/28824837
type: AnswerComment

http://stackoverflow.com/comment/45741255
type: Comment
score: 0
has text: Deps.autorun no longer exist, now we use [Tracker.autorun](http://docs.meteor.com/#/full/tracker_autorun)
comment on: http://stackoverflow.com/a/28727121
type: AnswerComment

http://stackoverflow.com/comment/45761949
comment on: http://stackoverflow.com/q/28739025
type: Comment
type: QuestionComment
score: 0
has text: isn't the purpose of auto-compete to show only relative data?

http://stackoverflow.com/q/28681481
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
has answer: http://stackoverflow.com/a/28682053
type: AnsweredQuestion
type: Question
has title: d3 animation wordCloud flyin
answer count: 1
accepted answer: http://stackoverflow.com/a/28682053
has body: i am trying to make a simple animation in d3 (i am new to it). i have made a word cloud presentation, and i will like it to "fly in" (small movement from left to right and then in center) when the page opens. var text = d3.select("body").append("svg") .attr("width", 1200) .attr("height", 800) .append("g") .attr("transform", "translate(550,300)") .selectAll("text") .data(words) .enter().append("text") .style("font-size", function(d) { return d.size + "px"; }) .style("font-family", "Impact") .style("fill", function(d, i) { return fill(i); }) .attr("text-anchor", "middle") .style("text-anchor", "middle") .attr("transform", function(d) { return "translate(" + [d.x, d.y] + ")rotate(" + d.rotate + ")"; }) .text(function(d) { return d.text; });
tagged with: javascript
has comment: http://stackoverflow.com/comment/45655805
score: 0

http://stackoverflow.com/comment/45753539
type: Comment
comment on: http://stackoverflow.com/a/28727360
type: AnswerComment
has text: Now I am pretty much sure that, there is something wrong with the modules defined as 'sub' and 'myapp'. If I change 'sub' to 'myapp' I do not see the Error:[ng:areq] in the console but on clicking the links the views do not change, whereas earlier the views did change on traversing the links.
score: 0

http://stackoverflow.com/q/28743300
type: Question
accepted answer: http://stackoverflow.com/a/28743536
score: 2
tagged with: validation
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45769513
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45769370
has answer: http://stackoverflow.com/a/28743536
upvote count: 2
has body: I'm trying to add Date validation to a HTML form. I want the date entered to be in the format HH:MM:SS not HH:MM. If I enter date in the wrong format (e.g. HH:MM) then an Alert should show saying: "Date time format should be HH:MM:SS." Please can you help me to correct my code so that it does this? Here is my code in JavaScript: if (date.match(regex pattern)) { alert("Valid date"); } else { alert("Invalid date: date should be in HH:MM:SS format!"); } What is the correct way to validate the Time entered?
linked to: http://stackoverflow.com/q/2732799
has comment: http://stackoverflow.com/comment/45769560
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45772481
tagged with: forms
has title: Time entry validation in a HTML Form

http://stackoverflow.com/comment/45528918
comment on: http://stackoverflow.com/a/28612331
score: 2
type: AnswerComment
has text: It should be noted that `pointer-events` [isn't supported by IE10-](http://caniuse.com/#feat=pointer-events)
type: Comment

http://stackoverflow.com/comment/45590095
has text: Thanks for this though, this was the next problem that came up after fixing this one.
comment on: http://stackoverflow.com/a/28644391
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28628191
has answer: http://stackoverflow.com/a/28628352
has title: $digest already in progress
accepted answer: http://stackoverflow.com/a/28628352
tagged with: angularjs
has body: I'm fetching the data using $http.get() and passing it as argument to a custom filter to get the filterd data. But it is giving an error: $digest already in progress. Does anyone know how to avoid this error or achieve the same thing but a different way? var map=angular.module('map', []) .controller('mapCtrl', function ($scope,$filter,$http) { $http.get('./json/integrated.json').success(function(data) { $scope.sitesInfo = data; }); var filteritems= $filter('applySfotwareFilter')($scope.sitesInfo); });
type: AnsweredQuestion
type: Question
answer count: 1
tagged with: javascript
score: 0

http://stackoverflow.com/comment/45522092
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28609063
has text: Would you please provide AuthService code (written in your way) separately to me?
type: AnswerComment

http://stackoverflow.com/comment/45612437
score: 0
type: AnswerComment
has text: I've updated it again. Hope it will work for you now
type: Comment
comment on: http://stackoverflow.com/a/28657772

http://stackoverflow.com/comment/45743898
type: Comment
has text: Update. We changed the order of the images and that seemed to removed all the spaces except for one. Is this normally how it works?
comment on: http://stackoverflow.com/a/28709490
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45781388
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28749725
type: Comment
has text: I tried it before, in mognodb result is like this "coordinates":["1.434343, 4.21322"], and with these quotation marks is not readable as geojson, i checked on my previous project. But i am curious why if it is an array, mongo is putting quotation marks?

http://stackoverflow.com/comment/45568298
score: 0
type: AnswerComment
has text: GA is async, you risk leaving before it finishes? Test it though. perhaps you can do what you're thinking.
type: Comment
comment on: http://stackoverflow.com/a/28634140

http://stackoverflow.com/comment/45528524
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28609502
has text: I still think you should consider using the $locationProvider service built into Angular, rather than rolling your own.

http://stackoverflow.com/comment/45505123
type: Comment
type: QuestionComment
has text: yes you can do it using javascript, like add a click event on the label and in this write the logic to show the textbox and two buttons in it and hide the label and add click event of both buttons and on click of them do whatever you want and in last show the label again and hide these added controls thats it..
comment on: http://stackoverflow.com/q/28599512
score: 0

http://stackoverflow.com/a/28718207
has body: Have you tried writing something like following. &lt;input type="submit" value="submit" onclick="saveValue(document.getElementById('acre_value').value)"&gt;
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28718052
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28718052

http://stackoverflow.com/q/28734093
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45754450
has comment: http://stackoverflow.com/comment/45753541
has comment: http://stackoverflow.com/comment/45753749
upvote count: 2
has comment: http://stackoverflow.com/comment/45753679
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45753594
has body: I am new to AngularJS. I just tried it with Code School. Here is my code. Controller not executing. Where is the my mistake? Here is the HTML file Demo {{store.product.name}} $ {{store.product.price}} {{store.product.description}} Here is app.js file (function(){ var app = angular.module('store', [ ]); app.controller('StoreController', function(){ this.product = gem; }); var gem = { name: 'Dodecahedron', price: 2.95, description: '. . .', } })();
has comment: http://stackoverflow.com/comment/45753570
has title: AngularJS controller is not executing
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28735748
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45753643
has answer: http://stackoverflow.com/a/28735690
score: 2

http://stackoverflow.com/a/28610386
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/28609929
has body: Based on this other example I found my answer, and that was to add a transform/translate clause as follows: svg.append("g") .attr("class", "y axis") .attr("transform", "translate(" + width + " ,0)") .call(yRight); I'm completely new to d3 though so some explanation of what transform/translate do from d3 experts in the comments would definitely improve the quality of this Q&amp;A.
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28609929

http://stackoverflow.com/comment/45654734
type: Comment
has text: For examples of good date-time libraries, see the either of these Java-based ones: [Joda-Time](http://www.joda.org/joda-time/) or the new [java.time](http://docs.oracle.com/javase/8/docs/api/java/time/package-summary.html) package built into Java 8 (and inspired by Joda-Time). Not a simple matter. As the Answer says, apparently no comparable library exists for JavaScript/EcmaScript.
comment on: http://stackoverflow.com/a/28674017
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46061838
type: Comment
score: 0
has text: I may be missing something, but why do you need to call a function for all children on `propsChange`? Could you not just update the props of the direct child `AwesomeLayer` and then listen to propsChange inside `AwesomeLayer` and react to that change?
comment on: http://stackoverflow.com/q/28643890
type: QuestionComment

http://stackoverflow.com/comment/45686562
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28697751
has text: I finally saw what you changed : you removed the tags from the initial . I tested your code, and it worked (((( But, when I copy-pasted your code into my form, it does not work. Obviously, something is wrong with my side of things
type: Comment

http://stackoverflow.com/comment/45707329
type: AnswerComment
has text: You could use inline template by using [the script directive](https://docs.angularjs.org/api/ng/directive/script). You can see an example at the bottom of the linked page.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28702918

http://stackoverflow.com/comment/45578747
has text: Why don't you just simply look at the source ? It's the better way to understand how it's make.
comment on: http://stackoverflow.com/q/28639537
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45591903
has text: @LyeFish the question is about implementation architecture, not performance comparison. If you're not interested it's ok.
comment on: http://stackoverflow.com/q/28646533
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28680397
has comment: http://stackoverflow.com/comment/45655206
has comment: http://stackoverflow.com/comment/45655355
downvote count: 0
tagged with: timing
type: Question
tagged with: onmousedown
has title: How to measure latency between interaction and mousedown event in JavaScript?
tagged with: javascript
has comment: http://stackoverflow.com/comment/45653866
upvote count: 2
answer count: 1
has comment: http://stackoverflow.com/comment/45654384
favorite count: 0
accepted answer: http://stackoverflow.com/a/28681045
tagged with: latency
has comment: http://stackoverflow.com/comment/45653731
has body: Is there a way to measure the latency between when I press my mouse button and when a defined onmousedown function fires? Or, are there current statistics available about this latency? I assume these two events are not simultaneous, and vary by browser. My only approach so far has been to create multiple onmousedown events and measure the time difference between them using Date. I found up to a 6ms difference between them. I am working on audio applications which are time-sensitive (to milliseconds). Any help is great, thanks!
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28681045

http://stackoverflow.com/q/28656944
type: Question
has title: How to get two scripts src from iframe using jquery or vanilla javascript
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45610165
has body: How to get two scripts src from iframe using jquery or javascript In this I want to get second src using jquery or javascript.
has answer: http://stackoverflow.com/a/28657132
downvote count: 2
upvote count: 1
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/45610289
favorite count: 0
has comment: http://stackoverflow.com/comment/45610124
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45610276

http://stackoverflow.com/a/68055157
downvote count: 4
has comment: http://stackoverflow.com/comment/127839498
has comment: http://stackoverflow.com/comment/120294174
type: Answer
has comment: http://stackoverflow.com/comment/127829676
answers question: http://stackoverflow.com/q/28747719
has comment: http://stackoverflow.com/comment/120329892
upvote count: 11
score: 7
has body: I know this doesn't exactly answer the question but for those who are looking for a READABLE and simple way to do so: const fs = require('fs').promises; async function getFirstLine(filePath) { const fileContent = await fs.readFile(filePath, 'utf-8'); return (fileContent.match(/(^.*)/) || [])[1] || ''; } NOTE: naturaly, this will only work with text files, which I assumed you used from your description this will work with empty files and will return an empty string this regexp is very performant since it is simple (no OR conditions`or complex matches) and only reads the first line
has comment: http://stackoverflow.com/comment/127833430
has comment: http://stackoverflow.com/comment/127830789

http://stackoverflow.com/comment/45535142
type: Comment
has text: I tried to access the variable "dropzone" in the directive (dropzone = new Dropzone...) but I don't now how I can do this , I'm pretty new in Angularjs. I checked , and the function is present in this object.
type: QuestionComment
comment on: http://stackoverflow.com/q/28614980
score: 0

http://stackoverflow.com/comment/45503720
type: QuestionComment
has text: i have 100 or more js file alert message comes from anywhere how can i hide and find ?
score: 0
comment on: http://stackoverflow.com/q/28598648
type: Comment

http://stackoverflow.com/a/28600146
answers question: http://stackoverflow.com/q/28599638
type: Answer
has comment: http://stackoverflow.com/comment/97968533
downvote count: 0
score: 6
has comment: http://stackoverflow.com/comment/45506600
upvote count: 6
has comment: http://stackoverflow.com/comment/45506527
has body: Add error callback to your ajax request to find if an error is thrown, $.ajax({ type :"POST", url :"http://localhost/laravel/public/form-data", dataType:"json", data :{ data1:data }, success :function(response) { alert("thank u"); }, error: function(e) { console.log(e.responseText); } }); its better to use console.log() to see detailed information even if the response is a json string. Try the code and let us know if something is logged to the browser console
has comment: http://stackoverflow.com/comment/45506164

http://stackoverflow.com/q/28714419
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45719687
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45716788
has title: How to display text dynamically in svg
has answer: http://stackoverflow.com/a/28716463
answer count: 1
downvote count: 0
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
type: UnansweredQuestion
has body: I have written the below code. In the code where we append text to the text variable, function inside text is not getting called as the label is having the same name. However I want to change the text output on click of each button. Example: 1st on click of button '2004', in pie chart text is displayed as Roger Federer (45%) ,Marat Safin (32%) and 23%. (Keys- Roger Federer, Marat Safin, empty) second click on 2005 button, in pie chart, text is displayed as Marat Safin (32%), 23% and Lleyton Hewitt (34%). (Keys - Marat Safin, Lleyton Hewitt and empty) .. But i want it to display as Marat Safin (39%), Lleyton Hewitt (34%), 27% . Its not working according to logic as i wrote. Please help! 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014
has comment: http://stackoverflow.com/comment/45717151

http://stackoverflow.com/q/28605339
has title: Changing background-color of a button using 1 javascript
accepted answer: http://stackoverflow.com/a/28605425
answer count: 3
tagged with: http://stackoverflow.com/tag/html
upvote count: 1
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28605548
has answer: http://stackoverflow.com/a/28605789
has body: I want to change the background-color of my button. This is my code so far: &lt;script&gt; function setColor(btn) { var property = document.getElementById(btn); if (property.style.backgroundColor == "rgb(127, 255, 0)") { property.style.backgroundColor = "rgb(255, 0, 0)" } else if(property.style.backgroundColor == "rgb(255, 0, 0)") { property.style.backgroundColor = "" } else { property.style.backgroundColor = "rgb(127, 255, 0)" } } &lt;/script&gt; &lt;input type="button" id="button" value = "button" onclick="setColor('button')";/&gt; This works with one button. If I have multiple buttons it only change the first button color. How can I change the color of every button with this JavaScript?
has answer: http://stackoverflow.com/a/28605425
has answer: http://stackoverflow.com/a/28605548
type: Question
has comment: http://stackoverflow.com/comment/45515274
tagged with: button
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45515405
score: 1
favorite count: 0

http://stackoverflow.com/comment/45618169
comment on: http://stackoverflow.com/a/28661311
type: AnswerComment
score: 0
type: Comment
has text: Yeah, I specificed the `./` and the `require('fs')`. All it did was minify my json file. No error messages.

http://stackoverflow.com/comment/45599004
score: 1
type: AnswerComment
has text: Well, HTMLElement in javascript are actually host objects, not just javascript objects. I have heard some issues with arbitrarily attaching properties to them (including memory leak issues in IE). But, stringifying the objects and associating them with `dataset` or `data-` properties makes sense. Don't know why I didn't think of simply stringifying before.
type: Comment
comment on: http://stackoverflow.com/a/28650781

http://stackoverflow.com/a/28644408
has comment: http://stackoverflow.com/comment/45587295
type: Answer
score: 2
upvote count: 2
has body: // For deleting article row $(document).on('click','.delete-article',function() { var selectedRowForDeletion = $(this).closest(".dynamic-new-row"); selectedRowForDeletion.remove(); }); Where: .delete-article = class of the remove button/image .dynamic-new-row = class of every row in div/tr to be removed selectedRowForDeletion = object of the selected row to be removed Hope this helps.
downvote count: 0
answers question: http://stackoverflow.com/q/28631053

http://stackoverflow.com/q/28624263
answer count: 1
tagged with: prototypejs
has comment: http://stackoverflow.com/comment/45549794
tagged with: javascript
has comment: http://stackoverflow.com/comment/45549885
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45555696
has body: Hi is there a way with prototype to get the value of a variable defined in a script evaluated in an ajax call? As far as I can see ajax requests are made inside a setTimeout closure so the scope of the variable is limited inside there..but maybe I'm missing something! For example: External script: &lt;script&gt; var foo = "bar"; &lt;/script&gt; Ajax call: new Ajax.Request(external_script, { evalScripts: true, onComplete: function () { //some magic console.log(foo); } });
type: Question
tagged with: eval
has title: prototype get variable in evaluated ajax request
has answer: http://stackoverflow.com/a/28624435
score: 0
has comment: http://stackoverflow.com/comment/45555632

http://stackoverflow.com/q/28650746
has answer: http://stackoverflow.com/a/28650913
score: 0
has comment: http://stackoverflow.com/comment/45598937
answer count: 1
has title: Javascript for Previous and Next Buttons
type: UnansweredQuestion
has body: I am trying to write a function that will use a set of html pages named 1.html, 2.html, 3.html, 4.html, etc. with previous and next buttons on each page. Clicking a previous or next arrow button will take me to the next html page in my browser. So if I am on a page named "2.html" it will know that, and take me to "3.html" I see a lot of pagination scripts, but this is much simpler. I want to actually go to another html page. I had some code like this, but it's not working like I would expect-- can anyone help...? function nextPg(step) { var str = window.location.href; if(pNum = str.match(/(\d+)\.html/i)){ pNum = pNum[1] * 1 + step+''; if(pNum&gt;0){ pNum = "".substr(0, 4-pNum.length)+pNum; window.location = str.replace(/\d+\.html/i, pNum+'.html'); } } } &lt;a href="nextPg(+1)"&gt;Next Page &amp;raquo;&lt;/a&gt; I tried @void's suggestion and edited the code like this, but still having trouble getting it to work to load my next page called 'page2.html' $( "#target" ).keyup(function( event ) { function newDoc(){ var url = window.location.href; url = url.split('/').pop(); curr = +curr.replace("page","").replace(".html",""); window.location.href = "page"+ (curr+1) +".html"; } }) $( "#other").click(function() { $( "#target" ).keyup(); }); My button looks like this: &lt;button id="other"&gt;LOAD ANOTHER PAGE&lt;/button&gt;
type: Question
tagged with: jquery-pagination
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28627606
has title: Does adding too many event listeners affect performance?
accepted answer: http://stackoverflow.com/a/28627965
has comment: http://stackoverflow.com/comment/45556908
tagged with: onclicklistener
possible better answer: http://stackoverflow.com/a/67237528
has answer: http://stackoverflow.com/a/28627965
upvote count: 63
tagged with: actionlistener
type: AnsweredQuestion
has body: I have a general question about javascript (jQuery) events/listeners. Is there any limit for the number of click listener without getting performance problems?
downvote count: 0
has comment: http://stackoverflow.com/comment/45556050
has comment: http://stackoverflow.com/comment/99588546
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45555972
has answer: http://stackoverflow.com/a/67237528
tagged with: javascript
tagged with: jquery
favorite count: 0
score: 63
has comment: http://stackoverflow.com/comment/99614942
has comment: http://stackoverflow.com/comment/45556029
tagged with: events
has comment: http://stackoverflow.com/comment/45556393

http://stackoverflow.com/comment/45627197
type: QuestionComment
has text: Every time you click, It has to hit the server and return a response. You may want to leverage some sort of server side caching to speed this up. It's hard to provide specific help without trying it out and seeing the response time from the server.
type: Comment
comment on: http://stackoverflow.com/q/28666131
score: 0

http://stackoverflow.com/comment/45555389
comment on: http://stackoverflow.com/q/28624843
score: 1
type: Comment
type: QuestionComment
has text: As I'm aware, form submissions do have a duplicate problem, but only remember of mailApp ones. Share the `raw_answer_to_raw_obj` just to be sure. Also check [Issue 4752](https://code.google.com/p/google-apps-script-issues/issues/detail?id=4752).

http://stackoverflow.com/comment/45626795
comment on: http://stackoverflow.com/q/28666031
score: 0
type: Comment
type: QuestionComment
has text: Could you provide a fiddle with your code? (jsfiddle.net). It sounds like you may have mistaken `button` element with `input` element of /type/ `button`. Try replacing `$("button")` with `$("input[type=button]")` if that's the case.

http://stackoverflow.com/comment/45752630
score: 0
type: Comment
type: QuestionComment
has text: Where is that plugin "parsing" your string? Please link its code or documentation, otherwise we won't be able to help you.
comment on: http://stackoverflow.com/q/28733418

http://stackoverflow.com/comment/45742970
comment on: http://stackoverflow.com/q/28727460
type: QuestionComment
has text: The errors are on the call to setTimeout. They should be warningTimer = setTimeout(IdleWarning, timoutWarning); and timeoutTimer = setTimeout(IdleTimeout, timoutNow);
score: 0
type: Comment

http://stackoverflow.com/comment/45681551
type: AnswerComment
comment on: http://stackoverflow.com/a/28689028
type: Comment
has text: Thanks! That worked! Although the key was not grabbed off the S3 after the upload finishes, I guess that should be sufficient for my purposes.
score: 0

http://stackoverflow.com/a/28651001
has comment: http://stackoverflow.com/comment/114060036
has comment: http://stackoverflow.com/comment/45599606
has comment: http://stackoverflow.com/comment/45599887
has comment: http://stackoverflow.com/comment/45599626
upvote count: 35
type: AcceptedAnswer
downvote count: 0
score: 35
has comment: http://stackoverflow.com/comment/45599463
type: Answer
has comment: http://stackoverflow.com/comment/83839451
has comment: http://stackoverflow.com/comment/45599828
has comment: http://stackoverflow.com/comment/45612088
answers question: http://stackoverflow.com/q/28650804
has body: JavaScript is single threaded, which means that two pieces of JavaScript will not execute at the same time (unless using a worker, but each worker is also single-threaded). But JavaScript isn't the only thing at play when it comes to the environment's API's. Functions like setTimeout, setInterval and addEventListener are implemented natively (or, at-least, outside of the single-threaded JavaScript), and their callbacks are triggered by the environment, such as a browser. It is the environment that puts these callbacks onto the queue, to be executed by the single threaded JavaScript engine. This is how the browser is able to accept new click events to be fired, even though it is still executing some other JavaScript code. This is the reason JavaScript is considered event-driven.
accepted answer of: http://stackoverflow.com/q/28650804

http://stackoverflow.com/q/28598286
linked to: http://stackoverflow.com/q/5818303
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28598415
score: 3
has body: I am struggling with this since few hours now and hence posting here. I am trying to use find() operator in mongoose, to find whether a key matches any single element in the array, similar to How do I perform an id array query in Mongoose? but not getting expected results. Here is my schema, var a = new mongoose.Schema({ b : { type : mongoose.Schema.ObjectId, ref: 'B' }, }); var A = mongoose.model('A', a); now I have an array , arr[], which holds some possible object id's of class B. i.e arr = ["54e545fb6a0d90bb0772808b", "xxxxxxxxxxxxx", ...] I want to find all documents of type A, where the field b matches any of the elements in arr. Note that arr is an array of strings, but b holds ObjectId. So far I have tried, A.find({b : {$in: arr}}, callback); //and A.find({b : {$in: new ObjectId("54e545fb6a0d90bb0772808b")}}, callback); //manually got this one value from db var callback = function (err, data) { console.log("----------------------"); if (err) console.log(err); else { console.log(JSON.stringify(data, null, '\t')); } console.log("----------------------"); } Both of these does not seem to work. Thank you for the help.
favorite count: 0
type: Question
answer count: 1
tagged with: node.js
has title: Mongoosejs find on array of objectId
upvote count: 3
has answer: http://stackoverflow.com/a/28598415
tagged with: mongodb
downvote count: 0
tagged with: mongoose
tagged with: javascript

http://stackoverflow.com/a/28756348
has comment: http://stackoverflow.com/comment/45959775
type: Answer
score: 6
has comment: http://stackoverflow.com/comment/45953159
has comment: http://stackoverflow.com/comment/45814820
upvote count: 6
accepted answer of: http://stackoverflow.com/q/28749313
answers question: http://stackoverflow.com/q/28749313
has comment: http://stackoverflow.com/comment/45796610
has body: Technically, to do what you want, you do need to update the local store, in a way. dstore/RequestMemory is essentially a composition of dstore/Request and dstore/Cache, where a single fetch request is performed immediately and then the caching store fields all future fetch operations. In order to force the store to refresh from the server, you basically need to tell the store that its cache is no longer valid, then re-request all items from the server. This equates to the following: workersStore.invalidate(); // Invalidate the cache workersStore.fetch(); // Perform a new request for all items workerGrid.refresh(); Once that fetch is performed, the Cache store will understand that it can then pull all requests from its in-memory store. (The fetch call is important - if you don't call fetch above, your grid will probably not work as you expect. dgrid's OnDemandGrid and Pagination modules perform ranged queries using fetchRange, and unless Cache knows it has all of the store's data, it will simply let those pass through to the original store, which in this case is Request, which will try to hit the server - except your service is presumably not equipped to handle ranged queries, so it will just return the entire data set every time.) Admittedly, I'd argue this is more information than someone using RequestMemory should need to know, so I'm probably going to submit an issue for some sort of API for refreshing and/or updating target. The 3 lines of code above are the TL;DR though.
downvote count: 0
has comment: http://stackoverflow.com/comment/45980537
has comment: http://stackoverflow.com/comment/45986833
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/119362222

http://stackoverflow.com/comment/45666540
comment on: http://stackoverflow.com/q/28686935
score: 0
type: Comment
type: QuestionComment
has text: As I said, I'm trying to learn. But the above code does work. I just ran it in my web browser and it works fine. Anything you can tell me that should be in the code but isn't?

http://stackoverflow.com/comment/45518515
type: AnswerComment
has text: That's because chrome passes 'event' as a implicit param to your event function. Firefox and IE don't do that!
comment on: http://stackoverflow.com/a/28607161
type: Comment
score: 0

http://stackoverflow.com/comment/45713377
has text: I am using IE8 and am not finding any errors in console. It's clean.
type: AnswerComment
comment on: http://stackoverflow.com/a/28712692
score: 0
type: Comment

http://stackoverflow.com/a/28750019
upvote count: 1
has comment: http://stackoverflow.com/comment/45787551
has comment: http://stackoverflow.com/comment/45782819
has comment: http://stackoverflow.com/comment/45784612
has comment: http://stackoverflow.com/comment/45787803
type: AcceptedAnswer
downvote count: 0
has body: Let's break down what you want to do to a simple sentence: "When I show another item, I want to hide other items that may or may not be shown." So, let's remove the onmouseout that hides the elements and force a "reset" state that ensures all items are hidden whenever we show an item from our onmouseover. X Here's a working fiddle: http://jsfiddle.net/rgthree/63L72trx/12/
has comment: http://stackoverflow.com/comment/45786014
type: Answer
accepted answer of: http://stackoverflow.com/q/28749862
answers question: http://stackoverflow.com/q/28749862
score: 1

http://stackoverflow.com/q/28621465
has comment: http://stackoverflow.com/comment/45545343
has title: error Uncaught SyntaxError: Unexpected token <
favorite count: 0
has answer: http://stackoverflow.com/a/28623281
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
tagged with: php
score: 2
has comment: http://stackoverflow.com/comment/45547451
upvote count: 2
has comment: http://stackoverflow.com/comment/45545756
accepted answer: http://stackoverflow.com/a/28623281
type: AnsweredQuestion
has body: i want to create a form which has 2 dropdown, the second dropdown will be trigger by the first dropdown without reload the page, after the first dropdown selected/change, so i decide to use ajax instead trigger the second dropdown it is returning this error Uncaught SyntaxError: Unexpected token < add_product.php:1 error on above happen if i use google chrome and this the error when i use firefox with firebug Warning: mysqli_query() expects parameter 1 to be mysqli, null given in /opt/lampp/htdocs/portofolio1/dd-multiple.php on line 15 Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, null given in /opt/lampp/htdocs/portofolio1/dd-multiple.php on line 16 {"data":null} SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data script.js (line 34, col 26) this is script.js file function AjaxFunction(id1,id2) { alert(id1); var httpxml; try { // Firefox, Opera 8.0+, Safari httpxml=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { httpxml=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { httpxml=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } function stateck(){ if(httpxml.readyState===4) { var myarray = JSON.parse(httpxml.responseText); // Before adding new we must remove previously loaded elements for(j=document.getElementById(id2).length-1;j>=0;j--) { document.getElementById(id2).remove(j); } for (i=0;i<myarray.data.length;i++) { var optn = document.createElement("OPTION"); optn.text = myarray.data[i].subcategory; //optn.value = myarray.data[i].subcat_id; // You can change this to subcategory optn.value = myarray.data[i].subcategory; document.getElementById(id2).options.add(optn); } } } var str=''; var s1ar=document.getElementById(id1); for (i=0;i< s1ar.length;i++) { if(s1ar[i].selected){ str += s1ar[i].value + ','; } } //alert (s1ar); var str=str.slice(0,str.length -1); // remove the last coma from string //alert(str); ///// //alert(…
type: Question
has comment: http://stackoverflow.com/comment/45545199
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45547462
tagged with: javascript
has comment: http://stackoverflow.com/comment/45547075
tagged with: jquery

http://stackoverflow.com/q/28743424
score: 2
answer count: 0
downvote count: 0
type: Question
tagged with: javascript
tagged with: jquery
upvote count: 2
has body: I would like to make a Div Container, where a user can add Boxes (also divs) wich can be dragged arround, but don't overlap. So i started with the container: &lt;div id="image_container"&gt;&lt;/div&gt; I want to change the images afterwards. So The width is always given, for example 800px, but the hight should be auto. I tried following: div#image_container{ position: relative; background: url('http://www.locationscout.net/public/images/2015-02/externsteine-germany_l.jpeg'); width: 400px; background-size: contain; background-repeat: no-repeat; height: auto; } But couldn't get a result. How would you do that? Since the whole app will not work without JavaScript, i could adjust the hight with that. What do you think about that? So if the image loads, fire the function wich does that. After the container is done, the user should be able to add boxes into it. He should be able to input the height and width and add up to 4 boxes, not more. But the size should be adjustable via a slider and stay relative to all other boxer. So... If there are 2 Boxes, one 400x400 and the other 200x100, he could adjust the sizes with the slider for example to, 200x200/100x50, 800x800/400x100 but even smaller steps like 480x480/240x120. That could be done with this slider: &lt;input type="range" min="0" value="0" max="100" step="1"&gt; How would you do that? I would give the formats via a Then the boxes should be added into the container and they're draggable, but don't overlap. Something like this but better code. The one i wrote is just bad. The JS is done with a plugin and isn't efficient. What could you recommend? Greetings c144
favorite count: 0
tagged with: drag-and-drop
type: UnansweredQuestion
has title: Image Container Drag'N'Drop no overlap
tagged with: css

http://stackoverflow.com/a/28729455
type: Answer
has comment: http://stackoverflow.com/comment/45745654
score: 3
answers question: http://stackoverflow.com/q/28729124
has comment: http://stackoverflow.com/comment/45747057
downvote count: 0
has comment: http://stackoverflow.com/comment/45746486
upvote count: 3
has body: You can use Ctrl+K, the "hippie" code completion. It directly completes some matching result and if the completed item is not what you wanted, you can keep pressing Ctrl+K to get another autocompleted item (will replace the previously inserted one). Another thing, you can press Ctrl+Space 2 times to get "full" code completion (meaning pretty much everything from other objects/variables) Update: There is another way using JSDoc, but it works only in Dev build of NetBeans and will be part of the next 8.1 release (you can download Dev builds from here): /** * @typedef libraryName * @property {Function} showSomething description * @property {someProp} foo description */ /** * @typedef someProp * @property {Date} day description * @property {Number} num description */ /** * @typedef libraryName.someProp2 * @property {Date} day description * @property {Number} num description */ This way you'd have to create this "documentation" for your library and have it somewhere in JS file in your project (perhaps non-minified JS file of your library). With this @typedef feature, you can learn code completion pretty much anything even if it is not even in your code). Of course there are some issues yet to be fixed (it is a Dev build)...

http://stackoverflow.com/comment/45759743
type: Comment
score: 1
has text: Thank you to everyone who helped. It now works!! (but of course, you all knew it would after the amendments) :)
comment on: http://stackoverflow.com/a/28698747
type: AnswerComment

http://stackoverflow.com/comment/45674175
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28690991
has text: @DarrenSweeney Yes it is. It just keeps all the dropdown menu's in the table so the table isn't in the function itself.
score: 0

http://stackoverflow.com/comment/45611646
score: 0
comment on: http://stackoverflow.com/a/28657333
type: AnswerComment
type: Comment
has text: I'm not sure yet, what do you exactly expect from this code?

http://stackoverflow.com/a/28702932
score: 2
accepted answer of: http://stackoverflow.com/q/28702884
downvote count: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28702884
has body: Javascript uses plus signs for concatenation, not periods. Assuming field is a string like currencyFrom, replace _id : '$' . field, with _id : '$' + field,
upvote count: 2
type: Answer

http://stackoverflow.com/comment/45674084
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28678832
has text: Ok there was a problem with the JSON when i tryed to put only the URL in source, but now I re-tryed and it's working, thank you all ;)

http://stackoverflow.com/comment/45595965
has text: @eComEvo Could you try: `jQuery(document).on('submit.template', 'form#template', function(e){...});`? As a side note, IDs must be unique on document context, just saying it in case of...
type: Comment
comment on: http://stackoverflow.com/q/28648906
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45601425
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28652112
has text: You can't directly change `.live()` to `.on()`. You have to change the structure of the arguments when doing so because `.on()` takes different arguments.
score: 0

http://stackoverflow.com/comment/45517171
score: 0
has text: BTW, regarding the code: I see you use `jQuery`. Why not use `$(...)` instead of `getElementById`?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28605964

http://stackoverflow.com/a/28667204
score: 0
answers question: http://stackoverflow.com/q/28663986
type: Answer
has body: Perhaps your SELECT is missing the WHERE clause: $sql = "SELECT ... WHERE country_name LIKE CONCAT('$prefix', '%') ORDER BY ..."; (Note that I changed to double quotes so I could 'interpolate' $prefix.)

http://stackoverflow.com/q/28670514
has body: The following code defines two functions, lines and circles, that return a function, f and g respectively. Functions f and g are equal (() -&gt; size) only for simplicity, but in general they are different functions of the variable size. lines = () -&gt; size = 10 # default value f = () -&gt; size f.size = (_) -&gt; size = _ f f circles = () -&gt; size = 15 # default value g = () -&gt; size g.size = (_) -&gt; size = _ g g On the console, the above code results on the following pattern, which is what I need: &gt; lines()() # 10 &gt; lines().size(20)() # 20 &gt; circles()() # 15 &gt; circles().size(30)() #30 As you may note, the f.size and g.size methods are closures and they are the same on both lines and circles. Then my question is: how I can avoid to duplicate the code for the size method? (with coffeescript or javascript) I tried different solutions, but I did not find the right way. In order to replicate the closure, the size variable inside the size method should refer to the size variable defined at the first line on lines (and the same holds for circles).
possible better answer: http://stackoverflow.com/a/28670779
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28670779
tagged with: coffeescript
type: Question
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45635122
score: 0
has title: Closures and CoffeeScript's Scoping
has answer: http://stackoverflow.com/a/28670872
accepted answer: http://stackoverflow.com/a/28670872

http://stackoverflow.com/comment/45685751
has text: @Dr.Molle: yes, if its not stupid :|
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28696910

http://stackoverflow.com/a/28643891
has comment: http://stackoverflow.com/comment/45585937
upvote count: 3
has comment: http://stackoverflow.com/comment/45585930
score: 3
accepted answer of: http://stackoverflow.com/q/28643860
has body: I think you had an issue with your quotations. Here's a revised version of your JS: $('#edit-username').click(function() { var text = $('.text-info-username').text(); var input = $(' '); $('.text-info-username').text('').append(input); $('#edit-username').remove(); $('Update').appendTo('.controls-username'); $(' ').insertAfter('.controls-username'); }); Also a jsFiddle: http://jsfiddle.net/qhcf39oo/
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28643860
type: Answer

http://stackoverflow.com/a/28688124
has body: In order to transition you will want to have one state ready, then trigger to another state. That means you must, at one point, have both states rendered so one can transition into the other. Then, if you want, you can remove it. Here's your code modified so when we hit "next" or "previous" we add another p child to our container and, when we have more than two children, add a roll class to the container. That CSS class has a transition on it to animate our children upwards so the second element (which was under and hidden) is now visible and our first one does upwards to be hidden. Once that transition is done, we remove that first child that is now hidden and remove our classname. We are now back at our "zero state" with our new child. var theArray = ["1","2","3","4","5"]; var dancefloor = document.getElementById("dancefloor"); var prev = document.getElementById("prev"); var next = document.getElementById("next"); var current = 0; // When the transition is done, we want to remove the first // child, remove the roll class and re-eneable our buttons dancefloor.addEventListener('transitionend', function(e) { dancefloor.removeChild(dancefloor.children[0]); prev.disabled = false; next.disabled = false; dancefloor.classList.remove('roll'); }, false); function justDance(x) { var el = document.createElement('p'); el.innerText = theArray[x]; dancefloor.appendChild(el); // When we have more than one child, we want to "roll" // Simply add the classname and let the CSS do the work. // We also want to disable our buttons until the // animation is done. if (dancefloor.children.length === 2) { prev.disabled = true; next.disabled = true; setTimeout(function() { dancefloor.classList.add('roll'); }, 0); } } function nextNum() { current++; if (current === theArray.length) { current = 0; } justDance(current); } function prevNum() { current--; if (current < 0) { current = theArray.length - 1; } justDance(current); } justDance(current); body {background:#F0F0F0; text-align:center;} #da…
has comment: http://stackoverflow.com/comment/45669769
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28687739
type: Answer
accepted answer of: http://stackoverflow.com/q/28687739
downvote count: 0
score: 1

http://stackoverflow.com/a/28597998
answers question: http://stackoverflow.com/q/28597882
has comment: http://stackoverflow.com/comment/45534657
has comment: http://stackoverflow.com/comment/45502643
score: 0
has comment: http://stackoverflow.com/comment/45518274
type: Answer
has body: You can block cross domain origins for resources using the "Same Origin Policy" This means that any resources that do not originate on your server will not be loaded. https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy http://www.w3.org/TR/cors/#access-control-allow-origin-response-header

http://stackoverflow.com/q/28657313
accepted answer: http://stackoverflow.com/a/28657451
has answer: http://stackoverflow.com/a/28657451
type: AnsweredQuestion
score: 1
has body: I have truble finding a specific slider gallery for my website. Here is a pic of how my gallery should look like: This should be like width:100% and go trought the whole width of the page. Does anyone know for such a slider gallery I can donwload and add to my website? Best regards.
type: Question
upvote count: 2
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
tagged with: css
has title: Specific slider gallery for website

http://stackoverflow.com/q/28687568
has comment: http://stackoverflow.com/comment/45667570
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45667561
score: 0
has comment: http://stackoverflow.com/comment/45667489
has comment: http://stackoverflow.com/comment/45667584
type: Question
has comment: http://stackoverflow.com/comment/45667522
has comment: http://stackoverflow.com/comment/45667507
has answer: http://stackoverflow.com/a/28687668
has comment: http://stackoverflow.com/comment/45667590
has answer: http://stackoverflow.com/a/28687617
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45667717
has comment: http://stackoverflow.com/comment/45667548
possible better answer: http://stackoverflow.com/a/28687668
answer count: 2
accepted answer: http://stackoverflow.com/a/28687617
favorite count: 0
has comment: http://stackoverflow.com/comment/45667493
has comment: http://stackoverflow.com/comment/45667650
has comment: http://stackoverflow.com/comment/45667506
has comment: http://stackoverflow.com/comment/45667533
has comment: http://stackoverflow.com/comment/45667519
upvote count: 2
has body: I have the following js function. function showAttentionItem(sender) { debugger; var assistanceRequired = sender.parent().hasClass("assistanceRequired"); if (assistanceRequired) { sender.children('.assistanceRequiredText').fadeToggle(0); if (sender.children('.assistanceRequiredText').is(":visible")) { sender.children('.studentPerformanceText').hide(); } } if (!assistanceRequired) { if (sender.parent().hasClass("studentOutsideTargetRange")) { sender.children('.studentPerformanceText').fadeToggle(0); } } } What happens when I run it is, I hit the debugger line, and step through the code. assistanceRequired is true. After executing sender.children('.studentPerformanceText').hide();, the next line it jumps to is sender.children('.studentPerformanceText').fadeToggle(0);, inside the if (!assistanceRequired) statement! How could this possibly be happening?
downvote count: 2
has comment: http://stackoverflow.com/comment/45667479
has title: Javascript appears to be saying true == false

http://stackoverflow.com/q/28596309
tagged with: http://stackoverflow.com/tag/html
tagged with: python
accepted answer: http://stackoverflow.com/a/28596498
type: AnsweredQuestion
tagged with: web-scraping
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28596489
tagged with: javascript
tagged with: web-crawler
has answer: http://stackoverflow.com/a/28596498
answer count: 3
has title: Programmatically download text that doesn't appear in the page source
has body: I'm writing a crawler in Python. Given a single web page, I extract it's Html content in the following manner: import urllib2 response = urllib2.urlopen('http://www.example.com/') html = response.read() But some text components don't appear in the Html page source, for example in this page (redirected to the index, please access one of the dates and view a specific mail) if you view page source you will see that the mail text doesn't appear in the source but seems to be loaded by JS. How can I programmatically download this text?
downvote count: 0
linked to: http://stackoverflow.com/q/6183276
score: 1
linked to: http://stackoverflow.com/q/27942322
linked to: http://stackoverflow.com/q/5738024
favorite count: 0
possible better answer: http://stackoverflow.com/a/28596527
has answer: http://stackoverflow.com/a/28596527

http://stackoverflow.com/a/28617391
score: 2
accepted answer of: http://stackoverflow.com/q/28593992
downvote count: 0
has body: It looks like you are not loading your files in order in Karma. Inside of you karma.conf.js there should be a file list. Load the app module then the rest of your javascript. Here is a post that had the same problem. For Example: files: [ 'bower_components/angular/angular.js', 'bower_components/angular-mocks/angular-mocks.js', 'bower_components/angular-animate/angular-animate.js', 'app/**/*.module.js', // Loads all files with .module.js 'app/**/*.js', // Load the rest of your .js angular files 'test/**/*.js' // Load your tests ],
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45547405
type: Answer
answers question: http://stackoverflow.com/q/28593992

canvas
tags question: http://stackoverflow.com/q/28665007
tags question: http://stackoverflow.com/q/28600289
tags question: http://stackoverflow.com/q/28659585
tags question: http://stackoverflow.com/q/28607473
tags question: http://stackoverflow.com/q/28605076
tags question: http://stackoverflow.com/q/28721281
tags question: http://stackoverflow.com/q/28636262
tags question: http://stackoverflow.com/q/28745785
tags question: http://stackoverflow.com/q/28689578
tags question: http://stackoverflow.com/q/28749712
tags question: http://stackoverflow.com/q/28744682
tags question: http://stackoverflow.com/q/28740918
tags question: http://stackoverflow.com/q/28598047
tags question: http://stackoverflow.com/q/28712926
tags question: http://stackoverflow.com/q/28689194
tags question: http://stackoverflow.com/q/28726450
tags question: http://stackoverflow.com/q/28715140
tags question: http://stackoverflow.com/q/28623797
tags question: http://stackoverflow.com/q/28628964
tags question: http://stackoverflow.com/q/28684237
tags question: http://stackoverflow.com/q/28710100
tags question: http://stackoverflow.com/q/28607748
tags question: http://stackoverflow.com/q/28698991
tags question: http://stackoverflow.com/q/28723568
tags question: http://stackoverflow.com/q/28748638
tags question: http://stackoverflow.com/q/28727883
tags question: http://stackoverflow.com/q/28649851
tags question: http://stackoverflow.com/q/28668581
tags question: http://stackoverflow.com/q/28739065
tags question: http://stackoverflow.com/q/28600999
tags question: http://stackoverflow.com/q/28727125
tags question: http://stackoverflow.com/q/28607434
tags question: http://stackoverflow.com/q/28717129
tags question: http://stackoverflow.com/q/28732233
tags question: http://stackoverflow.com/q/28698441
tags question: http://stackoverflow.com/q/28593763
tags question: http://stackoverflow.com/q/28742399
tags question: http://stackoverflow.com/q/28706989
tag name: canvas
tags question: http://stackoverflow.com/q/28658211
tags question: http://stackoverflow.com/q/28693119
tags question: http://stackoverflow.com/q/28709406
tags question: http://stackoverflow.com/q/28711286
tags question: http://stackoverflow.com/q/28666623
tags question: http://stackoverflow.com/q/28632831
tags question: http://stackoverflow.com/q/28708798
tags question: http://stackoverflow.com/q/28713838
type: Tag
tags question: http://stackoverflow.com/q/28693000
tags question: http://stackoverflow.com/q/28639155
tags question: http://stackoverflow.com/q/28742744
tags question: http://stackoverflow.com/q/28715125
tags question: http://stackoverflow.com/q/28749033
tags question: http://stackoverflow.com/q/28647844
tags question: http://stackoverflow.com/q/28709089
tags question: http://stackoverflow.com/q/28650342
tags question: http://stackoverflow.com/q/28617989
tags question: http://stackoverflow.com/q/28679591
tags question: http://stackoverflow.com/q/28641160
tags question: http://stackoverflow.com/q/28671932
tags question: http://stackoverflow.com/q/28676311
tags question: http://stackoverflow.com/q/28731423
tags question: http://stackoverflow.com/q/28744690
tags question: http://stackoverflow.com/q/28716353
tags question: http://stackoverflow.com/q/28622129
tags question: http://stackoverflow.com/q/28699621
tags question: http://stackoverflow.com/q/28678986
tags question: http://stackoverflow.com/q/28601673
tags question: http://stackoverflow.com/q/28628220
tags question: http://stackoverflow.com/q/28646716
tags question: http://stackoverflow.com/q/28700575
tags question: http://stackoverflow.com/q/28684457
tags question: http://stackoverflow.com/q/28732612
tags question: http://stackoverflow.com/q/28745477
tags question: http://stackoverflow.com/q/28719923

http://stackoverflow.com/a/28611731
has body: Shooting from the hip here, but it looks like there are a couple problems with the snippet. Dom elements don't natively support the "on" method. You'll need to use a library selector to get "on" support (ie jQuery, etc) You need to specify the unit type to increase/decrease font size. See snippet with suggested edits (untested, but the spirit of the edits are evident) &lt;select id="MySelect"&gt; ... &lt;/select&gt; &lt;div class="containerDiv"&gt; &lt;span id="MyText"&gt;&lt;/span&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; var autoAdjust = { init:function(){ var eObject = $("#MySelect"); // jQuery selector (using ID) eObject.on( "change", autoAdjust.task ); }, task:function(){ var divWidth = $(".containerDiv").width(); // jQuery selector (using class) var text = $("#MyText"); // jQuery selector (using ID) var fontSize = 16; while (text.width() &gt; divWidth){ text.css("font-size", (fontSize -= 0.5) + "px"); // specify units } } } autoAdjust.init(); &lt;/script&gt;
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28611011
upvote count: 1
type: Answer

http://stackoverflow.com/comment/45604047
score: 0
has text: Clearly, the problem is that there exists an `i` between `0` and `getUsersCount` (inclusive) such that `getUsers.data[i]` is `undefined`.
comment on: http://stackoverflow.com/q/28653495
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28706392
type: Answer
downvote count: 2
has comment: http://stackoverflow.com/comment/45702587
has comment: http://stackoverflow.com/comment/45702829
has body: You can't set a JavaScript Date object to an invalid date. Nevertheless you may want to check if a date is invalid.
upvote count: 0
score: -2
answers question: http://stackoverflow.com/q/28705902

http://stackoverflow.com/comment/45555391
type: AnswerComment
comment on: http://stackoverflow.com/a/28627265
score: 0
type: Comment
has text: `window.onbeforeunload = function () { alert(result); // This will happen before leaving the page return false; }` I've tried with alert() before `return false;` as my thinking, but it doesn't work.

http://stackoverflow.com/comment/45644920
type: Comment
type: QuestionComment
has text: progrAmmar, as mentioned before, the company I'm working for prohibits the use of internal asp.net mvc BeginForm and Ajajx.BeginForm in the View. They want it totally decoupled from the View in a separate JS file using an Ajax call for every GET/POST.
comment on: http://stackoverflow.com/q/28664050
score: 0

http://stackoverflow.com/comment/45725456
type: Comment
has text: Hi, can you post a sample code so it easy to understand what exactly you want to do and what you are currently doing.
score: 0
comment on: http://stackoverflow.com/q/28719193
type: QuestionComment

http://stackoverflow.com/comment/45567668
comment on: http://stackoverflow.com/q/28633814
score: 0
has text: well theres ajax everywhere, I don't want the same functionality to run on every ajax call
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45502607
type: Comment
has text: Example `var log = console.log;` is invalid, it won’t work. You must call it like `log.call(console, ...)`, or use `var log = console.log.bind(console);`
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28598015

http://stackoverflow.com/comment/45818751
type: QuestionComment
comment on: http://stackoverflow.com/q/28692888
has text: Hey, I just saw your comment... :) I've created a repo for you with the whole example working: https://github.com/andrusieczko/radiobutton-example.git
score: 0
type: Comment

http://stackoverflow.com/comment/45637858
comment on: http://stackoverflow.com/a/28670730
type: Comment
has text: It's ok, happy to help you .
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45525142
comment on: http://stackoverflow.com/q/28609134
score: 0
type: Comment
type: QuestionComment
has text: whenever someone tries to autopost, a fairy dies...what you are trying to do is most likely not allowed. each and every single post must be approved by the user and the message parameter must be unique and 100% user generated.

flux
tags question: http://stackoverflow.com/q/28738403
tag name: flux
tags question: http://stackoverflow.com/q/28659419
type: Tag

http://stackoverflow.com/q/28684040
has comment: http://stackoverflow.com/comment/45661909
tagged with: javascript
has title: How to iframe a page from same domain with X-Frame-Options SAMEORIGIN?
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/35956869
has comment: http://stackoverflow.com/comment/45661854
has comment: http://stackoverflow.com/comment/45694778
score: 1
tagged with: iframe
upvote count: 1
has body: We have this page, www.ourdomain.com/home.html Inside home.html, there is an iframe with src set to yyy.ourdomain.com/index.html. All pages on yyy.ourdomain.com have X-Frame-Options set to SAMEORIGIN. And because of this header, the iframe content doesn't load. I get this error. Firefox - Load denied by X-Frame-Options: http://yyy.ourdomain.com/index.html does not permit cross-origin framing. Chrome - Refused to display 'http://yyy.ourdomain.com/index.html' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'. Both home.html and index.html have this line of javascript code - document.domain = 'ourdomain.com'; How can I make this work? PS - I don't have the option of removing the X-Frame-Options header. Thanks.
type: Question
has comment: http://stackoverflow.com/comment/45664325

http://stackoverflow.com/q/28745398
has body: I am learning d3 by coding a force directed graph from basics. My code is below.What I don’t understand is the purpose of force.on('tick'... Surely if we are using a in-built class for the layout I would have thought that it is enough to give d3.layout.force() your nodes and links and it should be able to draw the graph in a balanced layout. If I comment out the section force.on('tick'... then all my circles and lines end up in the top left hand corner. Is there are difference between what is happening internally and what is happening in the svg container hence we need the force.on('tick' to redraw the layout to match the current set of internal values each time? var nodes = [ {}, {}, {} ]; var links = [ {'source': 0, 'target': 1} ]; // append svg element to container var mychart = d3.select('#chart') .append('svg') .attr('width', w) .attr('height', h); // create force layout in memory var force = d3.layout.force() .nodes(nodes) .links(links) .size([w, h]); // append a group for each data element var node = mychart.selectAll('circle') .data(nodes).enter() .append('g') .call(force.drag); // append circle onto each 'g' node node.append('circle') .attr('fill', palette.green) .attr('r', circleWidth); /*force.on('tick', function(e) { node.attr('transform', function(d, i) { return 'translate('+ d.x +', '+ d.y +')'; }) link .attr('x1', function(d) { return d.source.x }) .attr('y1', function(d) { return d.source.y }) .attr('x2', function(d) { return d.target.x }) .attr('y2', function(d) { return d.target.y }) });*/ var link = mychart.selectAll('line') .data(links).enter() .append('line') .attr('stroke', palette.gray) force.start();
has title: Why do we need force.on('tick'.. in d3
type: Question
has answer: http://stackoverflow.com/a/28745519
type: AnsweredQuestion
upvote count: 22
answer count: 1
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28745519
score: 22
favorite count: 0
tagged with: d3.js

http://stackoverflow.com/q/28692521
score: 0
tagged with: arrays
tagged with: javascript
tagged with: multidimensional-array
has title: dynamic array build in JS
answer count: 0
has comment: http://stackoverflow.com/comment/45720794
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45720775
type: Question
has comment: http://stackoverflow.com/comment/45720895
has comment: http://stackoverflow.com/comment/45676161
has body: Input: Comp1| Comp2 Item A | HD A Item A | HD B Item A | HD C HD A | HD AA HD A | HD AB HD AA | HD AAAA HD AA | HD AAAB HD AB | HD ABAB Desired Output: Item A | HD A | HD AA | HD AAAA Item A | HD A | HD AA | HD AAAB Item A | HD A | HD AB | HD AAAB desired outcome is to create an array dynamically in JS so that the input structure can be further flattened and all the occurances (dependencies) of the any element are collected in single row.
has comment: http://stackoverflow.com/comment/45720869
has comment: http://stackoverflow.com/comment/45677634

http://stackoverflow.com/a/28668172
type: AcceptedAnswer
downvote count: 0
has body: You query doesn't pull any item because you are missing o in placeId value. &gt; db.users.update( {"_id":ObjectId("54e664c4e7c3b4d3b5413e39")}, {$pull:{ItemsToDelete : {placeId:"ChIJIQBpAG2ahYAR_6128GcTUE"}}}, ^ { multi: true } ) Should be &gt; db.users.update( {"_id":ObjectId("54e664c4e7c3b4d3b5413e39")}, {$pull:{ItemsToDelete : {placeId:"ChIJIQBpAG2ahYAR_6128GcTUEo"}}}, { multi: true } ) WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 }) &gt; db.users.find().pretty() { "_id" : ObjectId("54eac8d51a0c74438c9dea10"), "ItemsToDelete" : [ ] }
type: Answer
answers question: http://stackoverflow.com/q/28663273
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28663273

http://stackoverflow.com/a/28602210
has comment: http://stackoverflow.com/comment/45510313
has comment: http://stackoverflow.com/comment/45510013
answers question: http://stackoverflow.com/q/28601631
score: 0
has comment: http://stackoverflow.com/comment/45510449
type: Answer
has body: Try Using ID it will work document.getElementsById('coordinates').innerHTML = "text"
has comment: http://stackoverflow.com/comment/45509907

http://stackoverflow.com/comment/45745550
comment on: http://stackoverflow.com/q/28683940
has text: Is it possible this is coming from your server, resetting the application pool? I've not experienced this myself, but I do know that SignalR will not keep that connection alive (in terms of resetting the app-pool reset timeout). I think by default a session state is 20 mins (?) and app pool is 90 minutes? I can't remember exactly. I guess - maybe look to what the server is doing. Is the app pool being refreshed, giving everyone all new connections?
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/45683288
type: Comment
type: QuestionComment
has text: Now i want to add message "Waiting" when after click submit button, hide it when show result messages. What must i do?. Tks
comment on: http://stackoverflow.com/q/28694443
score: 0

http://stackoverflow.com/comment/45565315
has text: Your application js - are you sure it is not coffee? it should be `//=` rather than `#=`
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28632568

http://stackoverflow.com/comment/45859254
comment on: http://stackoverflow.com/a/28700853
has text: Sorry for my late reply. Your explanation makes a lot of sense. Thanks for your answer.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45543678
type: Comment
comment on: http://stackoverflow.com/q/28620520
type: QuestionComment
has text: actually looking at it, all I need I think is to split the property on any comma that is not inside brackets, all I need is an array of the background images...
score: 0

http://stackoverflow.com/a/28619459
has comment: http://stackoverflow.com/comment/45541710
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28619193
accepted answer of: http://stackoverflow.com/q/28619193
has body: If you are OK with the results being returned in a new array, then .filter() is pretty easy: var names = ["Tom", "James", "Matthew", "Jordy", "Jeremy", "Jasper", "Jordy"]; names = names.filter(function(item) { return item !== "Jordy"; }); If you want to modify the current array, you can use .splice() with a backwards traverse. var names = ["Tom", "James", "Matthew", "Jordy", "Jeremy", "Jasper", "Jordy"]; for (var i = names.length - 1; i &gt;= 0; i--) { if (names[i] === "Jordy") { names.splice(i, 1); } }
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/a/33568057
upvote count: 2
type: Answer
score: 2
downvote count: 0
has body: I created a script manually using some owl properties, make the creation of a function to create the carousel, it takes the individual height of each element, and arrow for the element of each item. With this we can adjust the height of the carousel at any resolution. In your case, you would do the following: $(".owl-carousel").owlCarousel({ items: 1, loop: true, afterAction : afterAction }); function afterAction() { var elem = this.owl.owlItems; var index = this.owl.visibleItems; var height = elem.eq(index).height(); //.owl-wrapper is the element that we are high. elem.parents('.owl-wrapper, .owl-carousel').css('height', height); } I hope this helps!
answers question: http://stackoverflow.com/q/28621433

http://stackoverflow.com/comment/45535311
comment on: http://stackoverflow.com/q/28615768
score: 0
type: Comment
type: QuestionComment
has text: Not quite sure what you are asking..have you just tried using the load() method ? Eg http://svg.dabbles.info/snaptut-load-animate rereading, is the svg inline you mean ? If so, you can just var el = Snap('#idbar-menu-button') and use el.doSomething()

http://stackoverflow.com/comment/45501719
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28597626
has text: Interesting, thanks. I've learnt something new, I can use the unary + operator to cast to a number.
type: Comment

http://stackoverflow.com/a/28594542
has body: Here's a useful logical test for all such questions: If you didn't pass a callback to a function or receive a function as the return value from the function, and you expect to do something with the result, then that function must be "blocking" as in not-async because if it was asyncronous then it's not clear where the result should be placed.
type: Answer
answers question: http://stackoverflow.com/q/28594502
score: 0

http://stackoverflow.com/comment/45819081
type: Comment
score: 0
has text: This works great. I was kinda on the right path. Just missing the field instance. Appreciate the help.
type: AnswerComment
comment on: http://stackoverflow.com/a/28769009

http://stackoverflow.com/comment/45648745
comment on: http://stackoverflow.com/q/28676091
type: Comment
score: 0
has text: @Donte'Trumble Weird, it still doesn't work for me.
type: QuestionComment

http://stackoverflow.com/comment/45703884
comment on: http://stackoverflow.com/a/28705288
has text: @ErikE [This SO question](http://stackoverflow.com/q/4912586/359284) might be a useful read. Let's pull up a chat room if there is going to be further discussion, so we don't clutter these comments.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28706129
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28706088
has body: You need to change the jQuery code like this: $(document).ready(function(){ var eventChoice = $('#test'), prodInterest = $('#productInterest'); eventChoice.change(function(){ var str = ""; $('#test option:selected').each(function(){ str += "Channel &amp; TR Event Reg - " + $(this).text(); }); prodInterest.val( str ); }); }); Notice the removal of change() after the binding which caused it to trigger the change right after the binding was done. Code version when selected option is blank: $(document).ready(function(){ var eventChoice = $('#test'), prodInterest = $('#productInterest'); eventChoice.change(function(){ var str = ""; $('#test option:selected').each(function(){ if ($(this).val() != "") { str += "Channel &amp; TR Event Reg - " + $(this).text(); } }); prodInterest.val( str ); }); });
has comment: http://stackoverflow.com/comment/45701875
upvote count: 1
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/45701935
accepted answer of: http://stackoverflow.com/q/28706088

http://stackoverflow.com/a/31623459
upvote count: 22
has body: @Michael is right on the money: the module.directive() method expects a factory function However I solved it using another technique, a little cleaner I suppose, It works fine for me, it's not perfect though... I defined a static method that returns a the factory expected by module() class VineDirective { constructor($q) { this.restrict = 'AE'; this.$q = $q; } link(scope, element, attributes) { console.log("directive link"); } static directiveFactory($q){ VineDirective.instance = new VineDirective($q); return VineDirective.instance; } } VineDirective.directiveFactory.$inject = ['$q']; export { VineDirective } And in my app I do: angular.module('vineyard',[]).directive('vineScroller', VineDirective.directiveFactory) I believe there's no other way to use classes + directives that going through hacks like this at this point, just pick the easy one ;-)
downvote count: 0
answers question: http://stackoverflow.com/q/28620479
has comment: http://stackoverflow.com/comment/66210373
type: Answer
has comment: http://stackoverflow.com/comment/68314486
score: 22

http://stackoverflow.com/comment/45591831
has text: @MUG4N - thanks - i've posted this as an answer
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28645314

http://stackoverflow.com/q/28618091
has comment: http://stackoverflow.com/comment/45540212
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45539528
type: UnansweredQuestion
has title: menu key triggers mousedown event listener
has comment: http://stackoverflow.com/comment/45540031
tagged with: mousedown
answer count: 0
has comment: http://stackoverflow.com/comment/45539444
type: Question
has body: I've been working on my custom event listeners, when I faced this issue. When I press the menu key , the mousedown event triggers on page position offsetX: 1 offsetY: 1 , and the context menu appears on that position. BTW this is not my problem, because if I prevent the default contextmenu event, the mousedown event still triggers. Here is my code: $(window).load(function(){ $('.entry').on('mousedown',function(){ console.log('mousedown triggered'); }); }); I can't get rid of this strange behavior, even if I use native javascript methods. Every suggestion or help would be appreciated!

http://stackoverflow.com/q/28671536
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28671571
type: UnansweredQuestion
has body: i just get the function back and no calculation , what's wrong? I can't figure this out yet.. this is so annoying &lt;script type="text/javascript"&gt; function Human(age, name, lastname) { this.age = age; this.name = name; this.lastname = lastname; this.born = born; } function born() { var currentyear = 2015; var born = this.age - currentyear; return born; } var asaf = new Human(16,"Asaf","shlush"); var daniel = new Human(19 , "Daniel" , "Bivas"); document.write(asaf.born);
downvote count: 2
has answer: http://stackoverflow.com/a/28671623
has title: Javascript code, didn't figure out what's wrong
has comment: http://stackoverflow.com/comment/45636751
has answer: http://stackoverflow.com/a/28671624
type: Question
upvote count: 0
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45636784
has comment: http://stackoverflow.com/comment/45637741
has answer: http://stackoverflow.com/a/28671849
favorite count: 0
has answer: http://stackoverflow.com/a/28671650
answer count: 5

http://stackoverflow.com/a/28688583
score: 1
upvote count: 1
downvote count: 0
has body: prev is a method of a jQuery object. HTMLElement object has no prev method. For selecting the previous element sibling you can use the previousElementSibling property.
type: Answer
answers question: http://stackoverflow.com/q/28688468

http://stackoverflow.com/comment/45774564
comment on: http://stackoverflow.com/a/28722633
score: 0
type: AnswerComment
has text: Any number... Are you trying to create some thing like [this](http://www.w3schools.com/bootstrap/bootstrap_carousel.asp)?
type: Comment

http://stackoverflow.com/comment/45750984
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28732438
has text: I just realized and updated https://jsfiddle.net/RicardoAlves/sghvyyr0/23/
score: 0

http://stackoverflow.com/a/28634035
score: 3
has comment: http://stackoverflow.com/comment/45616464
upvote count: 3
answers question: http://stackoverflow.com/q/28633187
has comment: http://stackoverflow.com/comment/45627295
type: Answer
downvote count: 0
has body: Your approach on the client results in a lot more round trips between the server and the browser. I know you indicated that you were worried about spaghetti code on the server and I don't have visibility into your application as you do, but just going by the example you provide, it seems like an ideal place to wrap all three calls on the server and make only one call from the client, IMHO.

http://stackoverflow.com/comment/45562969
type: Comment
comment on: http://stackoverflow.com/a/28631462
has text: When you mention "Http/1.1 tried this", are you referring to the Keep-Alive header?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45603505
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28653103
has text: You have a typo in your first `else if`: `cur_lv < newsount` should be `cur_lv < newscount`

http://stackoverflow.com/q/28705866
upvote count: 7
has answer: http://stackoverflow.com/a/28705976
type: Question
has answer: http://stackoverflow.com/a/28706103
has answer: http://stackoverflow.com/a/40039026
score: 7
downvote count: 0
tagged with: javascript
has body: Let's say I have a file called server.js: //server.js var net = require('net'); var server = net.createServer(function (socket){ socket.on('data',function(data){ console.log("Received: "+data); }); }); And another file called functions.js: //functions.js module.exports = { test: function () { // do something }, other: function () { // do something } }; I know I can do something like this: var functions = require('./functions'); functions.test(); But I really wanted to be able to use the function directly, like this: require('./functions'); test(); Any suggestions?
favorite count: 0
accepted answer: http://stackoverflow.com/a/28706103
answer count: 3
tagged with: node.js
type: AnsweredQuestion
has title: NodeJS - Import functions from other file and use as if it had them before?
possible better answer: http://stackoverflow.com/a/28705976

http://stackoverflow.com/a/28612050
score: 1
accepted answer of: http://stackoverflow.com/q/28607411
answers question: http://stackoverflow.com/q/28607411
type: AcceptedAnswer
downvote count: 0
has body: It is a "PRO" method. If you haven't it - this method will not work
upvote count: 1
type: Answer

http://stackoverflow.com/comment/45575963
type: Comment
has text: Here is an example of an input wich start with de focus on it, but once you click it, it looses the focus. [link](https://jsfiddle.net/dade3007/g4mnta70/1/)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28624786

http://stackoverflow.com/q/28666238
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/45627234
answer count: 2
has body: I have a function (below) that, when the DOM loads it finds every select input and adds an attribute data-prev that keeps track of what the previous selected value was in the event the value is changed. $( document ).ready(function() { //For each select field, add a data-prev attribute set for tracking the previous value for when it gets changed $('select').each(function(){ $(this).attr("data-prev", $(this).val()) }); } Now, my page includes select fields that get created dynamically (after the page loads) for which I also need to set the data-prev attribute. So, I was thinking it would make sense for me to generalize the function above into something like function SetDataPrevAttr(element=None) if element is None: for each select field in DOM set the attribute data-prev to its current value else: for each select field in the descendant elements of element (including element) set the attribute data-prev to its current value How would I do this?
accepted answer: http://stackoverflow.com/a/28666304
has title: How do I generalize this function using JQuery
has answer: http://stackoverflow.com/a/28666304
has comment: http://stackoverflow.com/comment/45627281
has comment: http://stackoverflow.com/comment/45627257
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28666307
type: Question
has answer: http://stackoverflow.com/a/28666307

http://stackoverflow.com/a/28645336
has comment: http://stackoverflow.com/comment/45589806
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28645064
answers question: http://stackoverflow.com/q/28645064
type: Answer
has body: Try this... Click to open link in new window Account Master New Modify Delete View

http://stackoverflow.com/a/28632726
accepted answer of: http://stackoverflow.com/q/28632512
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45574836
has comment: http://stackoverflow.com/comment/45565613
has body: You can use a pseudo-element on the background-image div to "underly" the SVG. /* ======================================== Background animation ========================================= */ .container { background: #242424; } @-webkit-keyframes fade-in { 0% { opacity: 0; } 100% { opacity: 1; } } .background-image { position: relative; } .background-image::before { content:""; position: absolute; top:0; left:0; height: 100%; width: 100%; background: #ff7701; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; opacity: 0; -webkit-animation-name: fade-in; -webkit-animation-duration: 2s; -webkit-animation-timing-function:ease-in; -webkit-animation-iteration-count: 1; -webkit-animation-delay: 1s; -webkit-animation-fill-mode: forwards; z-index:0; } .background-image.visible { opacity: 1; } svg { position: relative; z-index:2; } /* ======================================== SVG line animation ========================================= */ .path1 { stroke-dasharray: 1100; stroke-dashoffset: 1000; -webkit-animation: dash 2.6s ease-in-out 1 forwards; -moz-animation: dash 2.6s ease-in-out 1 forwards; -o-animation: dash 2.6s ease-in-out 1 forwards; -ms-animation: dash 2.6s ease-in-out 1 forwards; animation: dash 2.6s ease-in-out 1 forwards; } @-webkit-keyframes dash { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } } @-moz-keyframes dash { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } } @-o-keyframes dash { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } } @-ms-keyframes dash { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } } @keyframes dash { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } } .path { stroke-dasharray: 1000; stroke-dashoffset: 1000; -webkit-animation: dash 7s linear 1 forwards; -moz-animation: dash 7s linear 1 forwards; -o-animation: dash 7s linear 1 forwards; -ms-animation: dash 7s linear 1 forwards; animation: dash 7s linear 1 fo…
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45565483
has comment: http://stackoverflow.com/comment/45565773
downvote count: 0
has comment: http://stackoverflow.com/comment/45575259
answers question: http://stackoverflow.com/q/28632512

http://stackoverflow.com/comment/45682073
has text: each line of your _JQuery_ code (better known as javascript) has an error, my advice for you is to get a couple hours to read some docs
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/28695593

http://stackoverflow.com/comment/45631308
type: AnswerComment
comment on: http://stackoverflow.com/a/28668298
type: Comment
has text: this will again fail, if a user has a different timzezone set in their system... try to change the timezone of your system and try
score: 0

http://stackoverflow.com/comment/45618760
type: QuestionComment
has text: then how will it add another object then?
type: Comment
comment on: http://stackoverflow.com/q/28661776
score: 0

http://stackoverflow.com/q/28750295
has answer: http://stackoverflow.com/a/28760550
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: ms-access
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28760550
score: 2
has title: Convert microsoft access form into a html?
upvote count: 2
type: Question
type: AnsweredQuestion
has body: I have a microsoft access form which I have to recreate using html.I'm new to access database and I have a access form UI which I need to redesign.

http://stackoverflow.com/a/28706035
upvote count: 0
has body: I tried your demo link and in submit.php you are storing data(i am guessing) and displaying msg Thank you for contacting us. We will get back to you within 24 hours. Go Back Instead of this msg redirect page to demo4.html using php function. header('Location: '.demo4.html); If you upload submit.php i will give more details.
type: Answer
has comment: http://stackoverflow.com/comment/45702114
downvote count: 1
answers question: http://stackoverflow.com/q/28705795
score: -1

http://stackoverflow.com/comment/84831604
type: AnswerComment
score: 0
has text: But, if I have 5 events in my day view , 5 events in my month view and eventLimit as 2 for my month configuration, then I get +8 more in my month view which is invalid. Because, I have only 5 events in my month view so it should display +3 more instead of +8 more...
type: Comment
comment on: http://stackoverflow.com/a/40225604

http://stackoverflow.com/comment/45499071
comment on: http://stackoverflow.com/q/28596169
score: 0
type: QuestionComment
type: Comment
has text: umm... how is this being displayed?

http://stackoverflow.com/comment/101234951
type: Comment
comment on: http://stackoverflow.com/a/28625477
has text: I think rather running *filter and map* it is good to run only one iteration.
type: AnswerComment
score: 0

http://stackoverflow.com/a/28717693
has body: why dont you wrap them all in a onPageChanged function and call that on document ready, and in the success handler from ajax calls
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28717609
has comment: http://stackoverflow.com/comment/45723139

http://stackoverflow.com/a/28600992
has comment: http://stackoverflow.com/comment/45507947
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45509804
answers question: http://stackoverflow.com/q/28600503
upvote count: 1
has body: if (!_.isEmpty(items)) { var timerId = getTimeInterval(); function getTimeInterval() { return setInterval(function () { route.getPath().push(new google.maps.LatLng(items[index].lat, items[index].lng)); moveMarker(map, marker, items[index].lat, items[index].lng); markLAT = items[index].lat; markLNG = items[index].lng; index++; if (index == items.length) { clearInterval(timerId); } }, (1000 - $scope.speedSlider)); } $scope.$watch('speedSlider', function(ssss) { clearInterval(timerId); timerId = getTimeInterval(); }); } Plunker
score: 1

http://stackoverflow.com/a/28603257
score: 7
answers question: http://stackoverflow.com/q/28603179
downvote count: 0
type: AcceptedAnswer
has body: You don't have to use jquery to implement this CSS is much suitable for that job. try this. /*tri color rows*/ table.dataTable tbody tr:nth-child(3n+1) {background-color: #FFCCCC;} table.dataTable tbody tr:nth-child(3n+2) {background-color: #99D6AD;} table.dataTable tbody tr:nth-child(3n) {background-color: #EBD6FF;} th { background: #aaf; } thead{ background: #aaf; } /* End: tri color rows*/ check this Demo in js fiddle
has comment: http://stackoverflow.com/comment/45511496
type: Answer
upvote count: 7
accepted answer of: http://stackoverflow.com/q/28603179

http://stackoverflow.com/q/28675404
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has body: I am new to angular and I have been trying to make a pretty advanced directive. Most of the directive works, but there are two issues presenting themselves currently and I think they are both related to the scope. Here is my directive: angular.module('test') .directive('testKitDesigner', function () { panels = []; function bindEvents() { console.log("bindingEvents"); var styledElements = ["piping", "panel-1", "panel-2", "panel-3", "panel-4", "panel-5", "panel-6", "panel-7", "panel-8", "panel-9", "panel-10"]; for (var i = 0; i < styledElements.length; i++) { var target = document.getElementById(styledElements[i]); console.log(target); if (target) { bindEvent(target); } } }; function bindEvent(target) { console.log(target); target.bindEvent("ngClick", selectPanel); }; function selectPanel(event) { var path = angular.element(event.target); panels = []; // Reset if (attrs.testKitDesigner && attrs.testKitDesigner === 'advanced') { panels.push(path); } else { var parent = path.parent(); var paths = parent.children(); for (var i = 0; i < paths.length; i++) { var current = angular.element(paths[i]); var tag = current[0].nodeName; if (tag === 'path' || tag === 'polyline') { panels.push(current); } } console.log(panels.length); } }; return { restrict: 'A', templateUrl: 'Views/Templates/designer.html', link: function (scope, element, attrs) { scope.step = 0; scope.sport = 'General'; scope.garment = 'Dress'; scope.design = 'Angelus'; scope.nextStep = function () { scope.step++; }; scope.setSport = function (sport) { scope.sport = sport; scope.setSvg(); scope.nextStep(); }; scope.setGarment = function (garment) { scope.garment = garment; scope.setSvg(); scope.nextStep(); }; scope.setDesign = function (design) { scope.design = design; scope.setSvg(); scope.nextStep(); }; scope.setSvg = function () { var children = element.children(); var template = scope.sport + '/' + scope.garment + '/' + scope.design; for (var i = 0; i < children.length; i++) { var child = angular.element(child…
upvote count: 1
has answer: http://stackoverflow.com/a/28688475
score: 1
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
has title: angularjs and scope issues (I think)

http://stackoverflow.com/comment/45563764
type: Comment
type: QuestionComment
has text: Possible duplicate: http://stackoverflow.com/questions/6677035/jquery-scroll-to-element
score: 1
comment on: http://stackoverflow.com/q/28631820

http://stackoverflow.com/q/28715351
tagged with: jquery
has comment: http://stackoverflow.com/comment/45980284
favorite count: 0
score: 13
has comment: http://stackoverflow.com/comment/45997715
type: Question
has comment: http://stackoverflow.com/comment/46015414
tagged with: css
upvote count: 13
has comment: http://stackoverflow.com/comment/45805166
has comment: http://stackoverflow.com/comment/46015693
tagged with: http://stackoverflow.com/tag/svg
has comment: http://stackoverflow.com/comment/45805033
has answer: http://stackoverflow.com/a/28763350
answer count: 1
has comment: http://stackoverflow.com/comment/46009216
has comment: http://stackoverflow.com/comment/46009206
tagged with: chartist.js
has comment: http://stackoverflow.com/comment/45804589
has title: Add outline to SVG data point in chartist.js
tagged with: javascript
has comment: http://stackoverflow.com/comment/45980454
has comment: http://stackoverflow.com/comment/45804414
has body: I'm playing around with Chartist.js and just wondering if you can give me a hand applying some styling to the SVG. Here is my code as follows: jQuery: new Chartist.Line('.ct-chart', { labels: [1, 2, 3, 4, 5, 6, 7, 8], series: [ [5, 9, 7, 8, 5, 3, 5, 4] ] }, { low: 0, showArea: true }); HTML: &lt;div class="ct-chart ct-perfect-fourth"&gt;&lt;/div&gt; CSS: .ct-chart .ct-series.ct-series-a .ct-area { fill: orange; } .ct-chart .ct-series.ct-series-a .ct-line { stroke: orange; } .ct-chart .ct-series.ct-series-a .ct-point { stroke: orange; } body { background: #203135; } I'm just trying to simulate what they have on this awesome design i found on dribbble where each data point has an outline of a darker shade/similar shade to the background. I have tried using outline in CSS, but it produces a square of black (or whatever colour i choose) around the data point, and i can't work out how to get it rounded And finally, here is what i have already in a jsFiddle - http://jsfiddle.net/andyjh07/gLnkwLj0/
has comment: http://stackoverflow.com/comment/45980389
has comment: http://stackoverflow.com/comment/45804799
accepted answer: http://stackoverflow.com/a/28763350
has comment: http://stackoverflow.com/comment/45804854
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45980713
downvote count: 0

http://stackoverflow.com/comment/45776020
comment on: http://stackoverflow.com/q/28746758
type: Comment
has text: Not very clear what real data looks like, that isn't an array you've shown. Is data an array or object literal? Post valid data sample that is actually being used. Even better would be create a demo that replicates problem
type: QuestionComment
score: 0

http://stackoverflow.com/q/28687831
score: 0
duplicate of: http://stackoverflow.com/q/592396
answer count: 1
has body: I cannot think of the term that JavaScript developers use for this kind of practice. var someSome = (function () { ... } ()); -- Wrapping function within brackets. I vaguely remember someone was calling this fiif? fiff? And there were many advantages and it was recommended java scripting practice. Anyone got clue what I am talking about and why is it a good practice? it might have been even without assignment like below (function () { ... } ());
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/592396
has comment: http://stackoverflow.com/comment/45667980
type: Question
has answer: http://stackoverflow.com/a/28687854
tagged with: javascript
has title: var someSome = (function () { ... } ()); a weird javascript asking?
has comment: http://stackoverflow.com/comment/45668006

http://stackoverflow.com/q/28607977
score: 2
has comment: http://stackoverflow.com/comment/45520170
type: AnsweredQuestion
downvote count: 0
type: Question
has title: Does HTML tag name has a max size ( length )
tagged with: tags
tagged with: javascript
has comment: http://stackoverflow.com/comment/45520110
tagged with: w3c-validation
upvote count: 2
accepted answer: http://stackoverflow.com/a/28608355
has body: i do want to build a validator for HTML tagname , vdAPI.get({module:'html',subject:'tag'}).validator=function (tag){ return !vdAPI.nottags.contains(tag) &amp;&amp; (tag.length&gt;0 &amp;&amp; tag.length &lt;= vdAPI.MAX_LENGTH_TAG) } What is the suitable value of vdAPI.MAX_LENGTH_TAG ?
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28608355

http://stackoverflow.com/a/28695035
accepted answer of: http://stackoverflow.com/q/28694897
answers question: http://stackoverflow.com/q/28694897
score: 1
has comment: http://stackoverflow.com/comment/45680958
has comment: http://stackoverflow.com/comment/45714746
has comment: http://stackoverflow.com/comment/45715086
has comment: http://stackoverflow.com/comment/45716008
upvote count: 1
type: AcceptedAnswer
has body: You have to register to the page.onConsoleMessage event to see the console.log() from the page context printed to the console, because the page context (inside page.evaluate()) is sandboxed and those events are not automatically shown. page.onConsoleMessage = function(msg, lineNum, sourceId) { console.log('CONSOLE: ' + msg + ' (from line #' + lineNum + ' in "' + sourceId + '")'); }; Register to the event before the call to page.evaluate() which contains the console.log() that you're interested in. Most of the time this should be done after initializing the global variables: var page = require('webpage').create(); page.onConsoleMessage = function(msg) { console.log('remote&gt; ' + msg); }; page.open("https://www.example.com/", function(){ console.log("Page is opened successfully"); page.evaluate(function(){ console.log('This is page evaluating!'); }); phantom.exit(); }); Other helpful events are: onResourceError, onError and onResourceError.
downvote count: 0
has comment: http://stackoverflow.com/comment/45681204
has comment: http://stackoverflow.com/comment/45719967
has comment: http://stackoverflow.com/comment/45715047
type: Answer

http://stackoverflow.com/comment/45704148
score: 0
type: Comment
has text: Not sure I know what you mean. When I look at the POST response using Firebug it shows that the alert is there, but it is not displaying on the page.
comment on: http://stackoverflow.com/a/28706501
type: AnswerComment

http://stackoverflow.com/q/28682452
tagged with: php
has comment: http://stackoverflow.com/comment/45657873
tagged with: object
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28682839
has title: Get json value from string containing key path
possible better answer: http://stackoverflow.com/a/28682538
type: Question
has body: I have an input array, with path like var path = ["foo","bar","baz"]; And I have an object var obj = { "foo": { "bar": { "baz": "cake" }, "notbar": { "another": "value" } } } And i want to change the "baz" value from the path. I know i can use obj[path[0]][path[1]][path[2]] = "value"; but i dont know how long the array will be. both php and javascript anwsers are appreciated!
has answer: http://stackoverflow.com/a/28682850
accepted answer: http://stackoverflow.com/a/28682850
downvote count: 0
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/28682538
linked to: http://stackoverflow.com/q/27929875
answer count: 3
duplicate of: http://stackoverflow.com/q/13719593
upvote count: 4
has comment: http://stackoverflow.com/comment/45658251
favorite count: 0
linked to: http://stackoverflow.com/q/13719593

http://stackoverflow.com/comment/45743142
type: Comment
score: 3
has text: Or simply `{ c: C, r: R }`.
type: AnswerComment
comment on: http://stackoverflow.com/a/28728334

http://stackoverflow.com/a/28650744
has body: I came up with this... (though in this you need to change the id #inputLname to #inputSurname) var all = $("#inputFname, #inputLname, #inputEmail, #inputPhone"); all.on('blur change', function() { var self = this, fnName = validate+self.attr("id").replace("input",""); self.window[fnName](self); }); And even window[] is pretty quick..
answers question: http://stackoverflow.com/q/28650683
score: 0
type: Answer

http://stackoverflow.com/q/28733813
tagged with: javascript
tagged with: drop-down-menu
possible better answer: http://stackoverflow.com/a/28734053
tagged with: jquery
has answer: http://stackoverflow.com/a/28734053
accepted answer: http://stackoverflow.com/a/28734058
tagged with: onchange
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to generate a dynamic dropdown on a mouse over event over an object. I accomplished it like so, canvas.on('mouse:move', function (e) { $('body').append(" wipro Hcl krystal kones "); }); This functionality works fine. But there is an issue in my next requirement where I need to capture the selected item when the user selectes an item from the drop down. I know its a long shot but I tried it by having onchange='copy();' in the drop down and alerting out the selection made like so, function copy(){ alert(document.getElementById("imageDialog").value); } But as expected it gave the error Uncaught ReferenceError: copy is not defined. I was at this for some time and had no luck whatsoever and I would really appreciate any help from you experts regarding this. Thanks.
type: AnsweredQuestion
has title: Get return value from html dropdown appended from html.append
has answer: http://stackoverflow.com/a/28734058
score: 0
type: Question
answer count: 2

http://stackoverflow.com/comment/45757390
type: QuestionComment
type: Comment
has text: can you show us your ` ` statement
comment on: http://stackoverflow.com/q/28736512
score: 0

http://stackoverflow.com/comment/45770784
type: QuestionComment
comment on: http://stackoverflow.com/q/28744017
score: 0
has text: @dowomenfart: thanks... but you see the extra white space at the end?? I want the textarea to be only to the size of its text.
type: Comment

http://stackoverflow.com/comment/64287034
score: 0
comment on: http://stackoverflow.com/q/28635716
type: Comment
type: QuestionComment
has text: How do you call otherMethod ?

http://stackoverflow.com/comment/45550720
comment on: http://stackoverflow.com/q/28624816
score: 0
has text: I have some html code in php heredoc
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28649900
score: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28648083
upvote count: 1
answers question: http://stackoverflow.com/q/28648083
has body: The Mozilla folks did a great blog post on the Anatomy of a JavaScript Object. In short (and in case the link ever stops working), Firefox uses three data structures to track an object's properties. The first is the object's array of values. Anything you store in a property gets added to this array. Since it's an array, the JavaScript engine isn't allocating small bits of memory off the heap every time an element is added. It's faster this way &amp; doesn't fragment RAM. The second is the object's "object map", which maps keys to JSScopeProperty objects. Because the map is a linked list under the hood, with the most recently added property at the head, the JavaScript engine can iterate through the list from tail to head and get all the properties in the order they were inserted. JSScopeProperty objects remember the property value's index in the array, as well as other metadata related to the property. That's how JavaScript links property names to their values. Having two separate data structures like this saves on dynamic memory allocation (which kills performance) and gives the JavaScript engine opportunities to save memory by pointing multiple JSScopeProperty instances to the same value in memory or even re-using the entire object map if two objects have identical properties.

http://stackoverflow.com/a/28688712
type: AcceptedAnswer
has body: If you want the Primary and Secondary weapons to change in each click, you have call Random method inside the CreateWeapons method. Also it is not good way to use href to call js function, you can use onclick instead of that. Here is the updated working code for you. function Random(arr) { return arr[Math.floor(Math.random() * arr.length)]; } function CreateWeapons() { var Primary = Random(["M16A4", "M16A3", "M416", "None"]); var Secondary = Random(["None",".44 Deagle"]); document.getElementById('text').innerHTML = ('&lt;a href="#" onclick="CreateWeapons();return false;"&gt;' + 'Primary: ' + Primary + '&lt;br&gt;' + 'Secondary: ' + Secondary + '&lt;/a&gt;'); } CreateWeapons(); // BF4 weapon chooser (using random values)
has comment: http://stackoverflow.com/comment/45669715
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28688557
has comment: http://stackoverflow.com/comment/45669567
answers question: http://stackoverflow.com/q/28688557
has comment: http://stackoverflow.com/comment/45669517
upvote count: 1

http://stackoverflow.com/q/28698295
favorite count: 0
upvote count: 2
type: UnansweredQuestion
answer count: 0
has title: JQuery. Method to find closest common parent node of two jquery objects
tagged with: dom
type: Question
has body: Is there any solution to find closest common parent node of 2..N jquery obects? window.__node_1 = $('some-selector'); window.__node_2 = $('some-other-selector'); //.. window.__node_[N] = $('some-other-N-selector'); How to find it using window.__node_1 and window.__node_2 How to find it using [window.__node_1 .. window.__node_N]
score: 2
linked to: http://stackoverflow.com/q/3960843
downvote count: 0
tagged with: javascript
tagged with: jquery
duplicate of: http://stackoverflow.com/q/3960843

http://stackoverflow.com/comment/45690346
has text: Ah, damnit! that's it. Is it just me though, or is the Chrome App documentation terrible for explaining anything? ha!
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28699971

http://stackoverflow.com/a/28639135
score: 1
upvote count: 1
has body: The button problem You want to disable and enable the submit button so you know you going to touch the same kind of function and object twice, it is better to make advantage out of this in a function function disableSubmit(form, enabled){ var submit = form.find("input[type=submit]"), dataVar = enabled !== true ? "processing-message" : "send-message", message = submit.data(dataVar); submit.prop('disabled', (enabled !== true) ); submit.val(message); } I could make it even more generic for using it on each form. But the message in the button will display whatever you put in the data-attribute. Cancel Submit There is a problem with cancellation of an onbeforeunload event; there is no callback for it. The solution I came with is using a timeout. Since you don't know if the person canceled or not, I think 2 seconds is enough for the page to submit. You have to have 2 seconds patient to get the submit button enabled again. But you can adjust it all you want of course if (e.stopPropagation) { setTimeout(function () { disableSubmit(formObject, true); }, 2000); e.stopPropagation(); e.preventDefault(); } The JSFiddle example
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28637389
type: Answer
answers question: http://stackoverflow.com/q/28637389

http://stackoverflow.com/comment/45767070
type: AnswerComment
has text: The only best solution I see for this (as I have seen on many sites) that when same user tries to login from different location, they are given warning that same credentials are being used to login from a different location and if you want to continue then same user from other location will be logged out, and hence once accepted you can easily log user out from other session.
type: Comment
comment on: http://stackoverflow.com/a/28723196
score: 0

http://stackoverflow.com/q/28635612
accepted answer: http://stackoverflow.com/a/28635723
has comment: http://stackoverflow.com/comment/45571087
has answer: http://stackoverflow.com/a/28635723
possible better answer: http://stackoverflow.com/a/28635682
has comment: http://stackoverflow.com/comment/45571085
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45571215
type: Question
answer count: 2
has body: I am trying to make function which accepts 7 digit code (at minimum) and then loads images/elements of character thus creating a character from code. I wrote this code: &lt;script type="text/javascript"&gt; var skins = []; skins["w"] = "http://example.com/char_elements/base.png"; var eyes = []; eyes["b"] = "http://example.com/char_elements/eyes/blue.png"; eyes["g"] = "http://example.com/char_elements/eyes/green.png"; eyes["r"] = "http://example.com/char_elements/eyes/red.png"; var hair = []; hair["b"] = "http://example.com/char_elements/hair/black.png"; hair["w"] = "http://example.com/char_elements/hair/blond.png"; hair["s"] = "http://example.com/char_elements/hair/brown.png"; var mouth = []; mouth["h"] = "http://example.com/char_elements/mouth/happy.png"; var pants = []; pants["s"] = "http://example.com/char_elements/pants/shorts.png"; var shoes = []; shoes["b"] = "http://example.com/char_elements/shoes/black.png"; var torso = []; torso["s"] = "http://example.com/char_elements/torso/shirt.png" function LoadChar(code){ var data = code.split(/(?=[a-z])/i); var skins = [skins[data[0]], eyes[data[1]], hair[data[2]], mouth[data[3]], pants[data[4]], shoes[data[5]], torso[data[6]]]; document.getElementById("out").innerHTML = skins.toString(); } &lt;/script&gt; &lt;div id="out"&gt;&lt;/div&gt; However, when I call LoadChar("wgbhsbs"); It thorws me "Cannot read property 'w' of undefined" I am still new to Arrays in JS, so I am sure I am making some simple Syntax error or doing something a bit wrong. So what this does is: 1) Accepts code and splits it into 7 elements (always 7, nothing else) stores it in "data" variable as array. 2) Builds "skins" array by loading: skin[number from code] and same for other elements. 3) For testing purposes I am trying to output skins array, but it stops at step 2. Is there any explanation to this?
has title: JavaScript: Accessing ArrayElement by index of other Array Element? array[array[0]] returns undefined
tagged with: arrays
has comment: http://stackoverflow.com/comment/45571233
tagged with: javascript
has answer: http://stackoverflow.com/a/28635682
score: 0

http://stackoverflow.com/q/28619740
accepted answer: http://stackoverflow.com/a/28619763
has comment: http://stackoverflow.com/comment/45561299
tagged with: javascript
tagged with: web
tagged with: jquery
has comment: http://stackoverflow.com/comment/45543076
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/45543297
has comment: http://stackoverflow.com/comment/45543062
has comment: http://stackoverflow.com/comment/45543048
has answer: http://stackoverflow.com/a/28619763
has comment: http://stackoverflow.com/comment/45542320
upvote count: 0
possible better answer: http://stackoverflow.com/a/28619777
has comment: http://stackoverflow.com/comment/45544011
has comment: http://stackoverflow.com/comment/45543114
has comment: http://stackoverflow.com/comment/45562223
downvote count: 2
has title: Ajax not being called
has comment: http://stackoverflow.com/comment/45542195
type: Question
has comment: http://stackoverflow.com/comment/45542368
has comment: http://stackoverflow.com/comment/45542174
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45542990
has comment: http://stackoverflow.com/comment/45562097
has comment: http://stackoverflow.com/comment/45561415
has comment: http://stackoverflow.com/comment/45544105
has body: I wrote a little form in HTML with three textboxes. The idea is to create a "Contact me" form that is going to use the information submitted, by NodeMailer. However, my ajax function is not being called. To be more specific, the info is not being sent to "/time" where the NodeMailer is. Any "pointers" Thanks in advance! Heres my JS file: $(document).ready(function(){ $("#send").click(function(e){ var name = $('input#name').val(); var email = $('input#email').val(); var message = $('textarea#message').val(); $.ajax({ url: "/time", type: "POST", dataType: 'json', data: { name: name, email: email, message: message }, 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;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"); } }) }); });
answer count: 2
has answer: http://stackoverflow.com/a/28619777
score: -2

http://stackoverflow.com/q/28615799
upvote count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has body: I am trying to convert the code below: to this code: but I get "Error loading player: No playable sources found" can anyone try it and give me the solution thanks.
has answer: http://stackoverflow.com/a/28639483
has title: jwplayer convert to javascript
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28616301
accepted answer: http://stackoverflow.com/a/28616301
type: Question
possible better answer: http://stackoverflow.com/a/28639483
score: 1
tagged with: jwplayer
answer count: 2

properties
tags question: http://stackoverflow.com/q/28635934
tags question: http://stackoverflow.com/q/28724425
type: Tag
tag name: properties
tags question: http://stackoverflow.com/q/28658701
tags question: http://stackoverflow.com/q/28676313
tags question: http://stackoverflow.com/q/28618640

http://stackoverflow.com/q/28597994
answer count: 2
score: 5
has comment: http://stackoverflow.com/comment/45504368
upvote count: 5
tagged with: javascript
has comment: http://stackoverflow.com/comment/45504299
tagged with: jquery
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/30486269
has body: While I was creating a theme for WordPress and reached the menu editing I see the menu doesn't work, so after checking the console log, I notice that foundation.min.js have an issue with Unexpected end of script What can cause this type of error: Unexpected end of script I read where it say because your missing a }); ending, but that is not my case, since i re-upload the foundation.min.js This problem is interfering with another aspect of foundation as well, here are the other error also come up in the console log. ReferenceError: Can't find variable: Foundation TypeError: undefined is not a function (evaluating 'jQuery(document).foundation()') This problem also started when I start using Cloudfront by AWS (but I doubt this can be the problem) Image of the errors: Foundation 5 Line of Error Image:
tagged with: amazon-cloudfront
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29461558
tagged with: zurb-foundation-5
has comment: http://stackoverflow.com/comment/45508007
has comment: http://stackoverflow.com/comment/46040028
has comment: http://stackoverflow.com/comment/45507031
tagged with: wordpress
has title: Foundation 5: Unexpected end of script
has comment: http://stackoverflow.com/comment/45506647
type: Question

http://stackoverflow.com/a/28652983
type: Answer
upvote count: 1
score: 1
has body: I'd use a separate object to define the order and _.sortBy for something like this. For example: // Map the strings to something that is easy to sort. var theRightOrder = { 'News': 0, 'Articles': 1, 'Case Studies': 2, 'Nice Exhibit Case Studies': 3, 'Events': 4 }; var sorted = _(SearchAggregationDetails).sortBy(function(o) { return theRightOrder[o.FilterText]; }); I'm assuming that SearchAggregationDetails is an array of Objects. Demo: https://jsfiddle.net/ambiguous/x5q153gp/
downvote count: 0
answers question: http://stackoverflow.com/q/28651878

http://stackoverflow.com/a/28670458
type: Answer
has body: You can use Javascripts localStorage Objects. Your values get stored in the Browser for as long as you wish, or the browser is deleted. Take a look at w3cschools explaination and further information on Web Storage: The localStorage Object The localStorage object stores the data with no expiration date. The data will not be deleted when the browser is closed, and will be available the next day, week, or year. Example: // Store localStorage.setItem("lastname", "Smith"); // Retrieve document.getElementById("result").innerHTML = localStorage.getItem("lastname");
score: 0
answers question: http://stackoverflow.com/q/28669303

http://stackoverflow.com/q/28688483
has comment: http://stackoverflow.com/comment/45669991
has comment: http://stackoverflow.com/comment/45669796
favorite count: 0
has comment: http://stackoverflow.com/comment/45669829
tagged with: angularjs
upvote count: 2
has comment: http://stackoverflow.com/comment/45669836
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45670617
score: 2
has comment: http://stackoverflow.com/comment/45669095
has body: I"m following the Angular Tutorials and I see in their example that ng-scope is added to each element with a directive. https://docs.angularjs.org/guide/scope But my own code does NOT add the ng-scope for each directive, every thing seems to work from rendering the data, but for some reason this CSS class is not added. My Application has started life from a Yeoman.io starter project so I'm not sure if something in that project has caused the issue. https://github.com/diegonetto/generator-ionic Ive added the www code as a .zip in my dropbox: https://www.dropbox.com/s/hn36080isu83vw5/www.zip Tutorial Example My Example HTML Scope Heirachy Hello {{name}}! {{name}} from {{department}} Controller.JS var moduleTest = angular.module('test', []); moduleTest .controller('ParentGreetController', ['$scope', '$rootScope', function ($scope, $rootScope) { $scope.name = 'World'; $rootScope.department = 'Angular'; }]) // We will access name which is in both scopes .controller('ChildListController', ['$scope', function ($scope) { $scope.names = ['Igor', 'Misko', 'Vojta']; }]); App.JS // Ionic Starter App // angular.module is a global place for creating, registering and retrieving Angular modules // 'starter' is the name of this angular module example (also set in a attribute in index.html) // the 2nd parameter is an array of 'requires' // 'starter.controllers' is found in controllers.js angular.module('starter', ['ionic', 'starter.controllers', 'invoice1', 'invoice2', 'invoice3', 'test', 'myService']) .run(function ($ionicPlatform) { $ionicPlatform.ready(function () { // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard // for form inputs) if (window.cordova && window.cordova.plugins.Keyboard) { cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); } if (window.StatusBar) { // org.apache.cordova.statusbar required StatusBar.styleDefault(); } }); }) .config(function ($stateProvider, $urlRouterProvider) { $stateProvider .state('app', { url:…
has comment: http://stackoverflow.com/comment/45669186
tagged with: angularjs-scope
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28690557
has answer: http://stackoverflow.com/a/28688594
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45669862
has title: AngularJS class ng-scope is not being added

http://stackoverflow.com/comment/45609369
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28656483
has text: I have made this in my fiddel and then posted.

http://stackoverflow.com/a/28709550
has comment: http://stackoverflow.com/comment/45708467
has body: You can get the textual content of an element easily with jQuery: var textToSpeak = $('div.article').text(); Then set the onclick function dynamically: Talk It is better than using pure JavaScript and innerHTML property, as potential HTML tags will be stripped with this solution.
has comment: http://stackoverflow.com/comment/45708333
accepted answer of: http://stackoverflow.com/q/28709460
answers question: http://stackoverflow.com/q/28709460
score: 0
has comment: http://stackoverflow.com/comment/45708240
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/28612676
possible better answer: http://stackoverflow.com/a/28613836
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45530742
has body: I have div that can be added and removed to the DOM if the user deleted it or adds it. The first time it gets added, the radio button on change listener fires perfectly but if the div is deleted and re-added the onChange listener no longer works. HTML &lt;div id="div_container"&gt; &lt;input type="radio" name="gender" value="m"/&gt; &lt;input type="radio" name="gender" value="f"/&gt; &lt;/div&gt; JS $(document).on('change', 'input[type=radio][name=gender]', function(){ alert(); }); Anybody know how to resolve this?
tagged with: dom
type: Question
has title: Onchange listener on radio button that gets added and removed to DOM
answer count: 2
has comment: http://stackoverflow.com/comment/45529416
has answer: http://stackoverflow.com/a/28613836
has comment: http://stackoverflow.com/comment/45530008
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45529403
score: 0
has comment: http://stackoverflow.com/comment/45529053
has answer: http://stackoverflow.com/a/28613238
has comment: http://stackoverflow.com/comment/45529734
accepted answer: http://stackoverflow.com/a/28613238
has comment: http://stackoverflow.com/comment/45528980

http://stackoverflow.com/comment/45732804
type: QuestionComment
type: Comment
has text: What are the other two properties? computed properties? primitive types? You are saying you depend on propertyB, but truly you depend on propertyB.someObject.someValue likewise propertyY, but then you truly depend on propertyY.someObject.
score: 0
comment on: http://stackoverflow.com/q/28722075

http://stackoverflow.com/q/28613193
has comment: http://stackoverflow.com/comment/45529927
upvote count: 15
answer count: 2
has comment: http://stackoverflow.com/comment/45549305
has comment: http://stackoverflow.com/comment/45529893
accepted answer: http://stackoverflow.com/a/28615615
downvote count: 0
tagged with: web
linked to: http://stackoverflow.com/q/4113268
favorite count: 0
has title: My scripts are inlined by some mobile carriers - How to deal with that?
has comment: http://stackoverflow.com/comment/45530109
possible better answer: http://stackoverflow.com/a/31872724
has comment: http://stackoverflow.com/comment/45551018
has answer: http://stackoverflow.com/a/31872724
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45531585
has answer: http://stackoverflow.com/a/28615615
type: Question
has comment: http://stackoverflow.com/comment/45531048
has comment: http://stackoverflow.com/comment/45530144
tagged with: content-security-policy
tagged with: javascript
has comment: http://stackoverflow.com/comment/45531423
score: 15
has body: Some pages aren't correctly received on mobile phones (many ones in France) : JavaScript script elements are inlined. Instead of having &lt;script src="static/jquery-2.1.3.min.js"&gt;&lt;/script&gt; I have &lt;script&gt; ... content of the whole jQuery script ... &lt;/script&gt; As the Content Security Policy header I set forbids inline scripts, modern browsers block the execution of the script. Is there a way to deal with that other than using HTTPS ? Maybe some way to specify the page shouldn't be rewritten by third parties ? Notes : the CSP header isn't enough a hint for the third-party doing the transformation the Cache-Control:no-transform header is ignored as well any answer involving the addition of an inline script isn't an answer as the goal is to remove all inline scripts for security the problem isn't related to the injection of supplementary scripts (that wouldn't break my site as the browser is instructed not to execute them) but to the inlining of the existing scripts the problem isn't specific to any operator : I'm looking for a (reasonnably) general solution

http://stackoverflow.com/comment/45651319
comment on: http://stackoverflow.com/q/28679072
type: Comment
type: QuestionComment
has text: If you called the method from another place, then that other place is relevant.
score: 2

http://stackoverflow.com/a/28744713
has comment: http://stackoverflow.com/comment/45794216
has comment: http://stackoverflow.com/comment/45775214
score: 0
answers question: http://stackoverflow.com/q/28744335
has body: Your routes don't include '/projectname', which I assume is your application context. You need to include that in the route urls for it to work properly.
has comment: http://stackoverflow.com/comment/45772525
type: Answer
has comment: http://stackoverflow.com/comment/45772128
has comment: http://stackoverflow.com/comment/45803364
has comment: http://stackoverflow.com/comment/45803782
has comment: http://stackoverflow.com/comment/45774981

http://stackoverflow.com/comment/45590847
score: 0
comment on: http://stackoverflow.com/q/28640656
type: Comment
type: QuestionComment
has text: thanks - I haven't worked with console.log - where should that be positioned in the script

http://stackoverflow.com/comment/45770939
has text: You should probably have a min-width. Then you can have it scaling according to font size and text length. The fiddle provided by @dowomenfart seems to be working, at least the width expands while user types.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28744017

http://stackoverflow.com/a/28619585
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45541879
has comment: http://stackoverflow.com/comment/45542444
accepted answer of: http://stackoverflow.com/q/28619433
answers question: http://stackoverflow.com/q/28619433
has body: Change the time function so that if time is greater than the value you have as max then it returns max. this.time = function () { var duration = lapTime + (startAt ? now() - startAt : 0); if (duration &gt; max) { duration = max; } return duration ; }; Replace max with numerical value representing the maximum duration. For 59:59, The max value would be (1000 * 60 * 59) + (59 * 1000). This is because the time representation returned is a millisecond value, so 59 minutes plus 59 seconds
has comment: http://stackoverflow.com/comment/45542465
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45541912
type: Answer

http://stackoverflow.com/comment/45750988
comment on: http://stackoverflow.com/q/28732419
type: QuestionComment
type: Comment
has text: @NetaMeta: Except `querySelectorAll` doesn't return an array. And that's why you NEED `call` there.
score: 0

http://stackoverflow.com/a/28630926
type: AcceptedAnswer
has body: I think you do get an object. It's just the browser's way of displaying things. Try this: console.log($('.page_container')[3].id);
type: Answer
accepted answer of: http://stackoverflow.com/q/28620847
answers question: http://stackoverflow.com/q/28620847
has comment: http://stackoverflow.com/comment/45569625
score: 0

http://stackoverflow.com/comment/45538070
type: AnswerComment
has text: Yes, it seems to be the most correct solution. BTW, why have you decided to use this font? Being really nice for a large size typography, in WYSIWYG editor it look not different from something simple and standard like arial...
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28615682

http://stackoverflow.com/q/28632512
has body: I am trying to animate an SVG pattern and, once this has finished, to make a background image fading in. Each of the two effect works fine separately. But when I combine them it looks like the timing is wrong. I think the actual issue is the SVG being inside the div with opacity:0. This is used to make the background colour fade in, but it means that the SVG isn't not visible straight away. Is a CSS only solution possible? Or do I need Javascript? And if so, could people make suggestion? I have simplified the scenario by using a background colour instead of an image. DEMO HTML &lt;div class="container"&gt; &lt;div class="background-image"&gt; &lt;svg xmlns="http://www.w3.org/2000/svg" width="4.125in" height="4.125in" viewBox="0 0 225 225" enable-background="new 0 0 225 225" xml:space="preserve"&gt; &lt;path class="path1" fill="none" stroke="#777" stroke-width="2" stroke-miterlimit="10" d="M 83.01,112.78 C 80.13,110.89 78.53,108.88 74.91,109.48 69.10,110.43 66.63,111.92 60.00,112.00 48.94,112.13 39.95,110.21 30.00,105.24 22.08,101.28 17.12,97.55 11.09,91.00 -5.19,73.30 -3.09,44.96 21.00,35.46 25.53,33.68 29.17,33.06 34.00,33.00 34.00,33.00 42.00,33.00 42.00,33.00 65.38,33.11 94.95,52.94 95.86,78.00 95.86,78.00 95.86,87.79 95.86,87.79 96.74,90.83 107.85,97.10 111.00,96.77 113.91,96.47 131.24,86.30 135.00,84.15 135.00,84.15 175.00,61.72 175.00,61.72 175.00,61.72 197.00,49.54 197.00,49.54 199.00,49.06 200.95,48.98 203.00,49.54 206.31,50.06 220.39,57.00 222.49,59.39 224.65,61.85 224.86,64.95 223.42,67.83 221.71,71.24 216.08,75.02 213.00,77.42 213.00,77.42 189.00,96.21 189.00,96.21 189.00,96.21 158.00,121.00 158.00,121.00 158.00,121.00 211.00,162.00 211.00,162.00 215.82,165.82 227.04,172.63 223.65,179.96 221.02,185.63 204.19,193.06 198.00,191.58 194.20,190.68 180.34,182.28 176.00,179.86 176.00,179.86 129.00,153.58 129.00,153.58 129.00,153.58 112.00,144.48 112.00,144.48 108.46,143.69 104.88,146.43 102.00,148.20 100.01,149.43 97.21,150.98 96.08,153.18 95.33,155.06 96.06,160…
has answer: http://stackoverflow.com/a/28632726
tagged with: javascript
has title: SVG pattern animation and background fade in issue
type: Question
tagged with: css
tagged with: http://stackoverflow.com/tag/svg
accepted answer: http://stackoverflow.com/a/28632726
score: 0
answer count: 1
type: AnsweredQuestion

http://stackoverflow.com/a/28642738
has body: Yes, there is a reason to do this. It ensures that even if the indexOf property of the string has been overwritten, the original indexOf property will still be used. Such a thing is possible if we use the new String constructor. var s = new String('test'); s.indexOf = function() { throw new Error('this is bad'); }; s.indexOf('test');//Throws error.
has comment: http://stackoverflow.com/comment/45584409
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/45583912
has comment: http://stackoverflow.com/comment/45583942
has comment: http://stackoverflow.com/comment/45584267
has comment: http://stackoverflow.com/comment/45583974
upvote count: 3
has comment: http://stackoverflow.com/comment/45584050
has comment: http://stackoverflow.com/comment/45583938
has comment: http://stackoverflow.com/comment/45584081
has comment: http://stackoverflow.com/comment/45584361
has comment: http://stackoverflow.com/comment/45584053
type: Answer
answers question: http://stackoverflow.com/q/28642705

http://stackoverflow.com/comment/45562249
type: Comment
type: QuestionComment
score: 1
has text: Well in javascript/jquery when you click edit (onClick event) you could get the table row where you clicked edit and select the first texbox in that table row. Please provide more info (more code, the html part of the grid) and if not me surely someone else will be able to help.
comment on: http://stackoverflow.com/q/28629999

http://stackoverflow.com/comment/45570027
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28633916
has text: @guest271314 That filter could be bypassed, just use a different whitespace character or some other character the browser will try to error-handle. It would also potentially have negative effects on attributes like `class` or text content if called on such an element.

http://stackoverflow.com/a/28652562
type: AcceptedAnswer
type: Answer
has body: A more-elegant way to handle this would be to use the change event with event delegation. This way we don't have to keep unbinding and rebinding event listeners to the individual radio buttons. $(document).on('change', '[name="school"]', function() { var selected = $(this).val(); console.log('Do something with: ', selected); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;input type="radio" id="student" name="school" value="student" checked&gt;Student &lt;input type="radio" id="teacher" name="school" value="teacher"&gt;Teacher
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28652367
answers question: http://stackoverflow.com/q/28652367
upvote count: 2

http://stackoverflow.com/q/28653130
has body: Hi I have an image review system that has a slide down caption and a slide up caption on hovering over the image. Inside the top caption I've been trying to align a review widget to the left of the caption and a few share buttons to the right of the caption. I have the elements in the caption but can't seem to get them to align. I tried to add external css to a fiddle here: http://jsfiddle.net/dottsie/nj0mgwdr/1/ I couldn't figure out how to get external to work so I'll paste them here: component.css: .grid { padding: 20px 20px 100px 20px; max-width: 1300px; margin: 0 auto; list-style: none; text-align: center; } .grid li { display: inline-block; width: 440px; margin: 0; padding: 20px; text-align: left; position: relative; } .grid figure { margin: 0; position: relative; } .grid figure img { max-width: 100%; display: block; position: relative; } .grid figcaption { position: absolute; top: 0; left: 0; padding: 20px; background: #49484A; color: #ed4e6e; } .grid share-buttons { position: absolute; top: 0; left: 0; padding: 20px; } .grid figcaption h3 { margin: 0; padding: 0; color: #fff; } .grid figcaption span:before { content: 'by '; } .grid figcaption a { text-align: center; padding: 1px 1px; border-radius: 2px; display: inline-block; background: #ed4e6e; color: #fff; } figcaption2 { position: absolute; top: 0; left: 0; padding: 20px; background: #49484A; color: #ed4e6e; } figcaption2 h3 { margin: 0; padding: 0; color: #fff; } figcaption2 span:before { content: 'by '; } figcaption2 a { text-align: center; padding: 1px 1px; border-radius: 2px; display: inline-block; background: #ed4e6e; color: #fff; } /* Caption Style 1 */ .cs-style-1 figure { overflow: hidden; } .cs-style-1 figure img { -webkit-transition: -webkit-transform 0.4s; -moz-transition: -moz-transform 0.4s; transition: transform 0.4s; } .no-touch .cs-style-1 figure:hover img, .cs-style-1 figure.cs-hover img { -webkit-transform: translateY(0px); -moz-transform: translateY(0px); -ms-transform: translateY(0px)…
score: 0
type: Question
has comment: http://stackoverflow.com/comment/45603294
tagged with: javascript
tagged with: jquery
has title: How to align elements inside a caption using CSS?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45603431
answer count: 0
type: UnansweredQuestion
tagged with: php
tagged with: css

http://stackoverflow.com/q/28653761
answer count: 3
has comment: http://stackoverflow.com/comment/45604725
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/28653848
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46509260
type: AnsweredQuestion
has body: Is there a way to chain HTML5 classList API chaining?. this will not work var sidebar = document.querySelector("#sidebar"); sidebar.classList.toggle("active").classList.remove("hover") while this will work var sidebar = document.querySelector("#sidebar"); sidebar.classList.toggle("active"); sidebar.classList.remove("hover") NOTE: NO jquery please
has comment: http://stackoverflow.com/comment/45604485
has comment: http://stackoverflow.com/comment/45605566
has answer: http://stackoverflow.com/a/29142905
upvote count: 17
has comment: http://stackoverflow.com/comment/45607278
type: Question
has answer: http://stackoverflow.com/a/29143197
accepted answer: http://stackoverflow.com/a/29143197
has answer: http://stackoverflow.com/a/28653848
tagged with: javascript
score: 17
has title: chaining HTML5 classList API without (Jquery)

http://stackoverflow.com/comment/45767607
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28742278
has text: You can store the color in each section using data-attributes and when the section is scrolled into view get its data-color and apply to the border
type: Comment

http://stackoverflow.com/a/28594298
has comment: http://stackoverflow.com/comment/45495310
has body: I'm not 100% certain what you mean by copy and rename ... in place But, based on your current code, if you simply wish to: Watch all .js files in the parent directory and Copy them to the cwd (current working directory) and Name all copies, regardless of source file, the same thing Then you could use gulp-rename to do just that: var gulp = require('gulp'); var rename = require('gulp-rename'); gulp.task('default', function() { return gulp.watch('../**/**.js', function(obj) { gulp.src(obj.path) .pipe(rename('newFileName.js')) .pipe(gulp.dest('.')); }); }); In this case, the output filename is newFileName.js In order to use the module, you'll need to install the gulp-rename package with npm (ie: npm install gulp-rename). More examples are available on the package details page on npm @ https://www.npmjs.com/package/gulp-rename#usage
has comment: http://stackoverflow.com/comment/86065049
answers question: http://stackoverflow.com/q/28593660
has comment: http://stackoverflow.com/comment/45495708
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28593660
score: 96
has comment: http://stackoverflow.com/comment/45521445
upvote count: 96
has comment: http://stackoverflow.com/comment/45495549
type: Answer

http://stackoverflow.com/comment/45721630
comment on: http://stackoverflow.com/a/28716990
type: AnswerComment
score: 1
type: Comment
has text: @Kartikeya but I see in the question is using .html which means he want to replace the content

http://stackoverflow.com/q/28748706
has title: CSS/Javascript Swinging Box
has comment: http://stackoverflow.com/comment/45779509
score: 0
answer count: 2
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/28748953
linked to: http://stackoverflow.com/q/11145010
has body: I have a menu box that contains a few links to pages. I'd like it so that if the user "bumps" it with their cursor, the box reacts and jerks slightly (swings in direction mouse 'pushed' it) and then swings back and forth until it comes to a stop. The menu is in a div, and I need the contents to stay in their relative position to the menu (though rotating with it I guess). How can I accomplish this using Javascript? Preferably not CSS.
type: AnsweredQuestion
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28748953
possible better answer: http://stackoverflow.com/a/28748872
has comment: http://stackoverflow.com/comment/46094065
type: Question
has answer: http://stackoverflow.com/a/28748872
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/45619526
type: Comment
score: 1
has text: So why did not not say that in your question @Fabio?
comment on: http://stackoverflow.com/a/28662083
type: AnswerComment

http://stackoverflow.com/comment/45700462
type: Comment
has text: lol! I apologize for wasting your time on this, to everyone who commented.
comment on: http://stackoverflow.com/a/28705404
score: 1
type: AnswerComment

http://stackoverflow.com/comment/45499347
comment on: http://stackoverflow.com/q/28596211
has text: @MarcusParsons Oh... that's because the `\W` is matching the punctuation/operators (e.g. https://regex101.com/r/zH9hH1/1). What you want is a zero-width assertion, or a capturing group. Just replace `(^|\\W)` and `($|\\W)` both with `\b` (or `\\b` in the string) e.g. https://regex101.com/r/pP9pT0/1
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/a/69538263
score: 0
type: Answer
has body: Try this: document.onkeydown = function(e) { if(event.keyCode == 123) { return false; } if(e.ctrlKey &amp;&amp; e.shiftKey &amp;&amp; e.keyCode == 'I'.charCodeAt(0)){ return false; } if(e.ctrlKey &amp;&amp; e.shiftKey &amp;&amp; e.keyCode == 'J'.charCodeAt(0)){ return false; } if(e.ctrlKey &amp;&amp; e.keyCode == 'U'.charCodeAt(0)){ return false; } if(e.ctrlKey &amp;&amp; e.keyCode == 'C'.charCodeAt(0)){ return false; } if(e.ctrlKey &amp;&amp; e.keyCode == 'X'.charCodeAt(0)){ return false; } if(e.ctrlKey &amp;&amp; e.keyCode == 'Y'.charCodeAt(0)){ return false; } if(e.ctrlKey &amp;&amp; e.keyCode == 'Z'.charCodeAt(0)){ return false; } if(e.ctrlKey &amp;&amp; e.keyCode == 'V'.charCodeAt(0)){ return false; } if (e.keyCode == 67 &amp;&amp; e.shiftKey &amp;&amp; (e.ctrlKey || e.metaKey)){ return false; } if (e.keyCode == 'J'.charCodeAt(0) &amp;&amp; e.altKey &amp;&amp; (e.ctrlKey || e.metaKey)){ return false; } if (e.keyCode == 'I'.charCodeAt(0) &amp;&amp; e.altKey &amp;&amp; (e.ctrlKey || e.metaKey)){ return false; } if ((e.keyCode == 'V'.charCodeAt(0) &amp;&amp; e.metaKey) || (e.metaKey &amp;&amp; e.altKey)){ return false; } if (e.ctrlKey &amp;&amp; e.shiftKey &amp;&amp; e.keyCode == 'C'.charCodeAt(0)){ return false; } if(e.ctrlKey &amp;&amp; e.keyCode == 'S'.charCodeAt(0)){ return false; } if(e.ctrlKey &amp;&amp; e.keyCode == 'H'.charCodeAt(0)){ return false; } if(e.ctrlKey &amp;&amp; e.keyCode == 'A'.charCodeAt(0)){ return false; } if(e.ctrlKey &amp;&amp; e.keyCode == 'F'.charCodeAt(0)){ return false; } if(e.ctrlKey &amp;&amp; e.keyCode == 'E'.charCodeAt(0)){ return false; } } if (document.addEventListener) { document.addEventListener('contextmenu', function(e) { e.preventDefault(); }, false); }else{ document.attachEvent('oncontextmenu', function() { window.event.returnValue = false; }); }
answers question: http://stackoverflow.com/q/28690564
has comment: http://stackoverflow.com/comment/122912660

http://stackoverflow.com/a/57055833
answers question: http://stackoverflow.com/q/28690564
has body: While not an answer, Chrome certainly has a way to do this, I appear to be in an A/B test as my work account can't inspect in Gmail, meanwhile my personal account can. I've searched for &lt;meta&gt; tags or HTTP headers which might be controlling this, but nothing stands out
score: 3
has comment: http://stackoverflow.com/comment/131444923
downvote count: 1
has comment: http://stackoverflow.com/comment/118022559
type: Answer
upvote count: 4

http://stackoverflow.com/q/28597462
type: Question
linked to: http://stackoverflow.com/q/4626361
has answer: http://stackoverflow.com/a/28597707
tagged with: javascript
has comment: http://stackoverflow.com/comment/45501463
answer count: 3
has title: Javascript array to boolean type coercion not making sense
has body: When I run the following line of code: var x = []; console.log(!x); console.log(x == false); &gt; false &gt; true I assumed using ! would coerce the type correctly similar to how it works in PHP, and that these two console logs would return the same output. Can someone explain to me what is going on here?
has answer: http://stackoverflow.com/a/28597859
favorite count: 0
accepted answer: http://stackoverflow.com/a/28597707
has comment: http://stackoverflow.com/comment/45501586
has answer: http://stackoverflow.com/a/28597496
linked to: http://stackoverflow.com/q/27989285
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45501445
upvote count: 2
score: 1
has comment: http://stackoverflow.com/comment/45501498
possible better answer: http://stackoverflow.com/a/28597496
has comment: http://stackoverflow.com/comment/45502121
has comment: http://stackoverflow.com/comment/45501439
downvote count: 1
has comment: http://stackoverflow.com/comment/45501425

http://stackoverflow.com/comment/45599403
has text: Can you please provide a fiddle or something?
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28650978

http://stackoverflow.com/comment/45743783
type: QuestionComment
score: 1
has text: DOM elements and canvas bitmaps are two very separate things. You have to draw each bitmap (from each canvas) onto a new one (or reuse one of them).
comment on: http://stackoverflow.com/q/28727883
type: Comment

http://stackoverflow.com/q/28705237
has title: How to capture jquery datepicker input in php validation script?
accepted answer: http://stackoverflow.com/a/28705404
tagged with: jquery
has comment: http://stackoverflow.com/comment/45700079
has body: I have a demo here: http://hane-content.com/datepick/ I have two fields, name and date. Jquery Datepicker is attached to the date field. I can fill out the name field, select a random date, and hit submit. However, when the form data is processed through email.php, an error comes back saying that the date has not been filled out, like the date field is empty. I'm a beginner. How do you get around this? email.php &lt;?php // email.php $errors = array(); // array to hold validation errors $data = array(); // array to pass back data if (empty($_POST['datoa'])) $errors['dateoa'] = 'Date is required.'; if (empty($_POST['name'])) $errors['name'] = 'Name is required.'; // return a response =========================================================== // if there are any errors in our errors array, return a success boolean of false if ( ! empty($errors)) { // if there are items in our errors array, return those errors $data['success'] = false; $data['errors'] = $errors; } else { // if there are no errors process our form, then return a message // DO ALL YOUR FORM PROCESSING HERE // THIS CAN BE WHATEVER YOU WANT TO DO (LOGIN, SAVE, UPDATE, WHATEVER) // show a message of success and provide a true success variable $data['success'] = true; $data['message'] = 'Success!'; } // return all our data to an AJAX call echo json_encode($data); ?&gt;
has answer: http://stackoverflow.com/a/28705391
tagged with: datepicker
tagged with: php
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28705391
has answer: http://stackoverflow.com/a/28705404
type: Question
tagged with: javascript
score: 0
answer count: 2

http://stackoverflow.com/comment/45621034
has text: It might help if you showed your failed attempt to make it fade in as well as your working code.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28662893

http://stackoverflow.com/q/28648710
answer count: 1
downvote count: 0
has title: How to pass argument from Flame.js widget to ember function
favorite count: 0
type: UnansweredQuestion
tagged with: ember.js
score: 1
has answer: http://stackoverflow.com/a/28649707
upvote count: 1
type: Question
tagged with: flame.js
tagged with: javascript
has body: I am learning ember.js and flame.js for the first time, and am having trouble understanding some of the documentation. I have a flame widget (a button) which when clicked, should send a argument (the number 1) to the function specified in action. The flame code is given below: numButtonView: Flame.ButtonView.extend({ layout: { left: 150, width: 20 }, title: '4', targetBinding: '^controller', valueBinding: '^controller.num', action: 'numDisplay' }) and the ember function right now looks like this: App.calcController = Ember.Object.create({ var num = null; numDisplay: function(num){ ...... } }); How do I pass the 'argument' from the widget to the function? I would be glad for any help,..thanks in advance! EDIT: I am trying to set the 'num' value in the controller to 1 by clickng the button. For this, I have used 'valueBinding' to bind the button to 'num'. But, how do I get the value 1 to be associated with this button and 'num'?

http://stackoverflow.com/comment/45635839
score: 0
has text: just am sending the post variables to test.php, if possible both javascript and ajax
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28670953

http://stackoverflow.com/comment/45583718
has text: @sheriffderek haha i know, it took me while to get a hang of this stuff as well, let me know if you need me to clarify something, but you do need to read the Ember documentation thoroughly, especially the API pages for RESTAdapther and RESTSerializer where all these methods are explained
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28634279
type: Comment

http://stackoverflow.com/q/28616584
answer count: 1
tagged with: asynchronous
has comment: http://stackoverflow.com/comment/45536630
has comment: http://stackoverflow.com/comment/45536773
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45537018
has body: I am using async's queue method to queue up tasks. I set concurrency to 20. I have a little over 2100 tasks to complete, however when queue reaches 20, it quits processing more tasks. Here is what I have: syncrequest = require('sync-request'); o.getObj = function(site, link){ global.task.comment(site, 'Pulling page ' + link, function(){}); try{ q.push({url: link}, function(){ console.log("processed" + link); }); }catch(e){ console.log(e); } } var q = async.queue(function(task, callback){ var body = syncrequest('GET', base+'/'+task.url).getBody(); $$$ = cheerio.load(body); var obj = { title: $$$('#title').text(), link: task.url, }; $$$ = null; objs.push(obj); return; },20); The callback console.log("processed" + link); never gets called, so I'm assuming that it thinks the task is still running. I'm logging the number of total objects and the number of objects pushed on a setInterval and it logs: app-0 (out): 2210 ... 3 app-0 (out): 2210 ... 6 app-0 (out): 2210 ... 9 app-0 (out): 2210 ... 12 app-0 (out): 2210 ... 15 app-0 (out): 2210 ... 18 app-0 (out): 2210 ... 20 app-0 (out): 2210 ... 20 app-0 (out): 2210 ... 20 app-0 (out): 2210 ... 20 ... Should I be doing something to formally finish a task to clear room for another?
tagged with: queue
has comment: http://stackoverflow.com/comment/45536552
has answer: http://stackoverflow.com/a/28616742
type: Question
accepted answer: http://stackoverflow.com/a/28616742
has comment: http://stackoverflow.com/comment/45536544
has title: Node.js - async.queue() - How to end a task to allow more to run?
tagged with: javascript
has comment: http://stackoverflow.com/comment/45536508
score: 0

http://stackoverflow.com/q/28744664
tagged with: http://stackoverflow.com/tag/svg
answer count: 0
type: UnansweredQuestion
has title: svg gradient not working in app due to fill path relativity
tagged with: fill
has comment: http://stackoverflow.com/comment/45805681
type: Question
tagged with: url
tagged with: javascript
has comment: http://stackoverflow.com/comment/45772189
has body: I have a SVG with lineargradient which works fine when opened independently in the browser. When I embed it in my single page app, the gradient does not appear. When I assign the svg as backgroundimage or img src, it works fine. Also ,when I modify the fill url with respect to my app url(eg. fill: url(#graidentId) becomes fill: url('path#gradientId')), it works fine. I want the svg to be independent of the code.And not modify the fill path in my code. I do not want to use it as backgroundimage or img src as well. Is there a way to fix this? Is there a way to generate SVGs such that this is fixed.
score: 0
has comment: http://stackoverflow.com/comment/45797805
tagged with: css

http://stackoverflow.com/comment/45778257
has text: Ahhh...Find() - that worked splendidly. Thank you very much for your help!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28732496
type: Comment

http://stackoverflow.com/q/28678945
has comment: http://stackoverflow.com/comment/45651180
has comment: http://stackoverflow.com/comment/45651682
has comment: http://stackoverflow.com/comment/45651288
has comment: http://stackoverflow.com/comment/45654268
has comment: http://stackoverflow.com/comment/45651247
accepted answer: http://stackoverflow.com/a/28680862
upvote count: 1
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45653436
tagged with: javascript
has body: I am calling rest service, based on regInventoryId i want to display data that are associated with the array of object i was able to display some objects but some i could not ,From code below for example i could not populate data in the view for SubpartId. Please let me know what i am doing wrong any suggetion will be welcome. See code Below tried so far... HTML Rule Id {{lrrDetail.ruleIdentifier}} SubpartID {{lrrDetail.subPartId}} Rule Internal or Outsourced Rule internal data Subpart Internal or Outsourced LRR Data one lorem ipsum CTRL.JS $scope.lrrDetailWinOptions = lrrSearchGridConfig.modalLrrConfig; $scope.showDetail = function (id){ $scope.selectedId = id; lrrDetails.findlrrDetail(id.regInventoryId).then(function(response){ $scope.lrrDetail = response.data; $scope.$broadcast('openDetailWindow'); }); } FACTORY.JS findlrrDetail: function(regInventoryId){ return $http.get('/third-party-management/rest/lrr/' + regInventoryId); }, }; JSON.JS 0: {subPartId: "99996", regInventoryId: 38468, citationId: "94181", coreCitationId: "69502",…} assigned: false citationId: "94181" citationValue: "New Jersey Statutes 46" coreCitationId: "69502" issuingAuth: "New Jersey Legislature" regInventoryId: 38468 regInvetoryName: "Document Signing & Notary" regInvetoryNameKey: 4074 regionName: "United States," ruleIdentifier: "17181" ruleName: "Property" subPartId: "99996" subPartRuleInvortyKey: null subpartCitation: "New Jersey Statutes 46:14-6.1" subpartRuleName: null JSON1.JS applicabilityIndicator: "0" auditGroupCategory: null auditGroupIndicator: "0" citationAsOfDate: 1385355600000 citationCoreIndicator: "69498" citationValue: "New Jersey Statutes 46" createdBy: "ERDSYSTEM" createdDate: 1387240599333 enterpriseReportingHierarchies: [] externalIndintifier: "94177" geographicLocations: [{id: 5670, sourceFeedKey: 5, lookupCode: "RS_ACTIVE", externalIndintifier: "226",…}] 0: {id: 5670, sourceFeedKey: 5, lookupCode: "RS_ACTIVE", externalIndintifier: "226",…} highValueSummary: "Title 46 …
type: Question
score: 0
answer count: 1
has title: How to retrieve data from Array of Object in Angularjs?
has comment: http://stackoverflow.com/comment/45651680
has comment: http://stackoverflow.com/comment/45651365
has answer: http://stackoverflow.com/a/28680862
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/q/28737695
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/31973095
score: 0
answer count: 2
tagged with: ng-grid
has body: In the following code I have created an angular widget which uses an angular grid to pass data. However, I am getting the following error Error: [$injector:unpr] Unknown provider: alphadataProvider &lt;- alphadata The widget code: 'use strict'; angular.module('alphabeta.table.widgets', ['adf.provider', 'btford.markdown', 'ngGrid']) .value('githubApiUrl', 'https://api.github.com/repos/') .config(function(dashboardProvider){ dashboardProvider .widget('reservationTotals', { title: 'Reservation Totals', description: 'Reservation Totals widget', controller: 'reservationTotalsCtrl', templateUrl: 'scripts/widgets/alphabeta/alphabeta.html', resolve: { alphadata: function(alphatradingService){ return alphatradingService.get(); } }, edit: { templateUrl: 'scripts/widgets/alphabeta/edit.html', reload: false } }); }) The service .service('alphatradingService', function($q, $http, githubApiUrl){ return { get: function(){ var deferred = $q.defer(); $http.get('9_Response.json') .success(function(data){ deferred.resolve(data); }) .error(function(){ deferred.reject(); }); return deferred.promise; } }; }) The controller .controller('reservationTotalsCtrl', function($scope, alphadata){ var tabledata = []; var i, n; var ycount=0, yexist=0; var numf; for(i=0;i&lt;alphadata.length;i++){ yexist=0; for(n=0;n&lt;ycount;n++){ if (alphadata[i].stYear == tabledata[n].Year &amp;&amp; alphadata[i].market == tabledata[n].Market) { tabledata[n].Sales += alphadata[i].totSale; tabledata[n].Sales = parseFloat(Math.round(tabledata[n].Sales * 100) / 100); yexist++; break; } } if (!yexist) { numf = alphadata[i].totSale; tabledata.push({ Market: alphadata[i].market, Year: alphadata[i].stYear, Sales: parseFloat(Math.round(numf * 100) / 100), CustomerName: alphadata[i].custName }); ycount++; } } $scope.data = tabledata; $scope.gridOptions = { data: 'data', enablePinning: true, columnDefs: [{ field: "Market", width: 60, pinned: true }, { field: "Year", width: 60 }, { field: "Sales", width: 60 }, { field: "Cu…
tagged with: angularjs
has title: Angular Grid in an Angular widget returns Error: [$injector:unpr] Unknown provider:
type: UnansweredQuestion
tagged with: widget
has answer: http://stackoverflow.com/a/28738513

http://stackoverflow.com/a/28720687
type: AcceptedAnswer
downvote count: 1
accepted answer of: http://stackoverflow.com/q/28719835
type: Answer
upvote count: 0
has comment: http://stackoverflow.com/comment/45728829
score: -1
has body: If you use the onChange callback, you'll have to read the values stored in the #daterangepicker, your start and end variables don't automatically get populated. A simple approach to get the start / end values would be parse the start and end values (from JSON) in your onChange function: var startDate; var endDate; // Show multidatetime picker // more infos here: http://tamble.github.io/jquery-ui-daterangepicker/ $('#daterangepicker').daterangepicker( { onChange: function () { var tempValues = JSON.parse($('#daterangepicker').val()); alert('change : ' + tempValues.start + ' - ' + tempValues.end) }, format: 'YYYY-MM-DD', startDate: '2013-01-01', endDate: '2013-12-31' } );
answers question: http://stackoverflow.com/q/28719835

http://stackoverflow.com/comment/45572281
score: 2
type: QuestionComment
comment on: http://stackoverflow.com/q/28634184
has text: You compare the zIndex of the wrong elements. Take a look at the opacity, it's set to 0.01, these elements are overlayMouseTargets, which receive the mouse-events, but are not visible. I'm afraid the MarkerWithLabel-library is not the right tool to achieve it. A much easier solution: a simple Marker(the frame) with a background(the cats). See: http://stackoverflow.com/questions/25707155/place-an-image-over-an-image-in-google-maps-api-marker/25708388#25708388
type: Comment

http://stackoverflow.com/a/28644963
answers question: http://stackoverflow.com/q/28644795
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
has body: You can do this using jQuery and having a specific hidden class for small screens - so you don't have to check for screen width in js. Javascript: var showContent = function () { var $yellow = $('#yellow-view'), $this = $(this); //Hide red and show yellow $yellow.removeClass('hidden-small'); $this.addClass('hidden-small'); //Add content to yellow view $yellow.html('my content'); }; $('#menu').click(showContent); CSS: .menu { width:100px; height:100px; float: left; background-color: red; } .view { width: 200px; height:300px; background-color: yellow; float:left; } @media (max-width: 600px) { .menu { width:100%; } .hidden-small { display: none; } } https://jsfiddle.net/s9wkbL9m/2/
accepted answer of: http://stackoverflow.com/q/28644795
type: Answer

http://stackoverflow.com/q/28613341
score: 0
has answer: http://stackoverflow.com/a/28812159
answer count: 1
tagged with: backbone.js
tagged with: parse-platform
type: AnsweredQuestion
has body: I'm using Parse JS in version 1.3.4 in a web app project &lt;script src="//www.parsecdn.com/js/parse-1.3.4.min.js"&gt;&lt;/script&gt; in one of my Views, I have this declaration: var DrivesView = Parse.View.extend({ className :'backbone-container', options: {}, events: { "click i.map-view-open-button": "openMapViewInModal" }, I wanted to put an event in a font awesome element, which has the class map-view-open-button. Parse is somehow different than Backbone on this... This works pretty well like this: reload the page go to the view (by clicking on the menu) click on the &lt;i&gt; element --> my function app.driveView.openMapViewInModal runs ok I can open the modal (run the function) several times, it works. BUT, if I click on the menu and go to another view, and then come back to app.driveView, then the event won't work. The function app.driveView.openMapViewInModal won't be called if I click on the &lt;i&gt; element. The strange parte is that the event is still there in the view. I checked it with app.drivesView.events. Do I need to somehow close the view when I leave (how?) and then render it again so that the events will be recreated? This is what I tried so far. I thought that I can delete the event on the render function, and create it again. The problem is that the render function will be called only once (at the first visit). If I leave the view and come back, the render function won't be called, which is really strange since my router points to this function (where render is explicitly called): drivesViewer: function(){ $('#app').html(this.driveView.render().el); }, any ideas? thanks.
type: Question
has title: Parse.View: event isn't working when I exit the view and enter it again
accepted answer: http://stackoverflow.com/a/28812159
tagged with: javascript

http://stackoverflow.com/q/28636469
type: Question
has answer: http://stackoverflow.com/a/28636539
accepted answer: http://stackoverflow.com/a/28637100
possible better answer: http://stackoverflow.com/a/28636539
score: 0
answer count: 2
tagged with: javascript
has title: AngularJS $http: send message ignoring fields
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45572702
has answer: http://stackoverflow.com/a/28637100
has body: Given the following object: var msg = {x: 1, y: 2, z: 3}; I need to send it via $http, however ignoring field 'y'. For example: msg = IgnoreFields ( msg, 'y' ); // &lt;-- example of what I'm looking for $http.post('/someUrl', msg ); should send the message: msg = { x: 1, z: 3} Is there a way to do this in Angular and/or JS or I have to do it manually? I'm dealing with large objects. EDIT The object could have nested objects and arrays, and fields on those nested elements may need to be deleted as well. The calling function should disregard where the field is located.
type: AnsweredQuestion

http://stackoverflow.com/q/28693688
tagged with: android
tagged with: http://stackoverflow.com/tag/html
has title: HTML5: additional chars in input with type="number"
answer count: 4
has answer: http://stackoverflow.com/a/28915575
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28693877
accepted answer: http://stackoverflow.com/a/28693804
has comment: http://stackoverflow.com/comment/45848798
has answer: http://stackoverflow.com/a/28693877
type: Question
has answer: http://stackoverflow.com/a/28693988
has body: In our app, we have many inputs that are used to fill in school grades. Till now we had &lt;input type="text" name="mark"&gt; As we're trying to use new features of HTML5, we changed it to &lt;input type="number" name="mark"&gt; so on mobiles/tablets we have interface with only numbers. And there's the case. It is possible to place in input grades like "5+" and others (for example some two-letter shortcuts "ab" and other). It's customizable by users. Is there any way to extend input to treat numbers and all that chars as valid WITH extending Android/iOS keyboard layout to only that? EDIT: Don't forget that i want to know if i can extend keyboard layout on mobile. If it's not possible, i'll fall back to text with some validation.
tagged with: ios
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28693804
linked to: http://stackoverflow.com/q/27103646

http://stackoverflow.com/a/34298131
answers question: http://stackoverflow.com/q/28671024
type: Answer
score: 0
has body: I'm not entirely sure what your question is. What do you mean by "breadcrumb child"? In the Sightly example you give each item is one of the elements of the breadcrumb, so that is what I would assume the "child" is, but that doesn't seem to be what you mean. If the question is about what myModel.js might look like, it would simply have to implement the javascript Use API and return a list of objects. For example "use strict"; use(function () { var crumbs= []; crumbs.push({href: '/home/path', label: 'Home'}); crumbs.push({href: '/section/path', label: 'Section'}); return crumbs; }); Rather than hard coding the crumbs you can use the objects that Sling gives you to get the parents of the current page, but this works as a simple example. note: At this point you should probably use the Java API, rather than the javascript API for production code. See the comparison chart from Adobe's Sightly Intro

http://stackoverflow.com/a/28704756
upvote count: 2
has comment: http://stackoverflow.com/comment/45705447
has comment: http://stackoverflow.com/comment/45700890
has body: This option will disable closing fancybox when clicking on the background $(document).ready(function() { $(".booking_module").fancybox({ helpers : { overlay : { closeClick: false } // prevents closing when clicking OUTSIDE fancybox } }); }); and this option will disable all default click methods of closing fancybox $(document).ready(function() { $(".booking_module").fancybox({ closeBtn : false, closeClick : false, helpers : { overlay : { closeClick: false } // prevents closing when clicking OUTSIDE fancybox }, keys : { close: null } // prevents close when clicking escape button }); }); i think the second option is what you're looking for. Maybe without the "closeBtn"
downvote count: 0
answers question: http://stackoverflow.com/q/28704434
type: Answer
score: 2

http://stackoverflow.com/q/28713296
accepted answer: http://stackoverflow.com/a/28716665
has title: Jquery Statements Crashing
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45714634
tagged with: javascript
type: Question
score: 0
has body: i'm using jquery to animate numbers when the target value is true . but when the value gets true or even gets false my navigation jquery else statement code stops working for some reason i don't know why.i think i'm using "offset" in both. my html animate numbers SOME FACTS ABOUT US WHAT WE ARE Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eu tellus a nulla rhoncus imperdiet. Vestibulum quis dictum leo.Curabitur viverra sagittis velit non fringilla. Etiam sed fringilla risus, vel dapibus nisi. 0 Km ride bike 0 Cups of coffee 0 Projects Completed 0 Users Satisfied Js for Animate Numbers var target = $("#counter").offset().top-$(window).height(); $(document).on('scroll', function() { if ($(window).scrollTop() > target) { $('#bike').animateNumber({ number: 165 },5000); $('#coffee').animateNumber({ number: 2165 },5000); $('#projects').animateNumber({ number: 385 },5000); $('#users').animateNumber({ number: 315 },5000); $(this).off('scroll'); } }); my navigation html Toggle navigation Aston About Projects Clients Team Blog Contact CSS for Jquery .navbar-default.scrolled{ background-color: #fff; border-bottom: 1px solid #BBB9BE; box-shadow: 0,0,2px,#BBB9BE; } .navbar-default { background-color: transparent; border:none; -webkit-transition: background-color 700ms linear; -moz-transition: background-color 700ms linear; -o-transition: background-color 700ms linear; -ms-transition: background-color 700ms linear; transition: background-color 700ms linear; } JS for Navigation var a = $(".navbar-default").offset().top; $(document).scroll(function() { if ($(this).scrollTop() > 10) { $('.navbar-default').addClass("scrolled"); $(".navbar-default .navbar-brand").css({ "color": "#3F4474" }); $(".navbar-default .navbar-toggle .icon-bar").css({ "background-color": "#3F4474" }); } else { $('.navbar-default').removeClass("scrolled"); $(".navbar-default .navbar-brand").css({ "color": "#fff" }); $(".navbar-default .navbar-toggle .icon-bar").css({ "background-color": "#fff" })…
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/45714605
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45715066
tagged with: css
has answer: http://stackoverflow.com/a/28716665

http://stackoverflow.com/comment/89729264
comment on: http://stackoverflow.com/a/44974828
score: 0
has text: This will lose precision in the later digits after the decimal.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45698722
type: Comment
has text: @AlejandroIván do you mean an array that has its first element at index 0?
type: QuestionComment
comment on: http://stackoverflow.com/q/28704086
score: 0

http://stackoverflow.com/comment/45634929
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28670195
has text: you get what i mean. but the class is not changing from inactive to active. If i cant use .innerHTML to load other html file what should i do to create a one page website that the content is the only part that is changing. not the whole page. how can i change the class of Li?
score: 0

http://stackoverflow.com/q/28593650
type: Question
has comment: http://stackoverflow.com/comment/45494415
score: 0
has title: Creating Ajax website with links of multiple subfolders is failing
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45514220
tagged with: .htaccess
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28593765
linked to: http://stackoverflow.com/q/824349
has body: I'm trying to create a site that is loading all it's content via Ajax. So let's say the site is www.abc.net. I have abc.net/index.html and this file shall always being called, whatever URL(folder/file) was typed in. So e.g. abc.net/somesubsite was called, the URL should stay as it is and just calling the index.html. The idea is now to look which URL was called and to handle that with jQuery and showing the specific div. In that way a direct link would be easily possible. Well my issue is that I'm not able to let the URL stay as it is and when having abc.net/somesubsite/someother then I get an server error. I was playing around with htaccess but it feels that it's not really a perfect solution. Is there good way to do that? It is like this site but I want to be able to handle folder/subfolder which is not possible there. I'm interested in any solution, it's also no problem to have different html files that are loaded if really needed. But if possible I would like to have all in one file.
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28593765

http://stackoverflow.com/comment/45510691
type: Comment
type: QuestionComment
has text: Repeated `id` attribute values are invalid - they must be unique. Use a `class` instead.
score: 1
comment on: http://stackoverflow.com/q/28602796

http://stackoverflow.com/comment/78591796
comment on: http://stackoverflow.com/a/43147967
has text: This does not seem to work for me. Returns 171755 seconds just after app start
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45749520
comment on: http://stackoverflow.com/a/28728334
type: Comment
has text: @FelixKling The quotes are needed on the property names to block renaming.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45605662
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28654289
has text: @RobR Thanks for your suggestion. I have added my work so far.

http://stackoverflow.com/q/28672424
has answer: http://stackoverflow.com/a/28672641
has comment: http://stackoverflow.com/comment/45638792
has answer: http://stackoverflow.com/a/28673553
has title: jQuery/CSS - Full width on click
has comment: http://stackoverflow.com/comment/45639280
has comment: http://stackoverflow.com/comment/45638893
type: Question
has comment: http://stackoverflow.com/comment/45638645
has comment: http://stackoverflow.com/comment/45638952
has answer: http://stackoverflow.com/a/28673305
tagged with: javascript
has answer: http://stackoverflow.com/a/28672572
score: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/45639016
has comment: http://stackoverflow.com/comment/45638990
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28672572
tagged with: css
answer count: 4
possible better answer: http://stackoverflow.com/a/28672641
has body: I have three links, which will, onClick, show a different container (containing a chart). This is the HTML code for this: Rented Direct Personal As you can see, only the first chart is shown on page load. In order for my users to see what charts they like, they can click the anchor links. My jQuery code for this is: $('.rentedref-chart').click(function (){ $(this).addClass("active"); $('.directref-chart').removeClass("active"); $('.main-chart').removeClass("active"); $('#directref-chart').hide(); $('#main-chart').hide(); $('#rentedref-chart').show(); }); $('.directref-chart').click(function (){ $(this).addClass("active"); $('.rentedref-chart').removeClass("active"); $('.main-chart').removeClass("active"); $('#rentedref-chart').hide(); $('#main-chart').hide(); $('#directref-chart').show(); }); $('.main-chart').click(function (){ $(this).addClass("active"); $('.directref-chart').removeClass("active"); $('.rentedref-chart').removeClass("active"); $('#directref-chart').hide(); $('#rentedref-chart').hide(); $('#main-chart').show(); }); Now, the switching between containers is working fine. My problem is, that the #rentedref-chart, #directref-chart and #main-chart all have width:100%; The problem occurs, when the users switch to one of the containers/charts that is hidden. It will make the chart 100% of the page width, and not the container width. How can I do, so the width is 100% of the container? (Like the first #rented-chart is on page load?) EDIT - SHOWING MORE CODE: This is the HTML structure: other content Rented Direct Personal other content
type: AnsweredQuestion

http://stackoverflow.com/a/28690200
answers question: http://stackoverflow.com/q/28690001
score: 0
has body: Looking at the code you can just add hide class to the fieldset you want to hide. For example on clicking first set of radio button you can call $('.step1').addClass('hide') to hide that fieldset.
type: Answer

http://stackoverflow.com/q/28703433
tagged with: confirmation
tagged with: validation
answer count: 1
has title: Trying to display variable value in confirm message: Javascript
has body: I am trying to create a validation for a list of radio buttons, which, if successful, prompts a confirm box. The confirm box must state which button the user has selected, and then allow them to confirm. The validation works, but when the popup box appears, I can't get the user's selection to display in the message, either by using checked or checked.value. Here's the code: var checked = null; var inputs = document.getElementsByName('levels'); for (var i = 0; i &lt; inputs.length; i++) { if (inputs[i].checked) { checked = inputs[i]; break; } } if(checked==null) { alert('Please choose an exam level.'); return false; } else { return confirm('You have chosen '+ checked + ', is this correct?'); } Using this code, the message displayed is "You have chosen [object HTMLInputElement], is this correct?", regardless of which button is selected. How do I correctly refer to the variable to avoid this?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45697099
has answer: http://stackoverflow.com/a/28703665
has comment: http://stackoverflow.com/comment/45696745
type: Question
tagged with: message
tagged with: javascript
tagged with: variables
score: 0

http://stackoverflow.com/a/28600726
has body: Try this $("p").html("Write Your Text");
answers question: http://stackoverflow.com/q/28600453
score: -1
downvote count: 1
type: Answer
upvote count: 0

http://stackoverflow.com/comment/45574412
comment on: http://stackoverflow.com/q/28632865
type: Comment
type: QuestionComment
has text: Try using Json.Parse on the db retrieved string before using it as html.
score: 0

http://stackoverflow.com/comment/46171972
type: Comment
has text: I updated the answer. Can you see if you understand? If not please provide a working example on JSFiddle and I will fix it for you.
comment on: http://stackoverflow.com/a/28668854
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45698497
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28704318
has text: Not very clear. Please provide your code after ajax call
score: 0

http://stackoverflow.com/comment/45678750
type: Comment
has text: @djkevino It is indeed not supported in ios, good catch (http://caniuse.com/#search=pattern)
comment on: http://stackoverflow.com/a/28693804
score: 1
type: AnswerComment

http://stackoverflow.com/q/28727775
accepted answer: http://stackoverflow.com/a/28731491
tagged with: dom
type: Question
has title: Creating a Fake DOM to test in a JavaScript test suite
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28731491
has body: The problem TypeError: Cannot set property 'innerHTML' of null The question I am using Jest to handle my JavaScript's unit test and it brings embedded jsdom, which should to handle the DOM-related subjects. This is my fragment of test: jest.dontMock ('fs'); var markup = require ('fs') .readFileSync(__dirname + '/markup/index.html') .toString(); describe ('my app', function () { it ('should initialize adding to the DOM', function () { document.documentElement.innerHtml = markup; app.start(); expect(app.DOM).toEqual(' Hello world! '); }); }); The implementation of .start() has within: document.querySelector('h1').innerHTML = 'Hello world'; When running the library in browser, it works well. But when testing via CLI, it don't. Diagnostics Basically, I tried the following: it ('should initialize adding to the DOM', function () { document.documentElement.innerHtml = markup; console.log(document.querySelector('h1')); // [...] }); And the console.log() outputs 'null' — seems like the markup I created isn't being added to the "DOM" that jsdom created. This is the content of /markup/index.html, also the same as markup variable: Linguisticjs Markup Test Bonjour le monde ! Comment ça va ? Any ideas?
score: 0
upvote count: 1
downvote count: 1
tagged with: unit-testing
type: AnsweredQuestion

http://stackoverflow.com/a/28603608
answers question: http://stackoverflow.com/q/28602982
has body: The element is realize with an iFrame, that you can see as a "micropage into another page". The original source code of the iframe is the following: Share NIF This is the default.css This is the jquery.js This is the mobilyblock.js This is the init.js
type: Answer
score: 0
accepted answer of: http://stackoverflow.com/q/28602982
type: AcceptedAnswer

http://stackoverflow.com/comment/45681204
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28695035
type: Comment
has text: That's what I answered. You need to register to the console message event before you `console.log()` something in the page context.

http://stackoverflow.com/a/28636450
type: Answer
has comment: http://stackoverflow.com/comment/45574087
has body: Use the strip-tags function. Something like: <?php strip_tags($content, ''); ?> The second parameter is for allowed tags. To show the html but not run it use tags and CDATA: Blah Blah Unfortunately, this only works for XHTML and XML. Another alternative. and probably the most viable, is <xmp>: http://jsfiddle.net/8yfghmL9/
score: 1
has comment: http://stackoverflow.com/comment/45574525
answers question: http://stackoverflow.com/q/28636358
upvote count: 1
has comment: http://stackoverflow.com/comment/45574466
accepted answer of: http://stackoverflow.com/q/28636358
has comment: http://stackoverflow.com/comment/45574411
has comment: http://stackoverflow.com/comment/45574358
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/31973253
has body: You can access a static from within the component from this.constructor: so in this case it would be: this.constructor.title
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 19
answers question: http://stackoverflow.com/q/28725125
score: 19
accepted answer of: http://stackoverflow.com/q/28725125
has comment: http://stackoverflow.com/comment/53293918

http://stackoverflow.com/comment/45504893
type: AnswerComment
has text: Are you calling the code before the document is loaded? If not, try wrapping what I provided in a `$(document).ready(function() { });` listener
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28599267

http://stackoverflow.com/comment/45755752
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28735388
has text: @Gael. It is an experimental technology and it doesnot work in IE.
type: Comment

http://stackoverflow.com/q/28713314
answer count: 1
tagged with: jquery
has title: overlay conflict with query live search
has comment: http://stackoverflow.com/comment/45716701
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45714567
has body: On a onepager website i've a livesearch implemented which works as a overlay. The results are shown like this: Team Trust Services The click-function looks like that: $('.clk_s').click(function() { alert("click"); $('.search_ov').fadeOut(); }) Unfortunately, if i click on a result-link nothing happens. I don't know, but there must be some conflicts with the overlay/livesearch output - because if i testing without overlay, everything works. Can somebody help me or know whats wrong? thanks + best regards thomas
has comment: http://stackoverflow.com/comment/45738880
tagged with: javascript
type: Question
score: 0
has answer: http://stackoverflow.com/a/28726371
accepted answer: http://stackoverflow.com/a/28726371

http://stackoverflow.com/comment/45783376
type: Comment
type: QuestionComment
has text: @DavidThomas OK. I apologize. I'm formatting and posting it now.
comment on: http://stackoverflow.com/q/28750566
score: 0

http://stackoverflow.com/q/28700113
type: UnansweredQuestion
downvote count: 3
score: -1
has comment: http://stackoverflow.com/comment/45690454
type: Question
answer count: 2
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/28700219
has title: Loop not stopping when array length met
has answer: http://stackoverflow.com/a/28700210
favorite count: 0
has body: I have it setup that the user inputs the array length. Then they are prompted to add the numbers to the array for let uses. The problem is that the prompted is stuck in an endless loop even though I think I have the do while loop set right, but apparently not. here is the code: function startProcess() { var arraySize = document.getElementById("txtSize").value; alert("the value is " + arraySize); var myArray = arraySize; do { parseInt(prompt("Please enter a number").value); } while (myArray &lt;= arraySize); } If I can just get this one piece to work then everything else false into place. Thank you for your time and expertise.
upvote count: 2

http://stackoverflow.com/comment/45753447
type: QuestionComment
has text: i can get it using jquery as i have said in the question. My problem lies with another operation in my project i cant send a file in ajax to php but i can do it directly in php so i will try to just get the value of table directly using php instead of using ajax..this is another solution i am thinking to complete my project
comment on: http://stackoverflow.com/q/28734023
score: 0
type: Comment

http://stackoverflow.com/comment/45497019
has text: Well, you could just use ng-repeat to get to the individual values, then the filter will work. Can you give us more information about what you hope to do with the formatted values? IE are you just going to display them? Is there additional processing? ETC
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28595124
type: Comment

http://stackoverflow.com/comment/45677393
score: 1
has text: put your code here : http://jsfiddle.net/ : save it, then give us the URL to your saved fiddle. We can then edit it, save it then give you back an updated version :) So put the HTML, CSS and Javascript on that site :)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28693000

http://stackoverflow.com/a/28697426
type: Answer
has comment: http://stackoverflow.com/comment/45687587
has comment: http://stackoverflow.com/comment/45686229
score: 2
answers question: http://stackoverflow.com/q/28697240
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28697240
has comment: http://stackoverflow.com/comment/45688085
has comment: http://stackoverflow.com/comment/45685805
type: AcceptedAnswer
downvote count: 0
has body: Everything is paused when calling a prompt. Straight out of the spec: Pause while waiting for the user's response. Pause includes the following: If necessary, update the rendering or user interface of any Document or browsing context to reflect the current state. Wait until the condition goal is met. If you want the rest of the page to continue running, I recommend you create your own dialog and use a callback to process the response.

http://stackoverflow.com/comment/136033878
has text: I believe the code inside the `remove` can be simplified down a bit. The following works: `[...node.classList].filter((className) => className.startsWith('prefix'))`. The deconstruction on `node.classList` is sufficient; it eliminates the needs to use `Array.from`, `entries()` on `classList` and having to `map` on it. Final result would look like `node.classList.remove(...[...node.classList].filter((className) => className.startsWith('prefix')))`
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/69187862

http://stackoverflow.com/comment/45729425
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28612535
has text: it seems you're hell bent on streaming... go for it then, imho it's surly less compatible than web sockets that everyone uses and supports... since it's for learning purpose go ahead and try streaming see how far you get and how easy it is, and then try the other approach compare and derive conclusions! gl
type: Comment

http://stackoverflow.com/q/28606947
has answer: http://stackoverflow.com/a/28607482
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28607148
accepted answer: http://stackoverflow.com/a/28607148
has body: I can't use JQuery. Trying to set an event listner on td element, such that if user clicks on it, it will read text in td and will look for duplicates in same table rows. E.g ABC is duplicate. ABC 7 DEF 8 HIJ 9 ABC 10 Some one said I can't use onclick method on td tag, so I did this. XYZ 2 And event function is as follows: function foo(e) { alert('hi'); alert(e.target); // alert(window.Event.target.innerHTML); // alert(event.target.text); // alert(event.target.tagName); // alert(event.target.textContent); // alert(event.target.parentElement.tagName); // alert(event.target.innerHTML); The first thing I noticed is that Firefox, IE, don't even start event code methods and properties. They just run till hi alert. But the rest of code doesn't get executed. Chrome, on the other hand, is able to run the event code. I can successfully get innerHtml using alert(event.target.innerHTML); How to make it run in Firefox and IE browsers.
possible better answer: http://stackoverflow.com/a/28607161
has answer: http://stackoverflow.com/a/28607161
type: AnsweredQuestion
type: Question
tagged with: html-table
has title: javascript and td element events properties in browsers
tagged with: javascript
tagged with: event-handling
linked to: http://stackoverflow.com/q/925734
score: 0
answer count: 3

http://stackoverflow.com/comment/45611938
comment on: http://stackoverflow.com/q/28645660
score: 0
has text: I've read that, and the example. but how to apply the animation using fx.animator to a sprite i've created ? So I can modify animation dynamically to every single sprite i have.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28619731
has answer: http://stackoverflow.com/a/28837310
upvote count: 4
tagged with: ruby-on-rails-4
has title: Why would this JS fire on a form partial rendered on 1 page but not another?
has body: I have a posts.js file that looks like this: var ready; ready = function() { var toggleSidebar = $(".togglesidebar"); var primary = $("#primary"); var secondary = $("#secondary"); toggleSidebar.on("click", function(){ if(primary.hasClass("col-sm-9")){ primary.removeClass("col-sm-9"); primary.addClass("col-sm-12"); secondary.css('display', 'none'); } else { primary.removeClass("col-sm-12"); primary.addClass("col-sm-9"); secondary.css('display', 'inline-block'); } }); }; var counter = function(event) { var fieldValue = $(this).val(); var wc = fieldValue.trim().replace(regex, ' ').split(' ').length; var regex = /\s+/gi; var $wcField; var maxWc; if ($(this)[0] === $('#post_title')[0]) { $wcField = $('#wordCountTitle'); maxWc = 7; } else { $wcField = $('#wordCountBody'); maxWc = 150; } $wcField.html(wc); $wcField.toggleClass('over-limit', wc > maxWc); }; $(document).ready(ready); $(document).on('ready page:load', function () { $('#post_title, #body-field').on('change keyup paste', counter); }); In my application.html.erb page, I have this: Submit Report <%= render "posts/form" %> And when I toggle this div, and the _form partial is displayed, the JS works fine in those fields. But if I go to posts/new or /posts/:id/edit, it doesn't. Even though if I check the source of that page, I see the post.js included there. What could be causing this? Edit 1 I am using Turbolinks, if that matters. Edit 2 I tried this, per suggestions in the Answers: var ready; ready = function() { // This is the Sidebar toggle functionality var toggleSidebar = $(".togglesidebar"); var primary = $("#primary"); var secondary = $("#secondary"); $(document).on("click", ".togglesidebar", function(){ if(primary.hasClass("col-sm-9")){ primary.removeClass("col-sm-9"); primary.addClass("col-sm-12"); secondary.css('display', 'none'); } else { primary.removeClass("col-sm-12"); primary.addClass("col-sm-9"); secondary.css('display', 'inline-block'); } }); }; But that hasn't worked. The key issue I am having a p…
has answer: http://stackoverflow.com/a/29496944
has answer: http://stackoverflow.com/a/29467594
linked to: http://stackoverflow.com/q/19032597
has comment: http://stackoverflow.com/comment/45846423
tagged with: jquery
has comment: http://stackoverflow.com/comment/45576547
has answer: http://stackoverflow.com/a/28837762
favorite count: 0
has answer: http://stackoverflow.com/a/28889042
has comment: http://stackoverflow.com/comment/45550448
has comment: http://stackoverflow.com/comment/47140817
has answer: http://stackoverflow.com/a/29401631
answer count: 10
tagged with: asset-pipeline
has comment: http://stackoverflow.com/comment/45543095
has answer: http://stackoverflow.com/a/28896096
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/16754227
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/45543417
downvote count: 1
type: Question
score: 3
has comment: http://stackoverflow.com/comment/45568629
has answer: http://stackoverflow.com/a/29477955
has answer: http://stackoverflow.com/a/29477422
has comment: http://stackoverflow.com/comment/45575464
has comment: http://stackoverflow.com/comment/45544487
has comment: http://stackoverflow.com/comment/47172688
tagged with: javascript
has answer: http://stackoverflow.com/a/28865546
has comment: http://stackoverflow.com/comment/45846013
has comment: http://stackoverflow.com/comment/45576416

http://stackoverflow.com/q/28740636
has body: I'm using a lightbox (highslide JS / highslide.com) which when opens displays a WYSIWYG Javascript editor (CKEditor / ckeditor.com). I call the lightbox (or expander) like so: click here In the parent page I include the javascript for the editor: The first line (truncated) of ckeditor.js is: (function(){if(window.CKEDITOR&&window.CKEDITOR.dom)return;if(!window.CKEDITOR)window.CKEDITOR=(function() My problem, is that the editor does not work in the expander - TypeError: parent.window.hs.CKEDITOR is undefined To fix this I need to call the ckeditor.js in script.php which makes the expander slow to open as it has to pull the JS file again, even though the parent window has already done so. CK editor is called thus in iframe: I have tried prefixing CKEDITOR with 'parent' , 'parent.window', 'window' all without success If there any fix for this? Thank you!
has title: Lightbox: can't access parent javascript obj from iframe
tagged with: highslide
type: AnsweredQuestion
tagged with: iframe
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28761395
tagged with: ckeditor
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28761395

http://stackoverflow.com/comment/45732048
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28722399
score: 1
has text: You should have a look at [JavaScript closure inside loops – simple practical example](http://stackoverflow.com/q/750486/218196)

http://stackoverflow.com/q/28615593
has body: I'm running into an issue with beforeValidate(), and can't find any answers online. My model has two relationship attributes that require id numbers in POSTed data. If a user POST strings instead, they get a validation error. I want to enable the user to POST string data, then inside beforeValidate() use findOrCreate() to find or create the attribute's related model, then overwrite the POSTed data's attribute with the relate model's ID. I have the following model: attributes: { reporter : { model: 'reporter', required: true }, location : { model: 'location', required: true }, line : { type: 'boolean', required: true, defaultsTo: true }, count : { type: 'int', required: true, defaultsTo: 0}, composition : { type: 'int', required: true, defaultsTo: 3} }, beforeValidate: function(values, next) { if (typeof values.reporter !== 'number') { Reporter.findOrCreate({name: values.reporter}).exec(function(data){ console.log(data) values.reporter = data.id; }) }; next(); }, I'm POSTing this data to the model's create() default blueprint endpoint: { "location":"Harry's", "reporter":"tim", "count":30, "composition":3, "line":false } When I log the above values inside beforeValidate(), I get this: { location: NaN, reporter: NaN, count: '30', composition: '3', line: false } When I replace "location" and "reporter" with ID's, I don't get any errors. Why are the string values getting stripped out in the beforeValidate() function?
type: Question
tagged with: sails.js
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28616900
type: UnansweredQuestion
has title: Sails.js beforeValidate() emptying value parameter

http://stackoverflow.com/a/28816250
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28679534
type: AcceptedAnswer
downvote count: 0
has body: Well one, in your tags section, you open a tag but never close it. That is likely your odd error you're not defining. Not so much as the placements of the scripts or the order they are in. As for adding a button to your UI, sometimes the way datatables explains it, it won't always work in your favor, more so as those buttons are flash based. I'd say for the sake of example: after your call to $('#myDatatable').dataTable({}); Simply append the element via standard jquery methods.. ie: $('#myDatatable').append(' Hello '); Again primarily for the sake of example, you can tweak as needed but you can basically get this right up snug next to those buttons should you like you could likely get it in the button container, but then your going to mess with extra styling, positioning, etc.. easiest to go next to all around if your getting a feel for things overall.
type: Answer
accepted answer of: http://stackoverflow.com/q/28679534

http://stackoverflow.com/q/28610794
tagged with: angularjs
upvote count: 2
accepted answer: http://stackoverflow.com/a/28611345
has comment: http://stackoverflow.com/comment/45526050
has comment: http://stackoverflow.com/comment/45525706
score: 2
type: AnsweredQuestion
has body: I'm trying to add ng-strict-di (to help throw errors anytime DI isn't done correctly for a controller/directive/etc). I have a globalApp module containing miscellaneous helper directives / httpInterceptors etc. Is it possible to add it there somehow? I found this solution, but this module never gets bootstrapped to the page, it's simply Injected into a child Module on a page. angular.bootstrap(document, ['globalApp'], { strictDi: true }); But this simply breaks, since the page is already bootstrapped with an ng-app="app" on each specific page using angular. How else can this be achieved?
has title: Force ng-strict-di globally not just on an ng-app level
type: Question
tagged with: dependency-injection
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28611345
answer count: 1
favorite count: 0

http://stackoverflow.com/q/28650815
tagged with: matrix
favorite count: 0
score: 2
upvote count: 3
type: UnansweredQuestion
downvote count: 1
type: Question
tagged with: webgl
tagged with: gl-matrix
has answer: http://stackoverflow.com/a/28653961
has comment: http://stackoverflow.com/comment/45604862
has body: I'm having trouble finding the final bone matrices for my skeleton. I know my bind pose matrices work, and I know my transform matrices work, but I figured multiplying them (which I'm calling the composite matrix) then multiplying them by its parents composite matrix (then by its parents parent, etc.) would get me the correct matrix. Its worth noting I'm using gl-matrix.js as my vector / matrix math library, its matrix math works in reverse, getting a world matrix requires, PositionMatrix * RotationMatrix * ScaleMatrix, instead of the other way around. so I may be getting the orders mixed up, I've tried changing the multiplication orders of the bind pose matrices and the bone transform matrices, as well as the order of final matrix and parent matrices, but I'm just mind boggled now. Anyway to wrap this question up in a bow, Given a mesh where every vertex is pre-transformed to its relative bone(s) space, each bones bind pose matrix and each bones per frame transform matrix how would I find the final bone matrix? EDIT: still having issues but it may help to say where I am at the moment, the following psuedo code gets the model perfectly into its bind pose finalBones = [] foreach bone in bones mat = bone.poseMatrix parent = bone while (parent.parent != null) parent = parent.parent mat *= parent.poseMatrix finalBones.push(mat) the above snippest is exactly whats going on without needing to explain the matrix functions (its javascript so its done via functions like mat4.copy and mat4.mul) I figured if I did something like finalBones = [] foreach bone in bones mat = bone.poseMatrix mat *= bone.transformMatrix parent = bone while (parent.parent != null) parent = parent.parent mat *= parent.poseMatrix mat *= parent.transformMatrix finalBones.push(mat) I would get the final matrix (and I have tried using the transformMatrices before the poseMatrices) but all I get is a model with a broken spine and inside out legs EDIT 2: so on further inspection, the bone transform matrice…
answer count: 1
tagged with: javascript
has title: How do I calculate the final bone matrix in skeletal animation?
tagged with: skeletal-animation

http://stackoverflow.com/comment/45572170
comment on: http://stackoverflow.com/q/28636208
score: 0
type: QuestionComment
has text: What is the text you're trying to use? so what is in the `word` variable?
type: Comment

http://stackoverflow.com/comment/45589448
type: QuestionComment
has text: What do you want to show? A map or text data?
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28641137

http://stackoverflow.com/q/28705602
type: Question
possible better answer: http://stackoverflow.com/a/28706176
accepted answer: http://stackoverflow.com/a/28706187
has answer: http://stackoverflow.com/a/28706176
answer count: 2
tagged with: javascript
score: 0
has title: Javascript in Wordpress widget works only on Home page
has answer: http://stackoverflow.com/a/28706187
has body: I would like to use my widget in every pages, but that works only on home page. I'm still in local for the moment. I'm writing my script in footer.php before the end of body like that : I've seen that when I'm not on home page, when I inspect with developper tools, my script .js is red and not well imported. How can I make that ?
type: AnsweredQuestion
tagged with: wordpress

http://stackoverflow.com/comment/45651015
type: Comment
type: QuestionComment
has text: `X-Frame-Options` is an HTTP response header. You set it either in your web server configuration or server side code. There isn't enough information about your system in the question to suggest the best way for *you* to do it.
comment on: http://stackoverflow.com/q/28678969
score: 0

http://stackoverflow.com/q/28623082
has body: I have a json data and i am trying to split it into 2 sets of data arrays One json data will hold all the values from "Type1" data values and the 2nd json data will hold the rest values using jquery My Json code { "Type1" : "name", "1" :"one", "2" : "two" } { "Type1" :"value", "3" :"three", "4" :"four" }
has comment: http://stackoverflow.com/comment/45547872
has comment: http://stackoverflow.com/comment/45548026
tagged with: javascript
score: 0
answer count: 3
tagged with: jquery
has comment: http://stackoverflow.com/comment/45547900
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28623216
has comment: http://stackoverflow.com/comment/45547841
has comment: http://stackoverflow.com/comment/45547887
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45548385
has answer: http://stackoverflow.com/a/28623431
has answer: http://stackoverflow.com/a/28623422
has title: How to split JSON into 2 set of array using jquery
type: Question

http://stackoverflow.com/comment/45586618
score: 1
has text: @Kiranarya - If I remembered correctly there's a trick that you can do to force it to load the page without using the cache by inserting a query: `https://www.google.com/?t=some_time`
type: Comment
comment on: http://stackoverflow.com/q/28644209
type: QuestionComment

http://stackoverflow.com/q/28649593
type: Question
tagged with: mongodb
has comment: http://stackoverflow.com/comment/45596892
has comment: http://stackoverflow.com/comment/45596948
tagged with: javascript
has answer: http://stackoverflow.com/a/28651785
has comment: http://stackoverflow.com/comment/45597301
has title: How to Ensure a Unique Email, userName will Enter into MongoDB using Mongoose
answer count: 1
tagged with: mongoose
favorite count: 0
accepted answer: http://stackoverflow.com/a/28651785
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45597214
upvote count: 2
score: 1
has comment: http://stackoverflow.com/comment/45597254
downvote count: 1
has body: db.UserSchema = new db.Schema({ userName: {type:String, unique:true, required:true,index:true}, emailId: {type:String, unique:true, required:true,index:true}, password: {type:String, required:true}, contactNumber: String, region: String, isActive:Boolean, lastLoginDateTime:Date }); Above is the schema I would like to put into MongoDB, but email and userName should be unique and I am unable to do that.

http://stackoverflow.com/comment/45597186
comment on: http://stackoverflow.com/q/28649904
type: Comment
type: QuestionComment
score: 0
has text: You cannot have comparisons in case statements. That's not how they work.

http://stackoverflow.com/a/28684931
downvote count: 0
has comment: http://stackoverflow.com/comment/45663256
has comment: http://stackoverflow.com/comment/45663739
upvote count: 2
answers question: http://stackoverflow.com/q/28684902
has comment: http://stackoverflow.com/comment/45662596
has comment: http://stackoverflow.com/comment/45662616
has body: Use \b that denotes a word boundary. E.g. \bAI\b.
has comment: http://stackoverflow.com/comment/45663390
has comment: http://stackoverflow.com/comment/45663336
has comment: http://stackoverflow.com/comment/45663271
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45663679

cross-browser
tags question: http://stackoverflow.com/q/28593679
tags question: http://stackoverflow.com/q/28746595
tags question: http://stackoverflow.com/q/28640781
tags question: http://stackoverflow.com/q/28636187
tags question: http://stackoverflow.com/q/28596910
type: Tag
tags question: http://stackoverflow.com/q/28633221
tags question: http://stackoverflow.com/q/28657586
tags question: http://stackoverflow.com/q/28647113
tag name: cross-browser
tags question: http://stackoverflow.com/q/28728614

http://stackoverflow.com/comment/45525138
comment on: http://stackoverflow.com/q/28610687
has text: I pasted you code directly into jsfiddle: http://jsfiddle.net/gyuj5yrt/ and it works fine. Whats the problem?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28680785
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45654554
type: Answer
downvote count: 0
score: 1
has body: What is happening is you are getting the outline property add around your selection this happens on chrome alot when you click buttons or focus on something. Try adding a class similar to this SELECTION:focus {outline:0;} to the object that is being highlighted or anchortag without seeing the code and what it is doing its hard to pinpoint the exact class
accepted answer of: http://stackoverflow.com/q/28680597
answers question: http://stackoverflow.com/q/28680597

http://stackoverflow.com/q/28743029
has comment: http://stackoverflow.com/comment/45770065
answer count: 1
tagged with: javascript
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28743210
has body: I am designing dynatree so nodes are place in ul and li tags. the problem I am getting is I am not getting parents of clicked li element. Here is my html code, gp1 gp2 gp3 c1 c2 c3 gp4 gp5 gp6 gp7 c4 c5 c6 gp8 gp9 gp10 Here is my jquery method $('ul.bulk li').click(function(e) { //alert($(this).find("span.t").text()); alert(e.html()); }); Here is my fiddel http://jsfiddle.net/raghavendram040/ojnLrcjz/ The problem I am getting is if click on gp3 it alerts me 3 times, but I want if I click on gp3 it should alert its parents(gp1 and gp2). Here I place all li and ul dynamically except tag. How to achive this please help me in this
tagged with: jquery
has title: How to get all parents of tag onclick of it?
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/28743210
score: 0

http://stackoverflow.com/q/28681512
has comment: http://stackoverflow.com/comment/45656010
has title: Ajax `appendTo` replaces the existing element
has comment: http://stackoverflow.com/comment/45655884
type: Question
has body: I am trying to submit some form data to Servlet using JQuery and retrieve the Servlet response from the same JQuery. Please have a look at the below code. <%-- Document : index Created on : Feb 23, 2015, 8:18:52 PM Author : Yohan --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> JSP Page Name Submit In the above code in JQuery section, I am trying to read the value I got from servlet, create a Text Input in a DIV. My expectation was if I click the "Submit" button twice, then 2 text boxes; if I click the submit button thrice, then 3 text boxes and so on. Unfortunatly it is not happening here. Only one text box appear, all the time, replacing the previous one. How can I fix this?
tagged with: javascript
has comment: http://stackoverflow.com/comment/45655954
has comment: http://stackoverflow.com/comment/45655933
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45656394
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/45655975
has answer: http://stackoverflow.com/a/28682108
accepted answer: http://stackoverflow.com/a/28682108
has comment: http://stackoverflow.com/comment/45655916
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45655786
type: AnsweredQuestion

http://stackoverflow.com/comment/45616064
type: QuestionComment
has text: @MukeshAgarwal or when someone goes out of the page, to the address bar, for example. Sorry, I forgot that point in my last comment.
comment on: http://stackoverflow.com/q/28658464
score: 0
type: Comment

http://stackoverflow.com/comment/45733435
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28720931
has text: @f484126 I believe that edit should answer your question.
type: AnswerComment

http://stackoverflow.com/comment/45557882
has text: Why one see "WebForm.aspx" on the picture instead of "...simpleLocalGrid_.htm"? Can you just open [the demo](http://www.ok-soft-gmbh.com/jqGrid/simpleLocalGrid_.htm) directly on the computer which have problems?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28625069
score: 0

http://stackoverflow.com/comment/45638818
has text: i didnt its my answer too @AshleyMedway
comment on: http://stackoverflow.com/a/28672641
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28619401
answers question: http://stackoverflow.com/q/28617590
score: 0
has body: Yes you are right. Its actaully documeented ngModel doesnt watch for deep changes and so doesnt zpdate view when model change deeply: https://docs.angularjs.org/api/ng/type/ngModel.NgModelController So you need to add ngModel value to the directive scope in order to use $watch on it: scope:{'ngModel':'='} and then add watch that will update view value into directive link function: scope.$watch ('ngModel', function (newval) { ngModel.$viewValue = toJson(newval); ngModel.$render(); }, true); See demo: http://codepen.io/anon/pen/xbWamy
type: Answer

http://stackoverflow.com/a/28628160
upvote count: 0
has body: Try this google.maps.event.addDomListener(window, 'load', initialize);
has comment: http://stackoverflow.com/comment/45557783
has comment: http://stackoverflow.com/comment/45558110
score: -1
downvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28627831

http://stackoverflow.com/comment/45687778
score: 0
type: AnswerComment
has text: of course you may ask, but when the question is not related to the current question you better [ask a new question](http://stackoverflow.com/questions/ask)
type: Comment
comment on: http://stackoverflow.com/a/28698695

http://stackoverflow.com/comment/45665874
type: AnswerComment
comment on: http://stackoverflow.com/a/28653767
score: 0
has text: You try to display in console what you get in your servlet? If you don't get the parameter with his name it will not work
type: Comment

http://stackoverflow.com/a/28633666
has comment: http://stackoverflow.com/comment/45575497
type: Answer
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/45575410
has comment: http://stackoverflow.com/comment/45572655
has body: Well I'm not 100% sure what is going on in that huge block of code. However if you set your cookies domain to .apus.edu then it will be available to *.apus.edu. I.E. Where you have: Set_Cookie(CookieNameAMU, CookieValueAMU, '', '/', '', ''); Should be Set_Cookie(CookieNameAMU, CookieValueAMU, '', '/', '.apus.edu', '');
accepted answer of: http://stackoverflow.com/q/28633588
answers question: http://stackoverflow.com/q/28633588
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45526112
type: Comment
comment on: http://stackoverflow.com/a/28610741
score: 0
type: AnswerComment
has text: You Need to include the jquery source file; you can download it here : http://jquery.com/download/

http://stackoverflow.com/q/28746291
upvote count: 1
tagged with: searchbar
type: Question
has comment: http://stackoverflow.com/comment/45776602
has comment: http://stackoverflow.com/comment/45774830
score: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Dispose forms in circle around a bigger form
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has body: I want to realize a search bar, with other mini search bars around her the code of the search bar would be similar as Search the disposition would be like any tips to do this, css3, html5, js or jquery nice accepted! then i want to move them inside when i click one of the "around" search bar, like: maybe using http://visionmedia.github.com/move.js/ plug in, well if someone have tips also for this would be really interesting thank you in advance!
tagged with: css
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/28710702
has comment: http://stackoverflow.com/comment/45710782
score: 0
answer count: 2
has title: How to disable save as dialog in Chrome?
tagged with: dom-events
favorite count: 0
linked to: http://stackoverflow.com/q/93695
has answer: http://stackoverflow.com/a/28710795
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/120496637
linked to: http://stackoverflow.com/q/14561988
upvote count: 2
downvote count: 2
has comment: http://stackoverflow.com/comment/45710252
tagged with: google-chrome
has body: I have following code. window.onkeypress = function(event) { if (event.charCode === 115 &amp;&amp; event.ctrlKey) { event.preventDefault(); // your code here.... alert("'Save As' dialog suppressed!"); } }; That code works on Firefox, but in Chrome it doesn't work. Can you help me?
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/68178088

http://stackoverflow.com/comment/45611711
type: AnswerComment
has text: Looks good but when you click, white screen appears for a secound and then when you slide right , you can see that picture is disappearing.
type: Comment
comment on: http://stackoverflow.com/a/28657772
score: 0

http://stackoverflow.com/comment/45697452
type: Comment
type: QuestionComment
has text: `{{obj.prop}}` was just a placeholder. I'm actually using `{{userInfo.fname}}` to try and write out to the page. Logging `$scope.userInfo` returns the object properly but can ONLY be done while inside the `getUserData.getUserInfo()` declaration.
comment on: http://stackoverflow.com/q/28703529
score: 0

http://stackoverflow.com/comment/45518308
type: AnswerComment
score: 0
type: Comment
has text: I tried this way (removed html tags) for(var i=1; i<=3; i++) { alert("I get "+i+" objects!"); } After that, running it I have error of compilation: Syntaxis error
comment on: http://stackoverflow.com/a/28607118

http://stackoverflow.com/comment/45542968
score: 0
has text: What version of coffeescript are you running? `coffee -c file.coffee` with your code gives me [this](https://gist.github.com/sethkrasnianski/db5871d374a47a11ace2)
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28619960

http://stackoverflow.com/comment/45858489
comment on: http://stackoverflow.com/a/28790432
score: 0
type: Comment
has text: I *am* using the JSONLoader. But I'm doing it in a worker thread, and am now looking for a way to communicate the resulting geometry (after modification) back to the main thread.
type: AnswerComment

http://stackoverflow.com/q/28668226
favorite count: 0
has title: Charset UTF-8 for external JavaScript file
tagged with: http://stackoverflow.com/tag/html
tagged with: utf-8
has answer: http://stackoverflow.com/a/44421089
has comment: http://stackoverflow.com/comment/45631830
downvote count: 0
has answer: http://stackoverflow.com/a/28668490
accepted answer: http://stackoverflow.com/a/28668490
has body: I add an external JavaScript file like this: But the text stored in panel.js file is displayed like this in the HTML file: H69�* When I put JavaScript code in the HTML page, the text is displayed properly. But when I put JavaScript code in panel.js, it does not work.
type: Question
score: 2
type: AnsweredQuestion
tagged with: character-encoding
possible better answer: http://stackoverflow.com/a/44421089
has comment: http://stackoverflow.com/comment/45630661
has comment: http://stackoverflow.com/comment/45630691
upvote count: 2
answer count: 2
tagged with: javascript

http://stackoverflow.com/comment/45802734
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28692888
has text: I've added my controller for a post in the end but this isn't working... when I do something like {{accommodaiton}} in the form it's reading the value correctly and changing as I change it but when the form is submited the POST request has accommodaiton as null always

http://stackoverflow.com/q/28640555
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45580264
score: 0
has title: Make a Javascript/JQuery Slidedown menu start hidden instead of showing
answer count: 1
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28640658
type: AnsweredQuestion
has body: I was wondering if you guys could help me with my Slidedown menu. It starts with the content showing and I want to make it start hidden so when you click the button it will show and it wont start showing the content. Heres my code: var test = $('#test'), toggle = $('#toggle'); toggle.click(function() { test.slideToggle(1000, function() { }); }); PASSWORD PROTECTION Down Menu Click Login Login
type: Question
accepted answer: http://stackoverflow.com/a/28640658

http://stackoverflow.com/comment/45743641
comment on: http://stackoverflow.com/q/28728542
type: QuestionComment
has text: This may be more complicated depending on where you are trying to do this
score: 0
type: Comment

http://stackoverflow.com/q/28703872
tagged with: javascript
tagged with: express
score: 0
has body: I'm trying to setup my very first Node.js + express web app using Openshift's free service. I installed node + npm and the openshift tools on my computer, and tried to run my app. On my local machine everything works fine, but after I push my project to Openshift site, it always gives the '503 Service Unavailable' error. I tried to rhc app restart -a firstapp ,but it didn't solve the problem. I also checked the package.json and it is correct. Here's my code: var express = require('express'); var app = express(); var fs = require('fs'); var parser = require('body-parser'); //Setup ip adress and port var ipaddress ; function initIPAdress() { var adr = process.env.OPENSHIFT_NODEJS_IP; if (typeof adr === "undefined") { // Log errors on OpenShift but continue w/ 127.0.0.1 - this // allows us to run/test the app locally. console.warn('No OPENSHIFT_NODEJS_IP var, using localhost'); adr = 'localhost'; } ipaddress = adr; } var port = process.env.OPENSHIFT_NODEJS_PORT || 8080; app.get('/', function (req, res) { res.send('Hello World!') }) app.get('/admin', function (req, res) { res.setHeader('Content-Type', 'text/html'); res.send( fs.readFileSync('./index_admin.html') ); }) app.listen(port, ipaddress, function() { initIPAdress();//Call setup ip adress console.log('%s: Node server started on %s:%d ...', Date(Date.now() ), ipaddress, port); });
tagged with: node.js
tagged with: openshift
type: AnsweredQuestion
tagged with: server
has title: Openshift always gives 503 error for Node.js app
type: Question
has answer: http://stackoverflow.com/a/28704018
accepted answer: http://stackoverflow.com/a/28704018
answer count: 1

popover
tags question: http://stackoverflow.com/q/28593579
type: Tag
tag name: popover

http://stackoverflow.com/comment/63977375
type: Comment
score: 0
has text: how can you debug to know what is inside the "event.description"?
type: AnswerComment
comment on: http://stackoverflow.com/a/28647182

http://stackoverflow.com/comment/45773887
has text: Btw, do you think getting `outerHTML` instead of `innerHTML` would be better?
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28726881

http://stackoverflow.com/q/28677690
has comment: http://stackoverflow.com/comment/45651003
answer count: 1
has body: I'm creating a D3 app that's going to display some simple data using an Express server, and Ampersand on the client side. Eventually, I'll want to send the data to the browser dynamically, as the entire dataset could get very large. For now, though, I'm having trouble getting even the simplest of things working. I've set up a simple Express server, and it's rather simple: // Boilerplate express code var express = require('express'); var app = express(); var path = require('path'); // Make the Public directory available to the browser app.use(express.static(__dirname + '/public')); app.get('/', function(req, res) { res.sendFile('d3.html', {'root': path.join(__dirname, '/views') }); }); // Listen on port 3000 app.listen(3000); That works rather well. When I visit the page, it loads a blank D3 bar graph (just the axis), but shows no data. This is because I've not sent the data to the browser, and, as I understand it, this needs to be done using either AJAX, jQuery, or something else. I'm not sure how to proceed with this. This is in my d3.html; it reads its data from data.tsv, which I've placed in the public folder of my Express server: d3.tsv("data.tsv", type, function(error, data) { x.domain(data.map(function(d) { return d.letter; })); y.domain([0, d3.max(data, function(d) { return d.frequency; })]); This is data.tsv: letter frequency A .08167 B .01492 C .02782 D .04253 E .12702 F .02288 G .02015 H .06094 I .06966 J .00153 K .00772 L .04025 M .02406 N .06749 O .07507 P .01929 Q .00095 R .05987 S .06327 T .09056 U .02758 V .00978 W .02360 X .00150 Y .01974 Z .00074 How do I pass the data to the browser so that d3.html can read in the data? I don't care if the data is in data.tsv or not; I just need to send the equivalent data somehow. I'm not familiar with it, but I have a hunch that Ampersand can handle the requesting/receiving of this data, but I'm not sure how.
has comment: http://stackoverflow.com/comment/45650877
has title: How do I use Express and Ampersand simultaneously?
has answer: http://stackoverflow.com/a/28683471
has comment: http://stackoverflow.com/comment/45648674
tagged with: ampersand.js
accepted answer: http://stackoverflow.com/a/28683471
tagged with: node.js
type: AnsweredQuestion
tagged with: d3.js
score: 0
has comment: http://stackoverflow.com/comment/45650537
type: Question
tagged with: javascript
tagged with: express

http://stackoverflow.com/comment/45715164
type: AnswerComment
type: Comment
has text: $(function () { $("#<%= TextBox1.ClientID%>,#<%= TextBox2.ClientID%>").keyup(function () { $("#<%= Label1.ClientID%>,#<%= Label2.ClientID%>").text($(this).val()); }); }); while changing textbox1 ..its updating both labels. i just want to update one by one
comment on: http://stackoverflow.com/a/28712970
score: 0

http://stackoverflow.com/q/28607502
tagged with: ractivejs
accepted answer: http://stackoverflow.com/a/28608611
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: checkbox
has title: Catch on-click event on checkboxes
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28608108
has body: I try to get the click on a checkbox using RactiveJS, as follows: HTML: &lt;input type='checkbox' on-change-input-click="toggle"&gt; JS: toggle : function(){ treatment() } The toggle function never gets called. Why would I like to catch the toggle event? Because once the checkbox toggled, other components must be changed. More precisely, this is a checkbox in a tree. Toggling a checkbox in a tree node toggles the descendants nodes. Maybe there is another event than change, input or click I missed... The complete code is in this fiddle.
has answer: http://stackoverflow.com/a/28608611
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28608108
type: AnsweredQuestion

http://stackoverflow.com/q/28647196
has answer: http://stackoverflow.com/a/28651228
upvote count: 1
has body: I feel I'm stuck in figuring out a resolution to my mvc.NET / angularjs project. Currently I feel I did a great job by abstracting the view to use a controller that's the the type name of the controller.cs specific class for example: &lt;body ng-controller="@Model.ControllerType.Name"&gt; ... &lt;/body&gt; this is the controller superSiteApp.controller("MediaController", ["$scope", "$window", "SubNavFactory", function ($scope, $window, SubNavFactory) { ... }); This work seems to work out great, but recently I've been struggling with subnav related items. With one section I basically brute force it (because it isn't a service like so) In this case I'm setting up a factory: var superSiteApp = angular.module('superSiteApp', []); superSiteApp.factory("SubNavFactory", ["subNavCollectionWrapper", function (subNavCollectionWrapper) { return { get: function() { return subNavCollectionWrapper.get(); } }; }]); Later I push it in here like so: @section AdditionalHeaderLinks { &lt;script language="javascript" type="text/javascript"&gt; superSiteApp.value("subNavCollectionWrapper", { get: function() { return @Html.Raw(Json.Encode(Model.Menus[1].Links)); } }); &lt;/script&gt; } This part works great, but now I need to do one where I call the api. So the idea is something like: superSiteApp.service("SubNavFactoryUri", ["$http", "uri", function ($http, uri){ return $http.get(uri); }]); This is where I'm lost. In my new View.chtml file, I don't know how to make that connection work. @section AdditionalHeaderLinks { &lt;script language="javascript" type="text/javascript"&gt; superSiteApp.value("subNavCollectionWrapper", /* this is my struggle */); &lt;/script&gt; } I can't figure out how to reference the service to pass it in. Yes, I could create a function class on my own, but I thought I'd leverage angularjs. Maybe the approach is incorrect here, as it's the only thing I could think of doing. Any advice would be greatly appreciated. Thanks
type: AnsweredQuestion
score: 1
type: Question
tagged with: c#
tagged with: asp.net-mvc
has title: need to store a service/factory as a value
tagged with: javascript
has comment: http://stackoverflow.com/comment/45592568
accepted answer: http://stackoverflow.com/a/28651228
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45592389
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/comment/45756487
comment on: http://stackoverflow.com/a/28735913
score: 0
type: AnswerComment
has text: i got this error from firebug: TypeError: deferred.pomise is not a function?
type: Comment

http://stackoverflow.com/comment/54811617
type: QuestionComment
has text: and for older than IE10 I think you can use `window.onfocus` and `window.onblur`
comment on: http://stackoverflow.com/q/28658562
score: 0
type: Comment

http://stackoverflow.com/comment/45595278
comment on: http://stackoverflow.com/q/28648588
type: Comment
type: QuestionComment
has text: meteoric is without angular. check out ratchet as well
score: 0

http://stackoverflow.com/q/28716971
has answer: http://stackoverflow.com/a/28750458
tagged with: unit-testing
tagged with: angularjs-directive
type: AnsweredQuestion
has body: I'm trying to understand how to unit test my directive in my situation below. Basically I'm trying to unit test a directive which has a controller. On the loading of this directive the controller makes a http request by a service which brings some data to the controller again then provides this data to the directive view. On the scenario below in my understanding I should do: A $httpBackend to avoid an exception when the http request is done; Populate the fake data to be able to unit test the directive with diff behaviors Compile the directive What I've been trying so far, as you can see, is override the Service with the fake data. What I could not make work so far. Some doubts come up now. As you can see in my Controller. I'm providing the whole Service to the view: $scope.ItemsDataservice = ItemsDataservice; What makes me believe that my approach to override the Service should work. My question: On scenario below I understand that I could override the Service to manipulate the data or even override the controller to manipulate the data by scope. What's the right thing to do here? Am I understand wrong? Am I mixing the unit tests? In my current unit test code, when I'm applying the fake data(or not), is not make any difference: ItemsDataservice.items = DATARESULT; ItemsDataservice.items = null; Controller: angular.module('app') .controller('ItemsCtrl', function ($scope, $log, ItemsDataservice) { $scope.ItemsDataservice = ItemsDataservice; $scope.ItemsDataservice.items = null; $scope.loadItems = function() { var items = []; ItemsDataservice.getItems().then(function(resp) { if (resp.success != 'false') { for (resp.something ... ) { items.push({ ... }); }; ItemsDataservice.items = items; }; }, function(e) { $log.error('Error', e); }); }; $scope.loadItems(); }); Service: angular.module('app') .service('ItemsDataservice', function ItemsDataservice($q, $http) { ItemsDataservice.getItems = function() { var d = $q.defer(); var deffered = $q.defer(); var url = 'http://some-…
type: Question
answer count: 1
accepted answer: http://stackoverflow.com/a/28750458
has title: Unit testing a directive - Unable to force a fake data
tagged with: javascript
score: 0
tagged with: angularjs

http://stackoverflow.com/comment/45637644
type: Comment
has text: Not sure why you have a problem. `$('.wpb_wrapper span')` will access the spans.
score: 0
comment on: http://stackoverflow.com/q/28671984
type: QuestionComment

http://stackoverflow.com/comment/45699732
has text: @JuanMendes , i will try to reframe my question .
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28704104

http://stackoverflow.com/comment/45605772
has text: Possibly related (also interesting reading) https://stackoverflow.com/questions/8284365/external-css-vs-inline-style-performance-difference
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28654417

http://stackoverflow.com/comment/45547345
has text: I am trying to redirect it to another page. So, using AJAX won't help me change the view page in browser.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28622783
type: Comment

http://stackoverflow.com/q/28743622
tagged with: javascript
has comment: http://stackoverflow.com/comment/45769879
has body: I need to know what page i'm on based on the URL. When i use $(location).attr('href')i get a very long url like this: http://localhost:8181/research/gadgets/ifr?container=default&amp;mid=0&amp;nocache=0&amp;country=ALL&amp;lang=ALL&amp;view=default&amp;nerwVersion=~project.version~&amp;url=http%3A%2F%2Flocalhost%3A8181%2Fresearch%2Fnerw-gadgets%2FCompanyDetails%2FCompanyDetails.xml&amp;oaaParent=http%3A%2F%2Flocalhost%3A8181 The URL in the browser looks like this: http://localhost:8181/research/?view=home How do i get the view=home bit?
score: 0
has answer: http://stackoverflow.com/a/28743677
linked to: http://stackoverflow.com/q/901115
accepted answer: http://stackoverflow.com/a/28743677
answer count: 1
tagged with: jquery
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45769875
duplicate of: http://stackoverflow.com/q/901115
type: Question
has title: Get page name from URL

textbox
tags question: http://stackoverflow.com/q/28598997
tags question: http://stackoverflow.com/q/28650506
tag name: textbox
type: Tag

http://stackoverflow.com/q/28703060
score: 0
has title: How to dynamically create $rootScope.$on event listeners in a for loop in angularjs
answer count: 1
tagged with: dom-events
has body: I want to dynamically create event listeners in an angularjs service, however it seems that each $rootScope.$on event listener I create in the for loop in the service is overwritten by the following event listener. How can I dynamically create $rootScope.$on even listeners without overwriting the previous event listener? I create events using broadcasts from my controller like $rootScope.$broadcast(EVENTS.userDeleteSuccess.event);. My EVENTS constant looks like: myApp.constant('EVENTS', { userDeleteSuccess: { event: 'user-delete-success', type: 'success', message: 'User successfully deleted' }, ..., siteDeleteSuccess: { event: 'site-delete-success', type: 'success', message: 'Site successfully deleted' } } My service looks like: myApp.service("Alert", function($rootScope, EVENTS) { var show = function(type, message) { $rootScope.alert = { type: type, message: message, show: true }; }; // Initialized on application startup, this is the problem method! this.initialize = function() { for(var event in EVENTS) { if(!EVENTS.hasOwnProperty(event)) break; var _event = EVENTS[event]; $rootScope.$on(_event.event, function() { show(_event.type, _event.message); }); } }; return this; }); The only event that ever gets broadcasted is always the last event in the object (siteDeleteSuccess in this case). How can I dynamically create an event listener in a for loop that doesn't overwrite the previous $rootScope.$on event listener?
tagged with: angularjs
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28703222
type: Question
has answer: http://stackoverflow.com/a/28703222
tagged with: javascript

http://stackoverflow.com/comment/45534647
score: 0
type: AnswerComment
type: Comment
has text: Can I use IIS Express since I am using .NET applications?
comment on: http://stackoverflow.com/a/28615280

http://stackoverflow.com/q/28674628
has comment: http://stackoverflow.com/comment/45642508
upvote count: 1
tagged with: forms
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45642798
has comment: http://stackoverflow.com/comment/45642819
accepted answer: http://stackoverflow.com/a/28675028
tagged with: asp.net-mvc
tagged with: javascript
tagged with: jquery
tagged with: ajax
linked to: http://stackoverflow.com/q/4007969
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45642757
has answer: http://stackoverflow.com/a/28674702
favorite count: 0
has comment: http://stackoverflow.com/comment/45642717
has body: I'm trying to implement reCAPTCHA in my MVC site, but it doesn't Validate unless I submit it from a form, like this: @using(Html.BeginForm("VerifyCaptcha", "Signup") ) { @ReCaptcha.GetHtml(theme: "clean", publicKey: "6LcnfAITAAAAAAY--6GMhuWeemHF-rwdiYdWvO-9"); &lt;input type="submit" id="btnVerify" value="Verify" /&gt; } [HttpPost] public ActionResult Index(PolicyModel model) { var result = ReCaptcha.Validate(privateKey: "THE_KEY"); return View(); } I don't want to use form submission because I don't want to return a new view. All my data is being pushed around with ajax in json form. What I'd like to do is: $.ajax({ url: 'verifyCaptcha', dataType: 'json', contentType: "application/x-www-form-urlencoded", type: "POST", async: false, success: function (response) { alert(response); }, error: function(response) { alert('There was a problem verifying your captcha. Please try again.'); } }); return valid; [HttpPost] public ActionResult VerifyCaptcha() { var result = ReCaptcha.Validate(privateKey: "THE_KEY"); return Json(result); } The ajax call gets to the controller, but the Validation method completes immediately, almost as if it doesn't even get to making the request. I'm not sure why the validation always fails if the captcha isn't in a form - is it perhaps losing information like it's public key or something? Is there a workaround to this? Edit: Added the ajax controller action method without model.
possible better answer: http://stackoverflow.com/a/28674702
has answer: http://stackoverflow.com/a/28675028
has title: Data from the Form Submit vs Data from Ajax
type: AnsweredQuestion

http://stackoverflow.com/comment/45502070
has text: The `allPresent` helper uses `Ember.isPresent`, and so it follows the same semantics. `Ember.isPresent(false)` returns `true`, so it works in that sense.
type: AnswerComment
comment on: http://stackoverflow.com/a/28597519
type: Comment
score: 1

http://stackoverflow.com/q/28681738
has comment: http://stackoverflow.com/comment/45656476
type: Question
has comment: http://stackoverflow.com/comment/45656995
tagged with: javascript
tagged with: resize
has title: Resize image upon click
tagged with: image
score: 0
answer count: 0
type: UnansweredQuestion
has body: Alright so, I need to resize an image on click (according to what the user clicks) a selection of 50%, 100%, and 150%. I also need to include a message that tells the user what % the picture is at once it has been scaled. I think what I have is correct or in the right direction (well obviously not, since it's not working) wondering if anyone can help me out here... this is what I have currently: Change Image Size CTEC 4350 DHTML Exercise: Change Image Size 50% 100% 150% This image is displayed at 150% of its orignal size. (The number of % changes based on the size option picked by the user.) welp i'm still having issues with this. I need to find out the current size, and then add on to it.... but i'm not sure if i'm doing it correctly... i've changed my code a little, but not even sure if i'm going the right direction. Nothing is changing, and i'm not sure why o.o Change Image Size CTEC 4350 DHTML Exercise: Change Image Size 50% 100% 150% This image is displayed at 150% of its orignal size. (The number of % changes based on the size option picked by the user.)
tagged with: onclick

http://stackoverflow.com/q/28648090
has answer: http://stackoverflow.com/a/47371826
favorite count: 0
has comment: http://stackoverflow.com/comment/45593829
answer count: 5
has comment: http://stackoverflow.com/comment/45594461
upvote count: 29
has comment: http://stackoverflow.com/comment/45595520
type: UnansweredQuestion
has title: Properties vs. Keys vs. Values in JavaScript
score: 29
has comment: http://stackoverflow.com/comment/45593828
type: Question
has answer: http://stackoverflow.com/a/28648123
linked to: http://stackoverflow.com/q/6003819
has comment: http://stackoverflow.com/comment/45594181
has comment: http://stackoverflow.com/comment/45594633
has comment: http://stackoverflow.com/comment/45594912
has body: I'm trying to clarify my understanding of the terms "property" vs. "keys" vs. "values" in the JavaScript realm. After reading a few books on the language and even googling the terms, I still don't feel like I'm clear on their precise meaning. So suppose we have the following: var object = {"name" : 5}; Is my understanding of the following terms correct: property refers to "name" key refers to "name" value refers to 5 I'm most concerned about "property": does it refer to identifiers only, or to the whole name/value pair?
has answer: http://stackoverflow.com/a/58421105
has answer: http://stackoverflow.com/a/78945481
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28648628

http://stackoverflow.com/comment/45675493
score: 0
type: Comment
has text: There is no error in js console. If i will give you html and javascript code sepretly than can u make successful running code>
type: AnswerComment
comment on: http://stackoverflow.com/a/28691561

http://stackoverflow.com/q/28603928
possible better answer: http://stackoverflow.com/a/28605512
has body: I am using the data.js module for highcharts. Data defined in a HTML table. Table like http://jsfiddle.net/a31yzyf1/. Jane John Mark Apples 3 4 1 Pears 2 3 4 So, I want use the data from the first and third columns ("Jane" and "Mark", excluding "John"). How I can do this? The API suggests methods: "startColumn" and "endColumn", but there is nothing like columnList([1, 3]). Or I mistaken?
has answer: http://stackoverflow.com/a/28605512
has answer: http://stackoverflow.com/a/28604791
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/28604878
has title: Parse data from specified columns highcharts.js
type: Question
accepted answer: http://stackoverflow.com/a/28604791
tagged with: highcharts
tagged with: javascript
has comment: http://stackoverflow.com/comment/45512803
answer count: 3

http://stackoverflow.com/comment/45581379
type: AnswerComment
comment on: http://stackoverflow.com/a/28641107
score: 0
type: Comment
has text: I tried your suggestions but i have same issue. Thanks for clear and useful explanation.

http://stackoverflow.com/comment/45522202
comment on: http://stackoverflow.com/q/28609179
score: 0
has text: What's precisely missing ? The value of an assignment expression is the assigned value.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28636906
downvote count: 1
type: Question
tagged with: google-maps
tagged with: javascript
tagged with: google-maps-api-3
upvote count: 3
answer count: 2
has title: Google maps street view panorama options
has answer: http://stackoverflow.com/a/31118203
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28638152
score: 2
has body: I'm utilizing the Street View option with Google Maps but I can't figure out how to customize the controls if don't have the street view as the initial screen. Right now I have: map = new google.maps.Map(mapDiv, { zoom: 14, streetViewControl: true, streetViewControlOptions: { position: google.maps.ControlPosition.TOP_CENTER }, zoomControl:false, disableDefaultUI: false so this will enable the Pegman that you can drag to switch to the street view but I want to disable the close box and the zoom. I did find this API documentation but I'm not sure how to set the controls when I'm not manually creating the street view myself. Any help would be appreciated.

http://stackoverflow.com/comment/45516043
type: AnswerComment
comment on: http://stackoverflow.com/a/28596512
score: 0
has text: changed code to be according to css class's ` `
type: Comment

http://stackoverflow.com/q/28637337
answer count: 2
tagged with: scroll
has body: I'm making a game with HTML canvas and javascript. At the moment, javascript in my head generates the complicated canvas element. In the body is only a small p with instructions. The game is about 1100px x 600 px. If you go to the page with a smaller resolution screen, the remainder of the game is clipped off the edge. I want the page to have a browser-native horizontal and vertical scrollbar they can use to scroll the game. I've looked at various combinations of containers and min-width but I was wondering if there's a standard practice for this?
tagged with: width
has answer: http://stackoverflow.com/a/28637424
type: AnsweredQuestion
tagged with: javascript
has title: How to force an HTML page to have a horizontal scrollbar
accepted answer: http://stackoverflow.com/a/28637424
type: Question
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28637413
has comment: http://stackoverflow.com/comment/45574443
tagged with: css
has answer: http://stackoverflow.com/a/28637413
has comment: http://stackoverflow.com/comment/45574396
score: 0

http://stackoverflow.com/comment/45614989
comment on: http://stackoverflow.com/q/28659642
has text: On what line is the error? What middleware is that `request` coming from
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45749147
score: 0
comment on: http://stackoverflow.com/q/28731505
type: Comment
type: QuestionComment
has text: so only ajax with lot of requests, or making the localstorage using what is already in the html ?

http://stackoverflow.com/comment/45565992
score: 0
type: AnswerComment
type: Comment
has text: Try to check if the JSON is valid at jsonlint.com. For your second question create an array variable and while looping put those url's in the array, so you can use them wherever you want.
comment on: http://stackoverflow.com/a/28632775

http://stackoverflow.com/q/28710382
has title: jQuery Scrolling & Anchor Initial Position
has answer: http://stackoverflow.com/a/28713472
tagged with: smooth-scrolling
type: Question
score: 0
answer count: 1
has body: I'm using this jQuery code for smooth scrolling: $(function() { $('a.page-scroll').bind('click', function(event) { var $anchor = $(this); $('html, body').stop().animate({ scrollTop: ($($anchor.attr('href')).offset().top - 110) }, 1000, 'easeInOutExpo'); event.preventDefault(); }); }); I added the -110 offset to properly adjust the initial position and it's working fine, but every time I try to access the anchor from an external link, the page loads with a different offset value. Please check http://www.iscreatividad.com/clientes/msl/servicios.html#serv-planificacion for a clear view of what the issue is. If you click the first icon it automatically adjusts and you'll see the way it should be loading. Thanks in advance for any help on this matter.
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/28713472
type: AnsweredQuestion

yammer
type: Tag
tags question: http://stackoverflow.com/q/28680113
tag name: yammer

http://stackoverflow.com/comment/45511368
has text: `+=` is used for **Concatenation** of string
comment on: http://stackoverflow.com/q/28603123
type: QuestionComment
type: Comment
score: 2

http://stackoverflow.com/a/28734719
has body: Just split on - and take the last element from it. var match = window.location.href.split("-").pop(); if (match === "pinyin") {} // do stuff if (match === "complete") {} // do stuff We are splitting on - and then, taking the last element in it by popping it out of the Array.
type: Answer
score: 3
upvote count: 3
downvote count: 0
answers question: http://stackoverflow.com/q/28734683
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28734683

http://stackoverflow.com/a/28945669
downvote count: 0
has body: If you want to add google input tools you can use below code to add it // Load the Google Transliteration API google.load("elements", "1", { packages: "transliteration" }); function onLoad() { var options = { sourceLanguage: 'en', destinationLanguage: ['gu', 'ml', 'hi', 'kn', 'ta', 'te'], shortcutKey: 'ctrl+m', transliterationEnabled: true } // Create an instance on TransliterationControl with the required options. var control = new google.elements.transliteration.TransliterationControl(options); // Enable transliteration in the textfields with the given ids. var ids = ["language"]; control.makeTransliteratable(ids); // Show the transliteration control which can be used to toggle between English and Hindi and also choose other destination language. control.showControl('translControl'); } google.setOnLoadCallback(onLoad);
has comment: http://stackoverflow.com/comment/74761109
answers question: http://stackoverflow.com/q/28707899
score: 33
has comment: http://stackoverflow.com/comment/57271083
has comment: http://stackoverflow.com/comment/66232207
has comment: http://stackoverflow.com/comment/88119241
has comment: http://stackoverflow.com/comment/74829126
upvote count: 33
has comment: http://stackoverflow.com/comment/74806460
has comment: http://stackoverflow.com/comment/139491617
type: Answer
has comment: http://stackoverflow.com/comment/67886382
has comment: http://stackoverflow.com/comment/69858249

http://stackoverflow.com/comment/45601271
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28651592
type: AnswerComment
has text: @Bergi is the "outer" reference a copy of the reference to the `Scope` of the function? Is the outer reference a property on the LE?

http://stackoverflow.com/comment/45658707
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28682578
has text: Thank you for your help, is it considered as CORS issue even if the domain is the same and only the port change ?
type: AnswerComment

http://stackoverflow.com/a/28621007
upvote count: 3
has comment: http://stackoverflow.com/comment/45545012
has body: Its in the Kendo UI documentation. columnMenu: true, columns: [ { hidden: true, field: "id" }, { field: "name" } ], Kendo UI Grid Columns Hidden
accepted answer of: http://stackoverflow.com/q/28620946
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28620946
score: 3

http://stackoverflow.com/comment/45774239
type: Comment
comment on: http://stackoverflow.com/a/28745715
has text: @IsmaelMiguel have something to tell about my name? :)
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45780285
has text: See http://api.jqueryui.com/autocomplete/#option-source "For example, if the source option is set to "http://example.com" and the user types foo, a **GET** request would be made to http://example.com?term=foo." , http://stackoverflow.com/questions/21385892/how-to-use-source-function-and-ajax-in-jquery-ui-autocomplete
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28748139
type: Comment

http://stackoverflow.com/q/28611375
tagged with: console.log
possible better answer: http://stackoverflow.com/a/29989576
has comment: http://stackoverflow.com/comment/45567660
tagged with: logging
has body: I'm building an app using the Ionic framework, which I've done in the browser until now. Because I now want to use the cordovaOauth plugin I need to use the emulator. The problem is that I can't see any console.log() in the emulator as I do in the browser, which makes it hard to debug. Does anybody know how in Ionic/Cordova I can make use of console logging in the emulator? All tips are welcome!
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29989576
tagged with: cordova
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29310542
has answer: http://stackoverflow.com/a/35479273
has comment: http://stackoverflow.com/comment/45527406
has answer: http://stackoverflow.com/a/33340342
tagged with: javascript
answer count: 6
has comment: http://stackoverflow.com/comment/45528566
has answer: http://stackoverflow.com/a/29310194
tagged with: ionic-framework
accepted answer: http://stackoverflow.com/a/29310542
favorite count: 0
has title: How to watch console.logs in ionic emulator?
score: 38
has answer: http://stackoverflow.com/a/47123637
has comment: http://stackoverflow.com/comment/45533553
upvote count: 39

http://stackoverflow.com/comment/45651154
type: QuestionComment
has text: Not able to call the popUp() with this code onclick='popUp(\'"+date+"\')'
score: 0
comment on: http://stackoverflow.com/q/28674915
type: Comment

http://stackoverflow.com/a/39897290
upvote count: 1
score: 1
has body: In our case, the reason that the c++ version bson was not found was because we were behind a corporate proxy and something in the BSON build process needs to reach out to fetch files. When we looked in node_modules/bson/builderror.log, we saw an error like this: gyp WARN install got an error, rolling back install gyp ERR! configure error gyp ERR! stack Error: connect ECONNREFUSED gyp ERR! stack at errnoException (net.js:904:11) gyp ERR! stack at Object.afterConnect [as oncomplete] (net.js:895:19) Which suggested that the proxy might be the issue. Setting the http_proxy and https_proxy environment variables solved it. Sorry for reawakening comments on this, but I wanted to post this for anyone else that hits this in the future since this thread was very helpful in solving our issue.
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28651028

http://stackoverflow.com/comment/45750661
type: AnswerComment
has text: I tried that, and Safari still shows the JSON instead of downloading it.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28732394

http://stackoverflow.com/q/28624255
tagged with: javascript
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/28624708
score: 1
favorite count: 0
has body: I am new to Java Script d3 library and trying to make a graph using D3 JS I want to show text at particular coordinates of (x,y) but it is showing at top-left corner, not according to where I wanted. Please anyone can help me out how to show text at particular coordinate of x,y. below code showing text at top-left corner(not showing according to x,y axis) but I want at (2,5) coordinates How can we find out [x,y] coordinate of the middle point of each path curve where I can show any text. See here Path curve Here is my running Code jsfiddle ` var path0 = [{x: 1.0, y: 8.5},{x: 2.0, y: 5.0}, {x: 1, y: 1.5}];var path1 = [{x: 3, y: 8.5},{x: 4.0, y: 5.0}, {x: 3, y: 1.5}]; var w = 1200, h = 850, p = 40, x = d3.scale.linear().domain([0, 10]).range([p, w - p]), y = d3.scale.linear().domain([0, 10]).range([h - p, p]); var line = d3.svg.line() .interpolate("cardinal") .x(function(d) { console.log(d);return x(d.x); }) .y(function(d) { console.log(d); return y(d.y); }); var vis = d3.select("body").append("svg:svg") .attr("width", w) .attr("height", h) .append("svg:g"); var rules = vis.selectAll("g.rule") .data(x.ticks(10)) .enter().append("svg:g") .attr("class", "rule"); rules.append("svg:line") .attr("x1", x) .attr("x2", x) .attr("y1", p) .attr("y2", h - p - 1); rules.append("svg:line") .attr("class", function(d) { return d ? null : "axis"; }) .attr("y1", y) .attr("y2", y) .attr("x1", p) .attr("x2", w - p + 1); rules.append("svg:text") .attr("x", x) .attr("y", h - p + 3) .attr("dy", ".71em") .attr("text-anchor", "middle") .text(x.tickFormat(10)); rules.append("svg:text") .attr("y", y) .attr("x", p - 3) .attr("dy", ".35em") .attr("text-anchor", "end") .text(y.tickFormat(10)); vis.selectAll("path.path0") .data([0]) .enter().append("svg:path") .attr("d", function(d) { console.log(d);return line.tension(d)(path0); }) .style("stroke","green"); //it is showing text where I wanted at (241.6,425) coordinates but do not know why it is not taking (2,5) coordinates vis.append("text") .att…
has answer: http://stackoverflow.com/a/28624922
type: Question
possible better answer: http://stackoverflow.com/a/28624922
accepted answer: http://stackoverflow.com/a/28624708
tagged with: d3.js
answer count: 2
has title: how to Show text at fixed coordinate of (x,y) in Java Script D3
upvote count: 1

http://stackoverflow.com/a/28670730
type: Answer
has comment: http://stackoverflow.com/comment/45635440
has comment: http://stackoverflow.com/comment/45637187
score: 1
has comment: http://stackoverflow.com/comment/45636722
has comment: http://stackoverflow.com/comment/45636653
has comment: http://stackoverflow.com/comment/45637812
has comment: http://stackoverflow.com/comment/45637238
upvote count: 1
has body: Did you check whether it is working or not ? anyway it is working for me,i think your input should be invalid you can use the following code for checking var originalpassword ="abcdefgh"; var checkpassword = "abcdefgh"; var emailcheck = "arun@gmail.com"; var male ="male"; var emailexist = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; if (originalpassword == checkpassword) { alert("hai"); } if (originalpassword.length &lt; 9) { if (emailexist.test(emailcheck)) { alert("Hello World!"); } else { alert("Please enter a valid email address."); } } Working DEMO UPDATE var originalpassword ="abcdefgh"; var checkpassword = "abcdefgh"; var emailcheck = "arun@gmail.com"; var male ="male"; var emailexist = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; if (originalpassword == checkpassword) { alert("hai"); if (originalpassword.length &gt; 9) { if (emailexist.test(emailcheck)) { alert("Hello World!"); } else { alert("Please enter a valid email address."); } } else { alert("Passwords must have at least 9 characters."); } } else { alert("Passwords do not match."); } Check this DEMO It will satisfy all conditions. Note : Check your if condition for password length, if you want the desired output then it will be like if (originalpassword.length &gt; 9)
has comment: http://stackoverflow.com/comment/45636473
downvote count: 0
has comment: http://stackoverflow.com/comment/45637858
answers question: http://stackoverflow.com/q/28670350

http://stackoverflow.com/comment/45756481
type: QuestionComment
has text: We understand it does not work for you, but it would be more helpful for us to get the example and specific error details to help you. can you try using alert() in your function and check if it is getting invoked with your call.
comment on: http://stackoverflow.com/q/28735896
score: 0
type: Comment

http://stackoverflow.com/q/28658898
type: Question
has answer: http://stackoverflow.com/a/28659120
tagged with: javascript
downvote count: 0
answer count: 1
score: 1
favorite count: 0
linked to: http://stackoverflow.com/q/1467369
accepted answer: http://stackoverflow.com/a/28659120
tagged with: mysqli
has title: mySQLi to Json to Js file
tagged with: php
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has body: Hello I am trying to output my mysqli database to a js file after encoding it, I have no trouble encoding it with json_encode but how can I get it into a js file (updating every time the mysqli data is updated) $mysqli = new mysqli('localhost','user','password','myDatabaseName'); $myArray = array(); if ($result = $mysqli-&gt;query("SELECT * FROM tablename")) { $tempArray = array(); while($row = $result-&gt;fetch_object()) { $tempArray = $row; array_push($myArray, $tempArray); } echo json_encode($myArray); } $result-&gt;close(); $mysqli-&gt;close(); Any help or insight would be great! thanks
upvote count: 1

http://stackoverflow.com/comment/45725318
comment on: http://stackoverflow.com/a/28718996
type: AnswerComment
score: 0
type: Comment
has text: Actually i want to execute the command after loading the img (amazon.png), So that doesn´t helps me.

http://stackoverflow.com/q/28739669
tagged with: angularjs-ng-repeat
tagged with: angularjs
has body: I have a list of array from A-Z and create a button list from them $scope.alphabet = "abcdefghijklmnopqrstuvwxyz".split(""); I have another array $scope.uniqChar = ['a', 'g', 'm']; by using this array I want to create a button list where all the button disable except the button those name are 'a', 'g', 'm'(which are in $scope.uniqChar). I did this jsfiddle, but the output shown in three times. I want it only in one list. Please enlighten me.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28739751
type: Question
answer count: 2
has title: Disable button according to value in array, angularjs
tagged with: javascript
score: 0
possible better answer: http://stackoverflow.com/a/28739909
accepted answer: http://stackoverflow.com/a/28739751
has answer: http://stackoverflow.com/a/28739909

http://stackoverflow.com/comment/45698337
has text: yes, they change if you type another address and click the seach button
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28695629
type: AnswerComment

http://stackoverflow.com/comment/45611382
type: Comment
has text: All I want is to easy and simple create the markup for tha page. It should be vary clear by just looking on the code what the page really will get. So far React have not shown my any easy way of doing this? I am used to the ASP.NET MVC where I type the logic in the HTML and this is MUCH more readable then jumping back and forth in the react with functions and what not. Is there really no simplier way to render the markup with react? Maybe switching to regular javascript is much better where I can buld html strings?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28656917

http://stackoverflow.com/q/28689023
favorite count: 0
score: 0
tagged with: extjs4
answer count: 3
tagged with: extjs4.2
has answer: http://stackoverflow.com/a/28690101
type: UnansweredQuestion
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/28689946
has body: When a grid panel sort is triggered on column 'Email', how do I force a ASC sort on column 'Name' first and then for EXTJS to perform a sort on column 'Email' next. I found the following example which is in the right direction.. http://cdn.sencha.com/ext/gpl/4.2.0/examples/grid/multiple-sorting.html ...but I cannot see how I would implement this in a gridpanel when a user clicks on a column sort, the example uses buttons against the store directly...the only event I think I can use is gridpanel sortchange but it is a post sort event. I create a fiddle example https://fiddle.sencha.com/#fiddle/imt where I put a sorter in the store sorters: [{ property: 'Name', direction: 'ASC' }], but after playing around with the other columns sorts in the grid, the sorter does not prioritize on 'Name' anymore. Any recommendations ?
type: Question
has title: EXTJS 4.2 - Grid Panel Multiple grid sorting
tagged with: javascript
has answer: http://stackoverflow.com/a/36900087
tagged with: sorting
has comment: http://stackoverflow.com/comment/45670451

http://stackoverflow.com/q/28619474
type: UnansweredQuestion
tagged with: charts
has comment: http://stackoverflow.com/comment/45572782
has comment: http://stackoverflow.com/comment/45572327
type: Question
has title: Two google charts on one page, one keeps getting clipped
has comment: http://stackoverflow.com/comment/45572666
tagged with: javascript
score: 0
has body: Before I put two google charts on one page, I didn't have a problem. But not it seems as if at least one keeps getting clipped. I took the code and put it into js fiddle, and it's still happening so it's not my css or json that's causing a problem. I'm new to javascript so I'm probably doing something wrong. I tried creating a different function for the second chart, but that didn't help. HINT: somtimes it doesn't happen, but most of the time, at least one chart is "clipped". OR the bars just Disappear. svg doesn't play nice here, visit js fiddle http://jsfiddle.net/ameshkin/ygdng1w5/
has comment: http://stackoverflow.com/comment/45554947
has comment: http://stackoverflow.com/comment/45574003
tagged with: http://stackoverflow.com/tag/svg
has comment: http://stackoverflow.com/comment/45570674
has comment: http://stackoverflow.com/comment/45568507
answer count: 0

http://stackoverflow.com/q/28639809
tagged with: inline
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45578955
upvote count: 0
tagged with: download
downvote count: 2
tagged with: youtube
type: AnsweredQuestion
type: Question
has title: Need help in youtube video bookmarklets
score: -2
tagged with: javascript
has body: I'm making a web app and a bookmarklets for my website so that user can directly bookmark any video in their browser through any youtube video posted on my website. hi anyone can help me to solve this for youtube video bookmarklets I want to keep only youtube video ID in following code javascript:(function(){window.open('http://example.com/bookmarklets/bookmark?id='+encodeURIComponent(location.href)+'')})(); Result should be : http://example.com/bookmarklets/bookmark?id=LIQZ6CjpHUA but when i test above code i found that it takes whole youtube URL instead of youtube video ID Instead of above result i got this : **http://example.com/bookmarklets/bookmark?id=https://www.youtube.com/watch?v=IUeqywml0SU but i want only this result : http://example.com/bookmarklets/bookmark?IUeqywml0SU
has answer: http://stackoverflow.com/a/31733221
accepted answer: http://stackoverflow.com/a/31733221

http://stackoverflow.com/comment/45512322
has text: Thank you that worked with a little tweak `
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28603265
type: Comment

http://stackoverflow.com/comment/45700878
score: 0
type: Comment
type: QuestionComment
has text: I know. In my case it sadly does. It's just a .tpl file from smarty with html content and a select with a ID and a js file what is actually empty. Only the posted source... I just shorted the id's for better reading
comment on: http://stackoverflow.com/q/28705503

http://stackoverflow.com/comment/45579791
score: 0
comment on: http://stackoverflow.com/q/28640355
type: Comment
type: QuestionComment
has text: There are some questions on this already which might help, like http://stackoverflow.com/questions/6485911/php-ldap-login-problem for instance.

http://stackoverflow.com/a/28603186
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28603123
has comment: http://stackoverflow.com/comment/45511407
type: Answer
has body: You use innertHTML+ when you have to append new content in existing content. If you use innerHTML = "New Content" that would replace all content in pp and place "New Content" there, but innerHTML+="New Content" would append this with existing content. As other people also mentioned innerHTML += "New Content" is equivalent to element.innerHMTL = element.innerHMTL + "New Content", so this means that the += is basically used to append content. It can be used to append/add new values and at the same time can be used to increment an int value so i++ = i+=1 = i = i+1

http://stackoverflow.com/q/28680324
tagged with: cookies
linked to: http://stackoverflow.com/q/640938
has answer: http://stackoverflow.com/a/28680497
has answer: http://stackoverflow.com/a/28681009
type: Question
has body: $("#fg2").click(function() { //Chrome var bgColor = '-webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#e5e5e5))'; //Firefox var bgColorff = '-moz-linear-gradient(top, #ffffff 0%, #e5e5e5 100%)'; //Chrome 10+ var bgColorch = '-webkit-linear-gradient(top, #ffffff 0%,#e5e5e5 100%)'; //Opera var bgColoro = '-o-linear-gradient(top, #ffffff 0%,#e5e5e5 100%)'; //ie10 var bgColorie = '-ms-linear-gradient(top, #ffffff 0%,#e5e5e5 100%)'; var fcolor = 'black'; $.cookie('background', bgColor); $.cookie('background', bgColorff); $.cookie('background', bgColorch); $.cookie('background', bgColoro); $.cookie('background', bgColorie); $("#nav").css({ "background": bgColor }); $("#nav ul li a").css({ "color": fcolor }); $("#mbar h3").css({ "color": fcolor }); $("#mbar p").css({ "color": fcolor }); $("#nav").css({ "background": bgColorff }); $("#nav").css({ "background": bgColorch }); $("#nav").css({ "background": bgColoro }); $("#nav").css({ "background": bgColorie }); $("#mbar").css({ "background": bgColor }); }); Now when a user clicks on fg2 it will change the color (gradient) but it won't save it into a cookie. It only works for Chrome. I want to make gradients and there are more variants to do that for each browser. So I want to add these gradient in one "background".
score: 0
answer count: 2
upvote count: 1
downvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45653566
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: More lines in one Cookie

http://stackoverflow.com/a/28747520
has comment: http://stackoverflow.com/comment/45800280
has body: In your synchronous version, the data gets garbage collected, because you don't assign the return value to anything. In the asynchronous one, the final file isn't allowed to be garbage collected because it's accessible via arguments, even though you haven't set an explicit parameter. To prove this, I set up a simple test on a single file. I got results similar to yours in the basic version (although I had to force gc before each memory usage check). However, if I just store the data from the return of readFileSync, that version uses almost exactly the same amount of memory as the async one. If you're worried about memory usage, you should be using fs.createReadStream.
answers question: http://stackoverflow.com/q/28745027
has comment: http://stackoverflow.com/comment/45815455
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45923562
upvote count: 2

http://stackoverflow.com/comment/45671865
type: Comment
has text: Hey i can add data to database now,but i can't show data into a image/png. u can help?
comment on: http://stackoverflow.com/a/28680824
type: AnswerComment
score: 0

http://stackoverflow.com/q/28621640
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28621760
tagged with: javascript
score: 4
possible better answer: http://stackoverflow.com/a/28621760
has body: I am new to angular js .Here I am trying to filter data based on the temperature by subtracting the user input(x) from the currentTemp variable.But not sure if i could access the user input value in custom filter.I am planning use same thing on date later on.For now this might suffice.Please provide feedback on the possiblities of doing this using the custome filer(using input value and subtracting it in custom filter).Any other logic would also be very helpful. http://plnkr.co/edit/Qzne7wfnSa2keRcvbUUV?p=preview var app = angular.module('tempfilter', []); app.controller('MainCtrl', function($scope) { $scope.sensordata = [{name:'Rob',"Date": "2014-02-16T00:00:00.000Z","Temp":42}, {name:'Bob',"Date": "2012-02-16T20:27:11.507Z","Temp":50}, {name:'Tom', "Date": "2012-02-16T20:27:11.507Z","Temp":60}, {name:'Sinclair',"Date": "2012-02-16T20:27:11.507Z","Temp":65}]; $scope.condEqual=function(){ var x = document.getElementById("myNumber").value; document.getElementById("demo").innerHTML = x; } }); app.filter('tempo', function() { return function( items, field ) { var filtered = []; var x=2; var currentTemp=62; angular.forEach(items, function(item) { if (item[field]<= currentTemp){ filtered.push(item); } }); return filtered; }; }); DateFilter Enter Filtered list: {{s.name}} {{s.Temp}} Full List: {{s.name}} {{s.Temp}} (The main thing i am trying to do here is filter the data based on date i.e.based on user input i.e if user inputs certain value e.g.3 i should be able to subtract the value from current date and display all the data 3 days from now. i.e user inputs 3 and today's date 2/19/2015..I will filter all data from last three day).For now trying with the temperature will use the same logic for dates later on
tagged with: angularjs-filter
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28621763
accepted answer: http://stackoverflow.com/a/28621763
upvote count: 4
has comment: http://stackoverflow.com/comment/45545488
type: AnsweredQuestion
has title: Can we access user input value in customfilter.Trying to access user input number from controller or directly in customfilter
downvote count: 0
tagged with: angularjs-controller
tagged with: angularjs-scope

http://stackoverflow.com/comment/45612265
has text: The problem is the file is minified so the line number isn't helpful. Then when I un-minified it the issue goes! Very strange...
score: 0
comment on: http://stackoverflow.com/q/28657739
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28646121
tagged with: mongodb
accepted answer: http://stackoverflow.com/a/28646560
answer count: 1
has comment: http://stackoverflow.com/comment/45590445
has comment: http://stackoverflow.com/comment/45590566
tagged with: javascript
has body: I need to check if the value returned from a javascript function is a mongo cursor (in meteor js) or something else, since the function can return an array, a mongo.cursor or something else (considered unacceptable) Is there any way to do this?
favorite count: 0
has title: javascript check if value is a mongo.cursor
score: 0
has comment: http://stackoverflow.com/comment/45590418
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45590420
upvote count: 1
has answer: http://stackoverflow.com/a/28646560
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45590031

http://stackoverflow.com/q/28649986
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: http://stackoverflow.com/tag/svg
has answer: http://stackoverflow.com/a/28650065
downvote count: 1
type: AnsweredQuestion
has title: How can I align div elements of a page equally and set my divs in same size?
tagged with: javascript
has body: I have my html layout in 2 different divs that I want to align evenly. Before After (desired) How can I achieve it? My html is .main { overflow: hidden; display: block; } .column_left { float: left; } #mapcontainer { margin: 16px 0 0 32px; position: relative; padding-bottom: 26px; } .box { display: block; overflow: hidden; background: #ffc801; padding: 10px; padding-top: 20px; margin: 8px 0px 8px; font-family: 'avantgardebook', sans-serif; font-weight: 300; } .box h2 { font-size: 16px; margin-bottom: 8px; margin-top: 0; } .box ul { padding-left: 16px; margin: 0; } .box li { margin-bottom: 16px; } #regions { float: left; z-index:5; display: block; overflow: hidden; width: 400px; font-size: 19px; margin-left: 4px; font-weight: 500; /* medium */ } #regions .regions_one, #regions .regions_two { font-family: 'avantgardemd', sans-serif; float: left; width: 200px; } #regions h2 { display: block; clear: both; padding: 12px 0 4px; margin: 0; font-size: 14px; } #regions ul { list-style-type: none; margin: 0; padding: 0; } #regions ul li { display: block; clear: both; overflow: hidden; margin-bottom: 0; } #regions a { line-height: 20px; font-size: 15px; display: block; float: left; font-weight: 500; /* medium */ } Buy and sell cars, check our real estate section, find jobs, and much more. Check our {{count}} ads online and find what you are looking for in your region or in all India. If it helps I can make a fiddle with the problem and create a minimal example problem that we can align. It seems like the framework won't let us align it, or do you see where I can change in my fiddle so that the divs are more exactly side by side?
score: -1
has comment: http://stackoverflow.com/comment/45597468
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28802892
accepted answer: http://stackoverflow.com/a/28650065
upvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/28802892

http://stackoverflow.com/q/28614719
has answer: http://stackoverflow.com/a/28615053
accepted answer: http://stackoverflow.com/a/28615190
tagged with: iteration
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/45532831
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28615053
has comment: http://stackoverflow.com/comment/45533054
has title: Iterate through list, add list item id from list item text
type: AnsweredQuestion
has body: I wish to find an easy jQuery solution to iterate through a list's child selectors, in this instance, the ul > li span span child selectors, find the text, copy the text as the list item ID, all while removing the whitespace and replacing with underscore if there are any (for instance, in the example below, HR Area would become HR_Area then get added as the list item ID as li id="HR_Area"). Staff Directory HR Area Manage Vacation Time Thx in advance.
has answer: http://stackoverflow.com/a/28615467
has comment: http://stackoverflow.com/comment/45533003
has comment: http://stackoverflow.com/comment/45532823
type: Question
has answer: http://stackoverflow.com/a/28615190
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28637761
has body: Yes, use $index (created inside the ngRepeat scope) {{travelList[$index]}}
has comment: http://stackoverflow.com/comment/45577143
has comment: http://stackoverflow.com/comment/45576377
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45577019
has comment: http://stackoverflow.com/comment/45577530
answers question: http://stackoverflow.com/q/28637755
upvote count: 2

http://stackoverflow.com/comment/125969562
comment on: http://stackoverflow.com/a/28636900
type: Comment
has text: L.markerClusterGroup() is not part of Leaflet by default; it can be replaced with L.layerGroup()
score: 3
type: AnswerComment

http://stackoverflow.com/comment/45697264
comment on: http://stackoverflow.com/a/28703407
type: Comment
has text: @BenjaminGruenbaum Hm, I thought I had encountered an engine that distinguished in its stack traces between creating and throwing errors. Can't remember which :-/
score: 0
type: AnswerComment

http://stackoverflow.com/q/28750017
favorite count: 0
has body: I am working on a small app using SpeechSynthesisUtterance API. I try to launch a small function betweens words (when they are enunciated) : I use boundary event : myWords.onboundary = function() { ... }; But it doesn't work...Maybe i don't understand how works boundaries effect. Please, can you help me ? Thank you, Thomas
type: Question
has title: Problems with events of speechSynthesis
tagged with: text-to-speech
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45782166
has answer: http://stackoverflow.com/a/28753175
tagged with: javascript
type: UnansweredQuestion
tagged with: speech-synthesis
has comment: http://stackoverflow.com/comment/45783464
downvote count: 0
tagged with: events
score: 1
has comment: http://stackoverflow.com/comment/45782242

http://stackoverflow.com/comment/45770276
type: AnswerComment
comment on: http://stackoverflow.com/a/28743536
type: Comment
has text: Thanks @treegarden , probably he needs to validate the form and will parse the data in server side (PHP, ASP, ect), he don't need that info in client side so test will do the work better. There is a new update in my code allowing to test hours, minutes and seconds ranges. I'll update it again to add your contribution.
score: 0

http://stackoverflow.com/q/28695092
upvote count: 4
tagged with: node.js
type: AnsweredQuestion
tagged with: coffeescript
has comment: http://stackoverflow.com/comment/45681132
type: Question
has title: Mongoose right promise rejection handling
tagged with: javascript
score: 4
accepted answer: http://stackoverflow.com/a/28695376
has body: I'm bit fighting with promise pattern in nodeJS I'm looking for user in db and then saving new entity with user reference, but when user is not in db, I should return rejection, but I'm not sure how to do it properly. is there way how to do it more nicely? btw: sorry, coffeescript :-[ User.findOne({'fbId':userData.me.id}).exec().then((doc)-&gt; if !doc? then return new Promise (resolve,reject)-&gt;reject(404) video = new Video({ user:doc state: "queue" createdAt: new Date() }) video.save().exec() )
answer count: 1
downvote count: 0
tagged with: mongoose
has answer: http://stackoverflow.com/a/28695376
favorite count: 0
tagged with: promise

http://stackoverflow.com/a/40902193
downvote count: 0
type: Answer
score: 3
upvote count: 3
has body: As noted by @rd5, this is issue 327092 in Google Chrome, reported on 2013-12-09. As of 2018-07-01, the issue is still unresolved.
answers question: http://stackoverflow.com/q/28736022
has comment: http://stackoverflow.com/comment/111402848

http://stackoverflow.com/comment/45667748
type: QuestionComment
comment on: http://stackoverflow.com/q/28687483
has text: @jdphenix well there is no offending element in the markup, or else I would just delete it (lol) it is being generated from somewhere > and then pushed on the page.
score: 0
type: Comment

http://stackoverflow.com/q/28609622
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45523982
has comment: http://stackoverflow.com/comment/45524210
has comment: http://stackoverflow.com/comment/45523820
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45523965
has comment: http://stackoverflow.com/comment/45523580
has comment: http://stackoverflow.com/comment/45523402
answer count: 0
score: 1
has title: Not able to create DOM element using javascript factory pattern
has comment: http://stackoverflow.com/comment/45523710
has comment: http://stackoverflow.com/comment/45523453
type: Question
has body: I am trying to create html button using java-script factory pattern. This is the factory interface: var _button = function(){}; _button.prototype.createButtonType = function(options){ var buttonType = null; if(options.edit == true){ buttonType = _edit; } else if(options.remove == true){ buttonType = _remove; } return new buttonType(options.holder); } **The _edit &amp; _remove functions are as follows** var _edit = function(holder){ console.log("Method executing : components._edit",holder) var buttonBasicEdit = _basicButton(); buttonBasicEdit.className = "defaultEdit"; buttonBasicEdit.innerHTML = "Edit"; buttonBasicEdit.onclick = function(){ //someaction }; holder.appendChild(buttonBasicEdit); } var _remove = function(holder){ console.log("Method executing : components._remove"); var buttonBasicRemove = _basicButton(); buttonBasicRemove.className = "defaultRemove"; holder.appendChild(buttonBasicRemove); }; function _basicButton(){ console.log("Method Executing components._basicButton") var buttonBasic = document.createElement("button"); return buttonBasic; }; ## The basic factory calling function is ## var _buttons = new _button(); _buttons.createButtonType({ edit:true, remove:true, holder:buttonHolder }); The issue is when I am calling if....else if in prototype function it is only calling _edit function and creating edit button, simply overlooking the _remove function. But when using two consecutive if loop it throwns an undefined is not a function exception.
tagged with: javascript
has comment: http://stackoverflow.com/comment/45524873
has comment: http://stackoverflow.com/comment/45523861
upvote count: 1

http://stackoverflow.com/q/28620092
score: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28620653
has comment: http://stackoverflow.com/comment/45543418
has comment: http://stackoverflow.com/comment/45543249
tagged with: angularjs-directive
has answer: http://stackoverflow.com/a/28793133
has body: So I have a two way data binding which I do not understand why it is not working, it does not update: angular.module('core').directive('collapseNavOnClick', [ function() { return { restrict: 'A', scope: { collapseNavOnClick: '=', isCollapsed: '=' }, link: function(scope, elm, attrs) { console.log(scope.isCollapsed); console.log(scope.collapseNavOnClick); elm.on('click', function() { console.log(scope.collapseNavOnClick); console.log(scope.isCollapsed); }); } }; } ]); Here is the HTML: &lt;section data-ng-controller="HomeController" data-ng-init="init()" collapse-nav-on-click="isCollapsed" is-collapsed="isCollapsed"&gt; And my controller (HeaderMenu is a service): angular.module('core').controller('HomeController', ['$scope','HeaderMenu', function($scope, HeaderMenu) { $scope.isCollapsed = HeaderMenu.isCollapsed; So the problem is, when I do the 'clicks' and the isCollapsed has changed, it is not being updated on the directive, why? The 'isCollapsed' value is changed by the controller, more specifically there is a controller function triggered by a ng-click that changes 'isCollapsed'. I can log the value of the isCollapsed in the controller and see that it has changed however the directive does not get the updated value. More clarification: So a bit more info, I have an ng-click somewhere else: What this does is changes the isCollapsed value, more specifically it pops open a menu. Now what I want to do, when the body element is clicked, I want to hide that menu but I need to check if the menu is not already collapsed so I need to read the value of 'isCollapsed'. Hence I have the directive with an 'on click' event. So what I need is, upon clicking the 'body' element, read the current value of 'isCollapsed' and take action. UPDATE: I've narrowed it down to the root problem: $scope.isCollapsed = HeaderMenu.isCollapsed; That line doesn't actually sync with the HeaderMenu service, I should have assigned the whole object not just a field. Completely oversaw this.
tagged with: angularjs-scope
type: Question
has title: AngularJS Directive Two data binding - What am I doing wrong?
has comment: http://stackoverflow.com/comment/45558335
answer count: 3
tagged with: angularjs-service
tagged with: javascript
has comment: http://stackoverflow.com/comment/45543710
has answer: http://stackoverflow.com/a/28632347
has comment: http://stackoverflow.com/comment/45543608
has comment: http://stackoverflow.com/comment/45543687
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45543363

http://stackoverflow.com/a/28706086
has comment: http://stackoverflow.com/comment/45705497
score: 1
has body: You don't need and shouldn't manipulate your markup before you rending it. Just create a jade mixin where you can pass params to customize your markup output. If you want a more precise answer, provide a concrete example how you would do it in jQuery. If you want to change a DOM on the server side, you can use cheerio, but for rendering templates for the client you should never do this!
downvote count: 0
has comment: http://stackoverflow.com/comment/45712209
type: Answer
answers question: http://stackoverflow.com/q/28702106
upvote count: 1

http://stackoverflow.com/comment/46293282
comment on: http://stackoverflow.com/a/28700057
score: 0
type: Comment
has text: Thank you for the response florinmarcus, i was facing issue with IE versions and resolved by using few patches for Jdeveloper and by adding below context params to xml file. oracle.adf.view.rich.HIDE_UNSUPPORTED_BROWSER_ALERTS IECompatibilityModes org.apache.myfaces.trinidad.Agent#OVERRIDE_IE_COMPATIBILITY_MODE true
type: AnswerComment

http://stackoverflow.com/q/28713694
answer count: 1
has body: I am trying to run a python script with node.js server using the npm python-shell package A simple program runs perfectly. But when I am trying to use some functions from python it throws a error. For eg. I am writing a program to get input from the user and reply for the same. I am using raw_input in python which is not working in node.js. Can anyone please help me. here is the python code : while True : question=raw_input('you :') print cb1.ask(question) Node.js code : var PythonShell = require('python-shell'); PythonShell.run('index.py', function (err, results) { if (err) throw err; console.log('result: %j', results); });
type: UnansweredQuestion
tagged with: python
tagged with: node.js
tagged with: cross-platform
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/34919496
has title: Running Python script in nodejs
score: 0

http://stackoverflow.com/q/28666848
has comment: http://stackoverflow.com/comment/45631933
has body: I have jsf code which after javascript click calls hidden button click function, that performs ajax request and refresh the page. But I want call another javascript function when ajax returns new values. Here is my code &lt;h:panelGrid styleClass="float-left" columns="2"&gt; &lt;h:outputText value="Хранилище ключей: " /&gt; &lt;h:panelGroup&gt; &lt;p:inputText value="#{SessionBean.getCurrentLocaleName(SessionBean.userProfileController.keySettingsForm.storage)}" onclick="$('#selectStorageB').click();" onchange="" readonly="true" style="cursor: text; width: 275px;" /&gt; &lt;p:commandButton id="selectStorageB" style="display: none;" actionListener="#{SessionBean.storageController.selectStorageForm.openSelectStorageDialog}"&gt; &lt;p:ajax event="dialogReturn" update=":indexForm" process=":indexForm" immediate="true" listener="#{SessionBean.userProfileController.keySettingsForm.onStorageChosen}" oncomplete="chooseStoragePath(#{SessionBean.userProfileController.keySettingsForm.storage.alias})" /&gt; &lt;/p:commandButton&gt; &lt;p:commandButton icon="ui-icon-cancel" immediate="true" style="width: 18px; white-space: pre-wrap; margin-left: 5px" actionListener="#{SessionBean.userProfileController.keySettingsForm.resetSigningStorageName()}" update=":indexForm"&gt; &lt;/p:commandButton&gt; &lt;/h:panelGroup&gt; &lt;/h:panelGrid&gt; My problem is javascript function does not see new values.
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/28670878
tagged with: jsf
upvote count: 3
has comment: http://stackoverflow.com/comment/45669828
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28670878
tagged with: ajax
has title: JSF Call javascript function after Ajax update
downvote count: 0
answer count: 1
favorite count: 0

http://stackoverflow.com/q/28605832
tagged with: javascript
has answer: http://stackoverflow.com/a/28606055
has body: I'm currently trying to extract from ReturnUrl= ... I want to extract the URL from the link below using javascript. Can anyone help? http://testdealbuilderCCMS/questionnaire.aspx?db_template_reference=Construction: Westfield Services Agreement&amp;ContractDescription=Facilities Contract&amp;NatureServices=FACILITIES&amp;SiteDescription=Retail Units&amp;ThirdPartyAgreementsList=&amp;ServiceFee=1000&amp;ReturnUrl=http://localhost:4965&amp;launcher.aspx?directLink=PX&amp;caseKey=7ccef65756504a79bc3a4a6687c0d9555e519ec9079241c9944c6a523704&amp;PXid=
score: 0
has title: Extracting from URL - Long URL
has comment: http://stackoverflow.com/comment/45516215
has comment: http://stackoverflow.com/comment/45516127
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28606055
type: Question
linked to: http://stackoverflow.com/q/901115
answer count: 1
tagged with: url

http://stackoverflow.com/comment/45724221
score: 0
type: AnswerComment
has text: your code is not correct, please, **read the answers and the duplicate question**....
type: Comment
comment on: http://stackoverflow.com/a/28718383

http://stackoverflow.com/a/28606104
has comment: http://stackoverflow.com/comment/45585027
downvote count: 0
answers question: http://stackoverflow.com/q/28606058
has body: Usually offsetWidth and offsetHeight.
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/28625192
has answer: http://stackoverflow.com/a/28625538
tagged with: javascript
has comment: http://stackoverflow.com/comment/45551381
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45551422
linked to: http://stackoverflow.com/q/14220321
has comment: http://stackoverflow.com/comment/45573267
has comment: http://stackoverflow.com/comment/45551432
has comment: http://stackoverflow.com/comment/46745907
linked to: http://stackoverflow.com/q/23667086
tagged with: node.js
has comment: http://stackoverflow.com/comment/45552106
has comment: http://stackoverflow.com/comment/45552149
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45551902
accepted answer: http://stackoverflow.com/a/28625538
has title: Returning object from Node.js callback nested in a function
type: Question
duplicate of: http://stackoverflow.com/q/14220321
has body: say I have the following function which has a synchronous filesystem call enclosed: var foo = function(){ var numbytes = fs.readSync(...); return numbytes; } no problems there. but if I use an async function with a callback like so: var baz = function(){ var numbytes = fs.read(...,function(){ // return numbytes; (wrong) }); //return numbytes; (wrong) }; how do I properly return a value tied to numbytes from the baz function? In the Meteor Node.js framework, this might be one answer to this problem: Meteor.wrapAsync(func, [context]) Anywhere Wrap a function that takes a callback function as its final parameter. On the server, the wrapped function can be used either synchronously (without passing a callback) or asynchronously (when a callback is passed). On the client, a callback is always required; errors will be logged if there is no callback. If a callback is provided, the environment captured when the original function was called will be restored in the callback. Arguments func Function A function that takes a callback as its final parameter context Object Optional this object against which the original function will be invoked

http://stackoverflow.com/a/28704134
has comment: http://stackoverflow.com/comment/45699129
type: Answer
has comment: http://stackoverflow.com/comment/45707690
has body: Things can be confusing if you don't distinguish between the literals +0 and -0, which represent the mathematical value 0, and the values +0 and -0, which are the in memory representation, respectively, for: Any mathematical value from 0 to the smallest positive real number that can be stored in the double precision 64-bit data format Any mathematical value from the largest negative real number that can be stored in the double precision 64-bit data format to 0 If you have a variable containing the Number instance -0, this could be representing the real number 0 (which obviously has no sign), or it could be representing the real number 10^-10000. If you see the literal -0 or +0 in code, this will be interpreted as the real number 0, which is stored (just like any sufficiently tiny but not actually 0 real number) as the Number -0 or +0, as the case may be. Here are some relevant sections from the spec that will hopefully clarify things: Numeric literals The Number type Algorithm conventions Why -0===+0
upvote count: 2
has comment: http://stackoverflow.com/comment/45698203
score: 2
answers question: http://stackoverflow.com/q/28703855
has comment: http://stackoverflow.com/comment/45698650
has comment: http://stackoverflow.com/comment/45706960
downvote count: 0

http://stackoverflow.com/a/28620766
score: 0
has body: use res.redirect or remove the action attribute from the form to post to the current page. http://expressjs.com/api.html#res.redirect if you remove the action attribute to post to the current page then you have to add a route to express for that page to process the post request http://expressjs.com/api.html#app.route if you have trouble with removing the action attribute then try using action="?" to post to the current page.
answers question: http://stackoverflow.com/q/28620372
has comment: http://stackoverflow.com/comment/45596519
type: Answer
has comment: http://stackoverflow.com/comment/45544020

http://stackoverflow.com/q/28691133
tagged with: firefox
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45673943
type: AnsweredQuestion
has body: I have been trying to create a setTimeout loop in my javascript application, and it works great in all browsers, except firefox. (i know, old news) The setTimeout call is delayed for a large amount of time, maybe about 20 seconds, for some reason, when the delay is set to 500ms, 1000ms or anything like that. Ive tried some different things, but everything seems to be delayed in FF. The two null parameters needs to be set, as they in some situations may need to be called with some other values, also with a setTimeout call. I have tried: timerMessagesRequest = setTimeout(function () { getSetOfSenders(null, null); }, pollingDelay); timerMessagesRequest = setTimeout(function () { getSetOfSenders(null, null); }, pollingDelay, undefined); timerMessagesRequest = setTimeout( getSetOfSenders(null, null) , pollingDelay);
downvote count: 0
has comment: http://stackoverflow.com/comment/45674086
has comment: http://stackoverflow.com/comment/45673783
score: 1
favorite count: 0
type: Question
has title: setTimeout delayed in firefox
answer count: 2
has answer: http://stackoverflow.com/a/28691555
has answer: http://stackoverflow.com/a/28693034
upvote count: 1
possible better answer: http://stackoverflow.com/a/28691555
has comment: http://stackoverflow.com/comment/45674281
has comment: http://stackoverflow.com/comment/45673745
accepted answer: http://stackoverflow.com/a/28693034
has comment: http://stackoverflow.com/comment/45673856

http://stackoverflow.com/comment/45709712
comment on: http://stackoverflow.com/q/28710289
type: QuestionComment
has text: Is it possible inside my app the sessions are being created individually. The goal is to obviously have a user login to one side and be logged into both.
score: 0
type: Comment

http://stackoverflow.com/q/28716176
tagged with: dynamics-crm-2015
tagged with: javascript
tagged with: jquery
has title: how to refresh dashboard view with js in Mscrm?
linked to: http://stackoverflow.com/q/8271868
has body: I've implemented a ribbon button that updates an entity field, based on the entity selected in a dashboard view. After I update the entity field through js, I need to refresh the dashboard view to redisplay the view with the updated field value. What's the most elegant way to do this? I could execute js to reload the whole page, but would be the worst case scenario. Can you recommend a way to refresh only a specific view on a dashboard to display updated data?
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45940440
has comment: http://stackoverflow.com/comment/45814711
has comment: http://stackoverflow.com/comment/45820747
has comment: http://stackoverflow.com/comment/45941658
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45938849
has comment: http://stackoverflow.com/comment/45941301
has answer: http://stackoverflow.com/a/28824507
has answer: http://stackoverflow.com/a/28836006
type: Question
tagged with: dynamics-crm-2011

http://stackoverflow.com/q/28674470
downvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/30202463
favorite count: 0
has title: I can't run the test example with protractor-perf
upvote count: 1
has comment: http://stackoverflow.com/comment/45643498
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45643041
score: 1
type: Question
has answer: http://stackoverflow.com/a/30202463
has body: I'm trying to run the example from the readme file: var ProtractorPerf = require('protractor-perf'); describe('angularjs homepage todo list', function () { var perf = new ProtractorPerf(protractor, browser); // Initialize the perf runner it('should add a todo', function () { browser.get('http://www.angularjs.org'); perf.start(); // Start measuring the metrics element(by.model('todoText')).sendKeys('write a protractor test'); element(by.css('[value="add"]')).click(); perf.stop(); // Stop measuring the metrics if (perf.isEnabled) { // Is perf measuring enabled ? // Check for perf regressions, just like you check for functional regressions expect(perf.getStats('meanFrameTime')).toBeLessThan(60); }; var todoList = element.all(by.repeater('todo in todos')); expect(todoList.count()).toEqual(3); }); }); I'm using the protractor-pre instead of protractor, and what I see after: 1) angularjs homepage todo list should add a todo: TypeError: undefined is not a function at Context.&lt;anonymous&gt; (E:\dashboard-perf.spec.js:41:34 ) at C:\Users\ky\AppData\Roaming\npm\node_modules\protractor\node_modules\se lenium-webdriver\testing\index.js:121:22 at [object Object].webdriver.promise.ControlFlow.runInNewFrame_ So it's about line: 41 expect(todoList.count()).toEqual(3); What is problem with my configuration? or what is that?
tagged with: testing
tagged with: protractor
tagged with: javascript
tagged with: ui-testing

http://stackoverflow.com/comment/123880881
type: Comment
comment on: http://stackoverflow.com/a/28612703
score: 1
type: AnswerComment
has text: @MukeshBhojwani yes just use format and provide values

http://stackoverflow.com/q/28649467
favorite count: 0
has comment: http://stackoverflow.com/comment/45596391
tagged with: javascriptcore
has comment: http://stackoverflow.com/comment/45602632
has comment: http://stackoverflow.com/comment/45598021
score: 1
has body: There is no universal bytecode for JavaScript, but most JavaScript engines have their own bytecode. Since JavaScript files travel as source code string, they have to parse/compile source code string into bytecode at before execution. However, as we can specify a user agent type (e.g. browser type and version) in HTTP request, can't we make the server keep bytecode for each browser and respond accordingly to save some time at client? What's preventing us from taking this approach? I don't think browsers will have no problem even if some JavaScript files are given in bytecode and others in source string. Similarly, we have .pyc files in Python, and it runs well with .py files. [Update] Potential benefits I can think of are below. You could save parsing time at client. Parsing is fast, but it may be worth to do it for low-end devices. You could put some hints in bytecode. For example, JavaScriptCore (WebKit's JavaScript engine, JSC for short) patches bytecode with information gathered during runtime, such as types. JSC's bytecode is designed in a way that it has slots for such information. In terms of maintainability, the server can always send the original source code string if the client's browser is unsupported, and there are not so many different JavaScript engines. Supporting four most popular browsers (Chrome, Firefox, IE and Safari) seems feasible to me. In addition, I don't see bytecode instruction set changing frequently.
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45596427
has comment: http://stackoverflow.com/comment/45597063
has comment: http://stackoverflow.com/comment/45598041
downvote count: 1
has answer: http://stackoverflow.com/a/28649518
has comment: http://stackoverflow.com/comment/45596407
type: Question
tagged with: webkit
tagged with: bytecode
answer count: 1
has comment: http://stackoverflow.com/comment/45596421
has comment: http://stackoverflow.com/comment/45596401
tagged with: javascript
has title: Why not sending JavaScript files in browser-specific bytecode?

http://stackoverflow.com/a/35428418
type: Answer
has body: Change the default settings wow = new WOW( { boxClass: 'wow', // default animateClass: 'animated', // default offset: 0, // default mobile: true, // default live: true // default } ) wow.init(); to mobile:false
score: 19
upvote count: 19
answers question: http://stackoverflow.com/q/28626836
downvote count: 0

http://stackoverflow.com/comment/45638347
type: Comment
comment on: http://stackoverflow.com/a/28669577
score: 0
type: AnswerComment
has text: Deepa, the reason its showing old data is beacuase that model is sill in scope. I think if you destroy the old model before calling server / api, then validate the response you receive, you should be able to show a notification / message to the user that no results are retrieved.

http://stackoverflow.com/a/28668326
downvote count: 0
has body: The problem as I see it is that in the line if($(this).val().indexOf('.') == -1), the this is the Window object not the input control. Try adding an ID to the input control and reference the same in the code as: function validateQty(event) { var key = window.event ? event.keyCode : event.which; if (event.keyCode == 8 || event.keyCode == 46 || event.keyCode == 37 || event.keyCode == 39 ) { if($('#IdofInputControl').val().indexOf('.') == -1) return true; else return false; } else if ( key &lt; 48 || key &gt; 57 ) { return false; } else return true; }; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;input type="text" ID="IdofInputControl" onkeypress='return validateQty(event);'&gt; And your validation should work!
type: Answer
answers question: http://stackoverflow.com/q/28668036
upvote count: 1
score: 1

http://stackoverflow.com/q/28656977
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/75715655
score: 23
has comment: http://stackoverflow.com/comment/62556092
has title: Select2 Event for creating a new tag
has answer: http://stackoverflow.com/a/47121727
type: Question
downvote count: 0
upvote count: 23
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/65918623
tagged with: jquery-select2
linked to: http://stackoverflow.com/q/23295168
has answer: http://stackoverflow.com/a/63250228
has body: I'm using the jQuery Select2 (v4) plugin for a tag selector. I want to listen for when a new tag is created in the select element and fire an ajax request to store the new tag. I discovered there is the createTag event but this seems to fire every time a letter is entered into the select2 element. As shown in my fiddle: http://jsfiddle.net/3qkgagwk/1/ Is there a similar event that only fires when the new tag has finished being entered? I.e. it's enclosed by a grey box enclosing it.
answer count: 4
has comment: http://stackoverflow.com/comment/120205801
favorite count: 0
has answer: http://stackoverflow.com/a/28657702
has comment: http://stackoverflow.com/comment/45611351

http://stackoverflow.com/q/28645156
has comment: http://stackoverflow.com/comment/45597572
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28650986
has answer: http://stackoverflow.com/a/28650986
has answer: http://stackoverflow.com/a/28651886
accepted answer: http://stackoverflow.com/a/28651886
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45597639
has comment: http://stackoverflow.com/comment/45598091
has title: Website background on Chrome Mobile is bumpy
linked to: http://stackoverflow.com/q/24944925
tagged with: http://stackoverflow.com/tag/html
has body: On Chrome Mobile, the background of my website is very bumpy and glitches up and down with white sections. As far as I know it's because of the URL bar that hides. Example: https://www.youtube.com/watch?v=AtMcbLE803o The CSS I use to add the background: html { background: url(user-images/background.png) no-repeat center center fixed; background-size: cover; } Demo: http://jvnknvlgl.github.io/biography-website-template Source: http://github.com/jvnknvlgl/biography-website-template I'd like to fix this using CSS, but if I have to use Javascript I'd really like a simple explanation of how it works and how I should add it to my code, since I haven't used any Javascript yet. Thanks in advance!
tagged with: css
type: AnsweredQuestion
tagged with: google-chrome

http://stackoverflow.com/a/28750441
type: Answer
has comment: http://stackoverflow.com/comment/45783593
has comment: http://stackoverflow.com/comment/45782926
has body: Does anyone have any idea on how I should go about debugging this? Sometimes it's best to pull out a tiny portion of code, and see if it works in isolation. For example: http://jsfiddle.net/6v7z9fak/ js: $("body").on("click", ".reply-button", function(){ alert("test"); }); html: Reply As you'll see, it works fine. So you can be confident that the error is not in that bit of code alone. It is either another part of the code, or how the parts are interacting together, or something else. Now slowly add more code, test, and see where it breaks.
answers question: http://stackoverflow.com/q/28750146
has comment: http://stackoverflow.com/comment/45786091
score: 0
has comment: http://stackoverflow.com/comment/45783032

http://stackoverflow.com/q/28600279
type: Question
has body: I'm currently enrolled in a Javascript class and I wanted some help understanding how exactly scope works. We've been over topics like global scope, function scope, hoisting in class but I'm struggling to put it all together. So the question that I was specifically looking at consisted of figuring out what the following code outputted: x = 1; var a = 5; var b = 10; var c = function (a, b, c) { document.write(x); document.write(a); var f = function (a, b, c) { b = a; document.write(b); b = c; var x = 5; } f(a, b, c); document.write(b); var x = 10; } c(8, 9, 10); document.write(b); document.write(x); Now the solution that we have is that code will print out undefined 8 8 9 10 1 I needed some help understanding how exactly this happens. Specifically, I don't understand how the values of b vary depending on the statement we're looking at. Would appreciate it if someone could just run through the whole step-by-step for me. Thanks!
has answer: http://stackoverflow.com/a/28603106
answer count: 1
tagged with: javascript
has title: JS Global/Function Scope Understanding
tagged with: scope
score: 0
tagged with: hoisting
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45514250
tagged with: global-variables

http://stackoverflow.com/comment/45550880
type: AnswerComment
comment on: http://stackoverflow.com/a/28624476
has text: It is not a problem. This is only a preview. You have a problem with `mouseenter` and `mouseleave`. See how I solved it myself. I used `hover`, and gave him two functions. The first function is like `mouseenter`, the second is like `mouseleave`.
type: Comment
score: 0

http://stackoverflow.com/comment/45557276
has text: What exactly is the error you get? The way looks good.
type: Comment
comment on: http://stackoverflow.com/q/28628287
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45660145
comment on: http://stackoverflow.com/q/28661589
type: QuestionComment
type: Comment
has text: @ReverseEffect, yes I'll try to work this "not delegating properly" ;) thx. I'll see what i can do with getting some code which concerns the webview. thx again
score: 0

http://stackoverflow.com/a/28633933
has comment: http://stackoverflow.com/comment/45895747
score: 4
has body: self.data.url("https://...") It seems like you haven't read the documentation on data.url() It clearly states that The data.url() method returns a resource:// url that points at an embedded data file. Which means you cannot link to an external resource. Does anyone know if this is possible and how? No, contentScriptFile runs with (slightly) elevated privileges compared to regular web content, that's why you are not allowed to load scripts from sources that might change and could theoretically inject malicious code in the future. If you want to rely on external libraries and keep them up to date you could simply write a little build script that always downloads the newest version when building a new XPI. In principle you could just load the script via privileged XHR and then pass it as string, but that's probably not gonna pass AMO review. And piece of personal opinion: Since you're targeting a specific browser you don't really need jquery for its cross-browser logic, modern web APIs provide lots of convenience methods that you can get pretty far just with vanilla ES6-javascript and state-of-the-art DOM APIs. Iterators and arrow functions also make bulk operations fairly concise.
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/45612781
answers question: http://stackoverflow.com/q/28626395
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28626395

http://stackoverflow.com/comment/45574684
type: AnswerComment
score: 0
type: Comment
has text: The PHP loop is echoing Javascript code in the middle of a bunch of other JS, so it's really just dynamically creating JS code that you then need to send to the browser.
comment on: http://stackoverflow.com/a/28620446

http://stackoverflow.com/q/28726938
answer count: 2
linked to: http://stackoverflow.com/q/11194527
linked to: http://stackoverflow.com/q/17612630
upvote count: 3
tagged with: dom
has answer: http://stackoverflow.com/a/28728919
tagged with: algorithm
tagged with: highcharts
downvote count: 0
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28727622
has answer: http://stackoverflow.com/a/28727622
has body: I have some data displayed in two ways. Once as a table: Brakes 34% Headlights 12% And once as a pie chart (generated using Highchart). Highchart places the data into SVG paths and the order of the table data and piechart paths is the same ie. Brakes is the first 'tr' anchor and the first pie chart slice. I would like to link the two so that when I hover the table row it highlights the chart slice. What would be the best way to do this using Jquery/javascript? So far I have the following: $(function(){ var tr = $('table tr') // to get an array of the table rows var p = $('path') // to get an array of the paths // Sorry for my naivety but I am not too sure where to go beyond this point. }); Any help that can be offered would be much appreciated!
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/28728919
has title: Link table data with chart data Jquery
favorite count: 0
type: Question

http://stackoverflow.com/comment/45750314
comment on: http://stackoverflow.com/q/28732037
type: QuestionComment
type: Comment
score: 1
has text: @FelixKling, thank you so much for your response. According to the stack trace, after the render call, in the bind call, it returns ```method.apply(component, arguments)```, would the ```apply``` call not run the method?

http://stackoverflow.com/q/28603179
has comment: http://stackoverflow.com/comment/45511471
score: 6
accepted answer: http://stackoverflow.com/a/28603257
tagged with: css
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/28603257
has title: Jquery datatable with tri color rows
type: Question
upvote count: 6
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I tried jquery datatable with tri colored rows which is repeating alternatively.But i got only two colored rows repeating. Tried jquery datatable with tri colored rows I'm using property even/odd for coloring $(document).ready(function() { $('#example').dataTable(); } ); $(document).ready(function() { $("#example tr:even").css("background-color", "LightYellow"); $("#example tr:odd").css("background-color", "LightBlue"); });
favorite count: 0

http://stackoverflow.com/comment/45746099
score: 0
has text: On my browser, $(document).ready() is fired when _my browser_ finishes to load the page. That's it. When User A submits the form and she's redirected to the forum page. Other users don't get any update simply by $(document).ready(), if that's what you're looking for. What do you expect it to do?
type: Comment
comment on: http://stackoverflow.com/a/28729191
type: AnswerComment

http://stackoverflow.com/comment/45582321
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28641767
has text: Thank you for your replay and suggestion
type: Comment

http://stackoverflow.com/comment/45882292
comment on: http://stackoverflow.com/a/28762708
type: AnswerComment
has text: Hey buddy, it works. But it seems a new problem now. When text shows in editor, it lost it's formatting which it has....so please help me to keep its formatting as it was.
type: Comment
score: 0

http://stackoverflow.com/a/28845064
downvote count: 0
score: 3
answers question: http://stackoverflow.com/q/28689484
has body: Maybe AOP libraries for javascript like meld will help you? For example: var timeTook; var myObject = { doSomething: function(a, b) { return a + b; } }; function beforeFunction() { timeTook = performance.now(); } function afterFunction() { console.log("It took " + (performance.now() - timeTook)); } meld.before(myObject, 'doSomething', beforeFunction); meld.after(myObject, 'doSomething', afterFunction); See Also this question in SO.
upvote count: 3
type: Answer

http://stackoverflow.com/comment/45732292
has text: Thanks Kevin. I'm 100% sure the first example show [object Object]. I tried to post a picture of the firebug log output but I guess that's not possible in SO. I'm not familiar with the "Object..." code you posted. What does that do? Should I use it like this: `listnames = Object.prototype.toString.call( listnames );`
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28721674
type: Comment

http://stackoverflow.com/comment/48484616
score: 0
type: Comment
has text: Nice answer on here too: http://stackoverflow.com/questions/24352975/passport-google-oauth-on-localhost?lq=1
type: AnswerComment
comment on: http://stackoverflow.com/a/30082001

http://stackoverflow.com/comment/45757592
type: Comment
has text: What if I used, say, a signed Java applet which I would use to call exports from some DLL I created in C++ which can give me the information I want? Wouldn't that be cross-browser compatible?
comment on: http://stackoverflow.com/a/28733898
score: 0
type: AnswerComment

variables
tag name: variables
tags question: http://stackoverflow.com/q/28632053
tags question: http://stackoverflow.com/q/28707907
tags question: http://stackoverflow.com/q/28679781
tags question: http://stackoverflow.com/q/28648656
tags question: http://stackoverflow.com/q/28650506
tags question: http://stackoverflow.com/q/28638491
tags question: http://stackoverflow.com/q/28653243
tags question: http://stackoverflow.com/q/28628355
tags question: http://stackoverflow.com/q/28611192
type: Tag
tags question: http://stackoverflow.com/q/28749164
tags question: http://stackoverflow.com/q/28624816
tags question: http://stackoverflow.com/q/28623731
tags question: http://stackoverflow.com/q/28639805
tags question: http://stackoverflow.com/q/28746698
tags question: http://stackoverflow.com/q/28653103
tags question: http://stackoverflow.com/q/28596284
tags question: http://stackoverflow.com/q/28681303
tags question: http://stackoverflow.com/q/28683361
tags question: http://stackoverflow.com/q/28665160
tags question: http://stackoverflow.com/q/28681168
tags question: http://stackoverflow.com/q/28703433

http://stackoverflow.com/a/33184997
has body: In case you want to use ref you can get selected values like this: var select = React.findDOMNode(this.refs.selectRef); var values = [].filter.call(select.options, function (o) { return o.selected; }).map(function (o) { return o.value; }); 2018 ES6 update let select = this.refs.selectRef; let values = [].filter.call(select.options, o =&gt; o.selected).map(o =&gt; o.value);
answers question: http://stackoverflow.com/q/28624763
upvote count: 12
score: 12
has comment: http://stackoverflow.com/comment/60511811
downvote count: 0
has comment: http://stackoverflow.com/comment/86245747
type: Answer

http://stackoverflow.com/a/28724336
has body: All right, so you can't easily change the original data format. How big is the actual record and how often does it update? 'cause if it's not huge and doesn't change several times per second and you're going to do many lookups, it would be more efficient to create the mapping I mentionned and then read from it, than to look through the original structure every time. I'm going to assume so in this answer. Hope it helps. Another assumption in this code: that each area has exactly one postcode. function convertPlot(plot) { var mapping={} plot.forEach(function (r){ var locations=r.area.split(/,\s*/) for(var i=0, loc; loc=locations[i]; i++) mapping[loc]=r.postcode }) return mapping } Simply do this when you get the plot: mapping=convertPlot(plot) Then the lookup function becomes trivial: function lookup(adr) { if('string' == typeof adr) return adr+", "+mapping[adr] if(('object' == typeof adr) &amp;&amp; adr instanceof Array) return adr.map(lookup) throw new TypeError("cannot look up something that isn't a string or array or strings") }
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28717131
type: Answer
answers question: http://stackoverflow.com/q/28717131
downvote count: 0
score: 1

http://stackoverflow.com/comment/45526408
type: QuestionComment
comment on: http://stackoverflow.com/q/28611241
has text: There is a lot of code but I will try to chose the most important things. One sec...
score: 0
type: Comment

http://stackoverflow.com/comment/45774525
type: AnswerComment
comment on: http://stackoverflow.com/a/28745519
score: 0
type: Comment
has text: Ok that makes it crystal clear. However I also read that when you update the nodes or the link array that you must call force.start() to update the simulation. I don’t see this here. Does it mean the **tick** handler is calling it in the background when it reaches the end of the handler? And are **link** and **node** references the DOM elements but 'd' references that state of the simulation?

http://stackoverflow.com/a/28682869
has body: I tried your jsbin and it works OK, but submenus can't be seen, just try to add some background to your CSS, for example: nav ul ul li a { width: 200px; display: block; padding: 10px 15px; text-decoration: none; color: #FFF; background-color: red; } And you will see your menu working.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28682643
type: Answer
answers question: http://stackoverflow.com/q/28682643
score: 1
upvote count: 1

http://stackoverflow.com/a/28741659
has body: Score: Pen: http://codepen.io/ferahl/pen/GgGpLd Notes: Better to not really use IDs for anything, use classes, query them with document.querySelector or document.querySelectorAll. The + you see there converts to a number (it's shorthand) Better to use "unobtrusive" javascript - I add the event handler in JS using addEventListener preventDefault stops the form submitting. There is also another useful function called stopPropagation which you can look into. Return false does both - it is better to have an awareness of which or both you want to do.
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45767321
answers question: http://stackoverflow.com/q/28741363

http://stackoverflow.com/a/46281836
type: Answer
has body: Here is what I did to implement filtering with FullCalendar. Event is triggered by use of a dropdown. Initial view shows all events. Using dropdown triggers the filters. Filters hold across month, week and day views. $(document).ready(function() { $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,basicWeek,basicDay' }, defaultDate: (new Date()).toISOString().substring(0, 10), navLinks: true, // can click day/week names to navigate views editable: true, eventLimit: true, // allow "more" link when too many events events: 'include/myfeed.php' }); }); function filterByDealer(dealer){ $('#calendar').fullCalendar('removeEvents'); $('#calendar').fullCalendar('addEventSource','include/myfeed.php?d='+dealer); }
score: 0
answers question: http://stackoverflow.com/q/28625855

http://stackoverflow.com/comment/45518511
comment on: http://stackoverflow.com/a/28603369
score: 1
has text: *Apologies to women programmers for my use of "he", but it's still true that most malicious programmers are male. (Someday this will no longer be true; I don't know if I should welcome it, or fear it.)
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28703625
tagged with: promise
answer count: 9
linked to: http://stackoverflow.com/q/28250680
has body: I've recently run into a certain situation a couple of times, which I didn't know how to solve properly. Assume the following code: somethingAsync() .then( afterSomething ) .then( afterSomethingElse ) function afterSomething( amazingData ) { return processAsync( amazingData ); } function afterSomethingElse( processedData ) { } Now a situation might arise where I would want to have access to amazingData in afterSomethingElse. One obvious solution would be to return an array or a hash from afterSomething, because, well, you can only return one value from a function. But I'm wondering if there is a way to have afterSomethingElse accept 2 parameters and invoke it likewise, as that seems a lot easier to document and understand. I'm only wondering about this possibility since there is Q.spread, which does something similar to what I want.
has answer: http://stackoverflow.com/a/64169241
has answer: http://stackoverflow.com/a/28703648
has answer: http://stackoverflow.com/a/49957460
score: 117
linked to: http://stackoverflow.com/q/22773920
upvote count: 117
has comment: http://stackoverflow.com/comment/45697353
accepted answer: http://stackoverflow.com/a/28703648
possible better answer: http://stackoverflow.com/a/32402374
linked to: http://stackoverflow.com/q/17970420
has comment: http://stackoverflow.com/comment/113569946
has answer: http://stackoverflow.com/a/32402374
has answer: http://stackoverflow.com/a/51774165
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/45105895
has answer: http://stackoverflow.com/a/28703689
type: Question
has answer: http://stackoverflow.com/a/38708392
has answer: http://stackoverflow.com/a/43535405
has title: How do you properly return multiple values from a Promise?
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/q
has comment: http://stackoverflow.com/comment/97121029
favorite count: 0

http://stackoverflow.com/q/28714298
answer count: 1
duplicate of: http://stackoverflow.com/q/28250680
tagged with: javascript
has answer: http://stackoverflow.com/a/28714863
upvote count: 71
linked to: http://stackoverflow.com/q/28250680
has comment: http://stackoverflow.com/comment/45716475
favorite count: 0
downvote count: 0
has comment: http://stackoverflow.com/comment/45716585
tagged with: node.js
has comment: http://stackoverflow.com/comment/45716804
type: AnsweredQuestion
score: 71
tagged with: bluebird
has comment: http://stackoverflow.com/comment/45716597
has title: How to chain and share prior results with Promises
accepted answer: http://stackoverflow.com/a/28714863
has body: I'm using the bluebird library and need to make a series of HTTP requests and need to some of the response data to the next HTTP request. I've built a function that handles my requests called callhttp(). This takes a url and the body of a POST. I'm calling it like this: var payload = '{"Username": "joe", "Password": "password"}'; var join = Promise.join; join( callhttp("172.16.28.200", payload), callhttp("172.16.28.200", payload), callhttp("172.16.28.200", payload), function (first, second, third) { console.log([first, second, third]); }); The first request gets an API key which needs to be passed to the second request and so on. How do get the response data from the first request? UPDATE This is the callhttp function: var Promise = require("bluebird"); var Request = Promise.promisify(require('request')); function callhttp(host, body) { var options = { url: 'https://' + host + '/api/authorize', method: "POST", headers: { 'content-type': 'application/json' }, body: body, strictSSL: false }; return Request(options).spread(function (response) { if (response.statusCode == 200) { // console.log(body) console.log(response.connection.getPeerCertificate().subject.CN) return { data: response.body }; } else { // Just an example, 200 is not the only successful code throw new Error("HTTP Error: " + response.statusCode ); } }); }
has comment: http://stackoverflow.com/comment/45716532
type: Question

http://stackoverflow.com/q/28744128
has title: Load content and the separate the content V/S load iframe?
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28744201
tagged with: ajax
has body: I am working with jquery and i have an issue concerning loading content from a server, separating the content from the rest of the content already on the page and then immediately when the content(from the server) has loaded, do some dom manipulation. The problem i am getting is some css styles are being overridden. I am faced with two situations: 1) From what i read you can load content from a server using the jquery load() method and then provide a callback that will run when the content finishes to load. However i am unable to separate the content styles and some javascript functions from running. Here is the jquery code i am using: $('#ContentIn').load('the_url_of_the_content_to_load', callback_function_to_run()) But then with situation one i am unable to separate the contents from the server from that already on the page. 2) Then i tried using an iframe like so: $('#ContentIn').append( '&lt;iframe src="' + object.responseJSON.the_url + '"&gt;&lt;/iframe&gt;' ); Note that i am using Ajax to get a url and then i am successfully injecting the iframe into the body of the current page. But then with situation two i am unable to run a function as soon as the iframe finishes loading the contents. In hope of an answer, MMK
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: iframe
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28744201
score: 0
tagged with: dom
type: Question

http://stackoverflow.com/a/28745719
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/28745529
score: 2
accepted answer of: http://stackoverflow.com/q/28745529
downvote count: 0
upvote count: 2
has body: You first selector is incorrect: $('ul.inner-li-texts li a') should be $('#inner-li-texts li a') You have a typo in your animate statement. Your target code does not work, it should look something like this: $('#inner-li-texts li a').on('click', function(event) { var target = $($(this).attr('href')); if ( target.length ) { event.preventDefault(); $('html, body').animate({ scrollTop: target.offset().top }, 10000); } });

http://stackoverflow.com/a/28779761
has body: A GeoJSON field has to be included a geometry type as a string. So a GeoJSON field must be defined like the following; geometry: { type: { type: String }, coordinates: [Number] } or if you want to define a default value you might use the below line; geometry: { type: { type: String, default:'Point' }, coordinates: [Number] } Good luck..
downvote count: 0
type: Answer
upvote count: 16
has comment: http://stackoverflow.com/comment/107621012
answers question: http://stackoverflow.com/q/28749471
score: 16

http://stackoverflow.com/q/28632247
tagged with: unit-testing
type: Question
has comment: http://stackoverflow.com/comment/45564862
tagged with: javascript
has body: I thought I was using the AngularJS $q interface correctly. But the function I'm passing to the then callback is never being executed. And I am calling resolve in the function which is wrapped by $q. I've verified that resolve() is being called, yet it seems this is not the same function which is chained with .then(): $q(function(resolve, reject) { resolve(); reject(); console.log("This happens"); //This shows that resolve() is being called }).then(function() { console.log("This doesn't"); //Yet this never gets executed }).catch(function() { console.log("This also doesn't happen"); }); The output is: This happens What am I doing wrong? My environment is a KarmaJS unit test with mocha and sinon-chai.
answer count: 1
has comment: http://stackoverflow.com/comment/45565085
has answer: http://stackoverflow.com/a/28632505
tagged with: angular-promise
has comment: http://stackoverflow.com/comment/45564708
has title: $q resolve function not triggering then
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28632505
score: 0

http://stackoverflow.com/comment/46037841
type: AnswerComment
type: Comment
has text: I tried this, but it doesn't seem to work for me. Or rather, my implementation doesn't seem to work.
comment on: http://stackoverflow.com/a/28837310
score: 0

http://stackoverflow.com/a/28922689
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46136458
accepted answer of: http://stackoverflow.com/q/28719091
type: Answer
answers question: http://stackoverflow.com/q/28719091
has comment: http://stackoverflow.com/comment/46136800
has body: Since you have: .pipe( gulp.dest( './Top/Web/Areas/Area1/' ) ); You need to use: &lt;!-- build:js ../../Scripts/CompiledScripts/vendor.min.js --&gt;
has comment: http://stackoverflow.com/comment/46136243
score: 0

http://stackoverflow.com/comment/45524961
type: Comment
type: QuestionComment
has text: Yes! I named the function and thought it was defined.
comment on: http://stackoverflow.com/q/28599497
score: 0

http://stackoverflow.com/comment/45614819
type: Comment
comment on: http://stackoverflow.com/q/28659638
type: QuestionComment
has text: Have you tried `$("#currency").val('EUR');`? Here's the documentation page: http://api.jquery.com/val/. `$("#currency")` returns a jQuery object, unlike a native DOM element you can't set the value by changing the `value `property.
score: 1

http://stackoverflow.com/comment/45761476
type: AnswerComment
has text: Your answer helped me allot, I was able to manipulate your console a bit and send my own access token along to invite a user to one of my SSO user binders and from there I will be able to formulate the right event handlers. (btw I can't upvote this solution due to my lack of reputation)
type: Comment
comment on: http://stackoverflow.com/a/28714576
score: 0

http://stackoverflow.com/q/28635183
type: AnsweredQuestion
type: Question
answer count: 2
downvote count: 2
score: -2
has comment: http://stackoverflow.com/comment/45570277
possible better answer: http://stackoverflow.com/a/28635246
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45570274
favorite count: 0
has body: First of all, let me note that although my JavaScript is fairly long, I believe all of the modifications needed to fix my code will probably be in the (document).ready function. The problem I'm running into is that when I generate a textbox (.wy) in JavaScript by switching the items on menu 2 and enter a value, it returns undefined when I click the calculate button. However, I am able to get my HTML-generated textbox (.amount) value without any problems. How do I fix this? HTML: Salary Converter 2 Salary Converter hourly wage weekly earnings monthly salary annual salary to hourly wage weekly earnings monthly salary annual salary $ per hour y z Calculate x and Javascript: $(document).ready(function(){ $('#menu1').on("menuselect", function (event, ui) { var value1 = $("#menu1 option:selected").text(); var value2 = $("#menu2 option:selected").text(); }); value1 = "hourly wage"; value2 = "hourly wage"; $("#menu1").change(function() { //ifStatement; }); $("#menu2").change(function() { //ifStatement; $(".anchor1").html(" "); }); $("#button").click(function() { console.log($(".wy").val()); console.log($(".amount").val()); //conversion(); }); }); function ifStatements() { console.log("D"); switch1(); switch2(); if (value1 == "hourly wage") { $(".per1").html("hour"); } if (value1 == "weekly earnings") { $(".per1").html("week"); } if (value1 == "monthly salary") { $(".per1").html("month"); } if (value1 == "annual salary") { $(".per1").html("year"); } if (((value1 == "weekly earnings") && (value2 == "annual salary")) || ((value2 == "weekly earnings") && (value1 == "annual salary"))) { console.log("x"); $(".anchor1").html(" "); $(".anchor2").html(""); } else if (((value1 == "weekly earnings") && (value2 == "monthly salary")) || ((value2 == "weekly earnings") && (value1 == "monthly salary"))) { $(".anchor1").html(" "); $(".anchor2").html(""); } else if (((value1 == "hourly wage") && (value2 == "annual salary")) || ((value2 == "hourly wage") && (value1 == "annual salary"))) { $("…
accepted answer: http://stackoverflow.com/a/28635274
has title: Javascript generated textbox value = undefined
upvote count: 0
has answer: http://stackoverflow.com/a/28635274
has answer: http://stackoverflow.com/a/28635246

http://stackoverflow.com/a/32275282
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28731334
answers question: http://stackoverflow.com/q/28731334
has body: You could use a computed observable to calculate the average. function AppViewModel() { var self = this; self.story_rev = ko.observable(); self.animation_rev = ko.observable(); self.sound_rev = ko.observable(); self.characters_rev = ko.observable(); self.enjoyment_rev = ko.observable(); self.averageRating = ko.computed(function() { var ratings = [self.story_rev(), self.animation_rev(), self.sound_rev(), self.characters_rev(), self.enjoyment_rev()]; return ratings.reduce(function(a, b) { return a + parseInt(b, 10); }) / ratings.length; }); } var model = new AppViewModel(); model.story_rev(1); model.animation_rev(2); model.sound_rev(3); model.characters_rev(4); model.enjoyment_rev(5); //Should output the average (in this case 3) console.log(model.averageRating()); &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.2.0/knockout-min.js"&gt;&lt;/script&gt;
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/45778961
comment on: http://stackoverflow.com/a/28731201
score: 0
type: AnswerComment
has text: Thanks, I incorporated the functionality in a seperate service using $location instead of through a function in the directive's 'link' property and now it is working! Thanks!
type: Comment

http://stackoverflow.com/q/28685432
has comment: http://stackoverflow.com/comment/45663615
has answer: http://stackoverflow.com/a/28820361
upvote count: 1
type: Question
tagged with: javascript
answer count: 1
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45665225
favorite count: 0
tagged with: parse-platform
has title: Returning result of parse cloud code relation query
type: UnansweredQuestion
has body: I'm using Parse Cloud Code to host a web application but I'm having a problem trying to get a relation query to work. I've tried an example from Coderwall https://coderwall.com/p/n22mqq/including-relational-data-in-a-query-parse-com but I'm not sure how to gather the result of the query before trying to render the result. function queryProducts(limit) { var post = Parse.Object.extend("Post"); var query = new Parse.Query(post); query.limit(limit); var data = new Array(); query.find().then(function (posts) { var cb = _.after(posts.length, function () { console.log("after"+ data); return data; }); _.each(posts, function (post) { var images = post.relation("images"); images.query().find().then(function (images) { data.push(post); cb(); }); }); }); } app.get('/', function (req, res) { results = queryProducts(10); res.render('index', { products: results }); });

http://stackoverflow.com/comment/45746205
comment on: http://stackoverflow.com/a/28685628
type: AnswerComment
score: 0
type: Comment
has text: @ngDeveloper, if you think it's solved, please mark my answer as such.

http://stackoverflow.com/comment/45608333
type: Comment
has text: I need to get todays date(feb 22 2015) as time stamp , After few days if I use Date(2015,22,2) , I must get the same time stamp generated on feb 22 2015
comment on: http://stackoverflow.com/a/28655932
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45597678
comment on: http://stackoverflow.com/q/28650136
has text: please show us what you have tried so far.
score: 1
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28619328
possible better answer: http://stackoverflow.com/a/28619357
has answer: http://stackoverflow.com/a/28619357
has body: I am adding an element to div with following line: $('#myDiv').append("Google"); But it is adding as html to myDiv how to add this code as a text ?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28619349
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
has title: Block the html in append
type: Question
accepted answer: http://stackoverflow.com/a/28619349
answer count: 2
upvote count: 1

http://stackoverflow.com/q/28673172
type: Question
tagged with: polymer
score: 1
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28692941
has body: I have a list of elements and i want that each element will have 2 pages/2 views. Each element has a generic content ( ). The problem is that when i'm using core-animated-pages to wrap my generic content, my list of elements are one over each other. I know that it is because the animated-pages converts my content position to absolute (and i don't want to change that) but why the element content doesn't get its child height in this case? I took the demo from the polymer site to demonstrate a bit better what i'm trying to accomplish here - inside the post-card.html i inserted the core-animated-pages so that when i click on each element it will switch view to "NEXT PAGE!" NEXT PAGE!
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: UnansweredQuestion
has title: Polymer - content tag inside core-animated-pages doesn't take height
upvote count: 1

http://stackoverflow.com/q/28644184
type: Question
has title: Javascript / JQuery prevent scroll on textbox
accepted answer: http://stackoverflow.com/a/28644446
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has body: I'm building a mobile web app and have added the following code when a form is loaded: document.ontouchmove = function(e){ e.preventDefault(); } This stops the user from scrolling and works for all div elements. However if a user "drags" on a text input box, the page will scroll. Is it possible to stop this? I'm happy to use javascript or jquery.
has answer: http://stackoverflow.com/a/28644446
has comment: http://stackoverflow.com/comment/45586866
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45586545

http://stackoverflow.com/q/28724417
favorite count: 0
has title: Javascript with IE 11 issue
has comment: http://stackoverflow.com/comment/45735744
has body: I have a web application written 15-18 years ago, I am working on asp.net web page which is using obsoleted iframe. the below line of code only works in IE8 and getting objects count =1439, the same line ignores by all other browsers and return null. Iframe code: var frame = window.document.all.tooltipFrame; I resolved this issue by accesing the element and fixed my code behind instead. Thank you
has comment: http://stackoverflow.com/comment/45735890
has comment: http://stackoverflow.com/comment/45735524
upvote count: 0
has comment: http://stackoverflow.com/comment/45736746
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45742659
type: Question
has comment: http://stackoverflow.com/comment/45736178
tagged with: internet-explorer
has comment: http://stackoverflow.com/comment/45735673
score: -2
tagged with: dom
downvote count: 2
has comment: http://stackoverflow.com/comment/45735625
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28724502

http://stackoverflow.com/comment/45715928
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28713133
has text: Sure.. IE version 8 and Angular JS Version 1.2.26

http://stackoverflow.com/q/28729046
accepted answer: http://stackoverflow.com/a/28729445
has title: Q promise with underscore .find()
type: AnsweredQuestion
score: 3
upvote count: 3
tagged with: underscore.js
type: Question
has body: I trying to use _.find() in the context of a Q promise. My problem seems to be from the fact that my predicate function contains a call to an asynchronous (node-style) function. Here is my code: var IsAlreadyQueued = function() { return Q.ninvoke(kueSearcher, 'delayed') .then(function(ids) { return Q(_.find(ids, function(id) { // return true; // This works kue.Job.get(id, function(err, job) { if (job.type === 'jobtype') { return true; } }); })); }); }; So as I said in comments in the code, if i do return true; instead of calling kue.Job.get() it works. Can you see what's wrong with my use of _.find() in a promise? Thanks a lot for your help.
answer count: 2
tagged with: find
has comment: http://stackoverflow.com/comment/45744531
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/q
has answer: http://stackoverflow.com/a/28729445
has comment: http://stackoverflow.com/comment/45744564
has comment: http://stackoverflow.com/comment/45744487
linked to: http://stackoverflow.com/q/22027792
possible better answer: http://stackoverflow.com/a/28729693
favorite count: 0
linked to: http://stackoverflow.com/q/14220321
has comment: http://stackoverflow.com/comment/45744393
tagged with: promise
has answer: http://stackoverflow.com/a/28729693

http://stackoverflow.com/comment/45762156
comment on: http://stackoverflow.com/q/28739025
has text: http://jqueryui.com/autocomplete/#combobox
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28630956
answer count: 0
type: UnansweredQuestion
upvote count: 1
score: 1
type: Question
has comment: http://stackoverflow.com/comment/45562711
downvote count: 0
tagged with: jsp
has comment: http://stackoverflow.com/comment/45561936
tagged with: javascript
has title: External JS File Will Not Connect to JSP Page
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has body: OK, so I am working on a small application. I have CSS and JS directly on my JSP page. Earlier in the week, I decided to create external pages for both to create a cleaner page. I created them both under WebContent/CSS (or in the case of the JS /JS) and the file name. I am doing this in Eclipse, and I had problems connecting the CSS at first. I was able to find out the location eclipse was taken by setting the source to "${pageContext.request.contextPath}/css/mycssfile.css I then took the value I found in the source code on the page, popped it in there since errors were being thrown due to the usage of the pageContext code, and it worked for the CSS. Then I went to do the same thing for the JS. The JS is primarily working as a front end validator, so if it's not working I have a back end validator (I'm using spring mvc) that picks up the errors. I have tried doing the pageContext thing again, no avail. &lt;script type="text/javascript" src="&lt;c: url value="/myPlayApp/js/myjavascriptfile.js"/&gt;"&gt; &lt;/script&gt; That also did not work. &lt;script type="text/javascript" src="/myPlayApp/js/myjavascriptfile.js"&gt; &lt;/script&gt; This did not either. The JS code will function perfectly if I put it within Script tags in the page. I have set alerts as a debugging method to see if it's getting into the file, and it's not even doing that. Any idea of what I can change on the import, or is there something else I must be doing?
tagged with: spring-mvc
has comment: http://stackoverflow.com/comment/45561989

http://stackoverflow.com/a/34189635
upvote count: 9
downvote count: 5
score: 4
type: Answer
has comment: http://stackoverflow.com/comment/60310070
answers question: http://stackoverflow.com/q/28647604
has body: window.scrollTo(0,1); this will help you but this javascript is may not work in all browsers

http://stackoverflow.com/a/28598638
has body: Angular is purely client side. It won't store anything (unless you put it in localStorage or sessionStorage) on the client side. Since the array is stored client side, you'll need to ask the server(or local/session storage) for the emails that have been added on every page reload event(refresh or reload).
score: 0
answers question: http://stackoverflow.com/q/28598561
type: Answer

http://stackoverflow.com/comment/45546763
comment on: http://stackoverflow.com/q/28619313
score: 0
type: QuestionComment
has text: I am not seeing any big difference between Ember-Cli and Typescript. TypeScript is more useful definately. What Ember-Cli is trying to achieve is same as you would use Typescript, Grunt-Cli
type: Comment

http://stackoverflow.com/comment/45673607
type: AnswerComment
has text: This could work well if the divs are empty, but if they contains other elements, I could change heavily the layout of the page, in that I could wrap the iframe and my div inside a wrapper div and attaching it on the original parent.parent div : it would change also the original position of the video... Instead, if I don't use the wrapper div, I could have my created div not just under the video.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28664425

http://stackoverflow.com/q/28681461
has comment: http://stackoverflow.com/comment/45655897
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45655762
has comment: http://stackoverflow.com/comment/45655830
has body: I have a CSS file that in short contains blocks like this: %container .grass { position:fixed; bottom:0px; height:3%; background-color:#4CAF50; width:105%; margin-left:-10px; } Where %container is the container where all elements with class .grass should be affected, %container is always an id say #container or #appcontent But I think I'm wrong somewhere because it's not working, and it may be something really simple too, so where is it? I have more content such as: %container .subcontainer:not(.ui-draggable-dragging) { cursor:grab; } %container .numbercontainer &gt; .number, %container .signcontainer &gt; .sign { display:block; } Okay here is the preprocessor, I'm absolutely sure it generates the content properly because I checked its output and the result given, but for some reason it doesn't work. App.prototype.getMainCSS = function(url) { console.log("GET: " + url); if (App.dependenciesLoaded.indexOf(url) === -1) { $.get(url,(function(data){ var cssfile = document.createElement("link") cssfile.rel = "stylesheet"; cssfile.type = "text/css"; cssfile.innerHTML = data.replace(/%container/g,"#" + this.element.id); App.dependenciesLoaded.push(url); document.getElementsByTagName("head")[0].appendChild(cssfile); }).bind(this)); } }
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45655960
has comment: http://stackoverflow.com/comment/45655740
tagged with: css
has comment: http://stackoverflow.com/comment/45656139
has title: CSS affect only elements that are inside a container?
has answer: http://stackoverflow.com/a/28681888
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45656061
has comment: http://stackoverflow.com/comment/45655672
has comment: http://stackoverflow.com/comment/45656031
has comment: http://stackoverflow.com/comment/45655719
has comment: http://stackoverflow.com/comment/45656302
type: Question
has comment: http://stackoverflow.com/comment/45655794

http://stackoverflow.com/q/28707754
has title: Improving performance of dictionary lookup for large amounts of data
has answer: http://stackoverflow.com/a/28707890
tagged with: node.js
type: AnsweredQuestion
tagged with: performance
has body: I'm struggling with performance when comparing a large amount of strings to a dictionary (SOWPODS converted to JSON and split into files by starting letter). The JSON-files are currently stored in a directory like this: words/ a.json b.json ... z.json An input string of 'test' in my code results in the following array of strings. [ 'test', 'tes', 'tet', 'te', 'tst', 'ts', 'tt', 't', 'est', 'es', 'et', 'e', 'st', 's', 'tets', 'tts', 'ets', 'tset', 'tse', 'set', 'se', 'tste', 'tte', 'ste', 'ttes', 'ttse', 'etst', 'ett', 'etts', 'estt', 'stt', 'stet', 'stte', 'sett' ] To determine which files are to be read, I loop through the alphabet checking which letters exist in the input string ('test'), e.g.: var i; ['a', 'b', ..., 'z'].forEach(function(letter) { i = input.indexOf(letter); if(i !== -1) { // letter exists, process [letter].json // avoid reading the same file twice input[i] = ''; } }); Files read for the above example would be t.json, e.json, s.json. The computation time for the above example is merely ~0.08s, but increases quickly with the amount of strings in the array and the number of files processed. Are there any immediate performance boosters you come to think of when seeing this example? Should I be using a database? Was splitting the JSON into files by starting letter the wrong choice? All answers are welcome! Thank you for reading this!
score: 0
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45705213
accepted answer: http://stackoverflow.com/a/28707890
type: Question
tagged with: javascript
answer count: 1

http://stackoverflow.com/q/28642680
downvote count: 0
tagged with: javascript
has body: I'm trying to animate a DOM element from one position to another across a route change. For example: +------+ | o | (o = the element) | | | | +------+ Click the button, route changes. On the new template, the button is down here: +------+ | | | | | o | +------+ Right now I have two separate html files for the views and the buttons are two separate DOM elements. How can I animate the button from one position to the other during the route change? Edit: I built an example of what I want to accomplish here. The key component missing from the example is that the two pages are on the same route. I want to animate this transition cross-route, with entire different content on each page except one common, animated, hero element. I also discovered that the term for what I am trying to do is "hero element" and updated the question title.
has comment: http://stackoverflow.com/comment/45593550
tagged with: css-animations
has comment: http://stackoverflow.com/comment/45584386
accepted answer: http://stackoverflow.com/a/29444712
favorite count: 0
has title: Animate hero elements between AngularJS routes
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45597197
tagged with: css
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/45584421
has comment: http://stackoverflow.com/comment/45586063
upvote count: 1
has answer: http://stackoverflow.com/a/29444712
type: Question
possible better answer: http://stackoverflow.com/a/28642710
answer count: 2
has answer: http://stackoverflow.com/a/28642710

http://stackoverflow.com/q/28721147
score: 0
has comment: http://stackoverflow.com/comment/45729438
has comment: http://stackoverflow.com/comment/45729585
has title: jquery datatables sort in javascript nested object
has comment: http://stackoverflow.com/comment/45730115
has body: The jquery datatables plugin is able to enhance an already existing html-table and is able to read a special data-order tag for providing a different sorting value, as seen here: System Architect Mon 25th Apr 11 $320,800/y I am trying the same with a nested javascript object as source, like so { "jobDescription":"System Architect", "startDate": { "display": "Mon 25th Apr 11", "sort": 1303686000 }, "salary": { "display": "$320,800/y", "sort": 320800 } }, Anyone who already implemented that?
type: UnansweredQuestion
tagged with: datatable
answer count: 0
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45627463
type: Comment
type: QuestionComment
has text: So run chrome to allow file access.
score: 0
comment on: http://stackoverflow.com/q/28666267

http://stackoverflow.com/comment/45688226
type: Comment
type: QuestionComment
has text: You don't seem to `var i;`
comment on: http://stackoverflow.com/q/28698971
score: 0

http://stackoverflow.com/q/28654482
type: AnsweredQuestion
downvote count: 0
accepted answer: http://stackoverflow.com/a/28654510
score: 1
type: Question
has answer: http://stackoverflow.com/a/28654510
tagged with: javascript
has title: Javascript error with Returning the provided string with the first letter of each word capitalized
upvote count: 1
answer count: 1
tagged with: string
favorite count: 0
has comment: http://stackoverflow.com/comment/45605855
has body: I am working on solving a basic coding challenge, I feel like my code SHOULD work. But this line is not reassigning correctly "str[i][0] = str[i].charAt(0).toUpperCase();" I just don't know why this is working this way in Javascript, I think I've solved this same problem in Ruby without issue. Any tips or links on where to learn more about how this works in Javascript would be MUCH appreciated! This is the challenge: Return the provided string with the first letter of each word capitalized. function titleCase(str) { str = str.toLowerCase(); str = str.split(" "); for (var i = 0; i &lt; str.length; i++) { str[i][0] = str[i].charAt(0).toUpperCase(); } str = str.join(" "); return str; } console.log(titleCase("I'm a little tea pot"));

http://stackoverflow.com/q/28726261
has comment: http://stackoverflow.com/comment/45739421
tagged with: jquery-ui-accordion
tagged with: javascript
has comment: http://stackoverflow.com/comment/45739968
has comment: http://stackoverflow.com/comment/45739889
has body: I have used JQuery Accordion to successfully hide elements that can then be opened by clicking on header, but I needed an additional level of nesting - something that Accordion does not support So Ive been trying to use Nested Accordion, even without make any other changes just importing the Nested Accordion Javascript completely breaks any nesting or formatting before I even try to add the extra layer of nesting - what am I doing wrong. Full examples here: Accordion http://jthink.net/songkong/scratch/Example1/html/test4.html Nest Accordion http://jthink.net/songkong/scratch/Example2/html/test4.html
has comment: http://stackoverflow.com/comment/45739706
has comment: http://stackoverflow.com/comment/45739288
downvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/29296925
has comment: http://stackoverflow.com/comment/45739810
tagged with: jquery
has comment: http://stackoverflow.com/comment/46023416
favorite count: 0
has comment: http://stackoverflow.com/comment/46014400
upvote count: 2
score: 2
type: AnsweredQuestion
has title: Convert Jquery Accordion to Nested Accordion
has comment: http://stackoverflow.com/comment/45739565
has comment: http://stackoverflow.com/comment/45739368
has answer: http://stackoverflow.com/a/29296925
type: Question

http://stackoverflow.com/comment/45625256
comment on: http://stackoverflow.com/q/28664865
has text: @thefourtheye - sorry, i just don't know why the code wasn't working. i thought it was the first if statement, but i wasn't sure if i was taking the right approach
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45742014
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28727794
has text: Are you asking how to reference a specific table? Or does the table identity change dynamically as the page is refreshed or otherwise altered?
score: 0

http://stackoverflow.com/comment/45539114
score: 0
has text: Are you importing Bootstrap after you have developed the style? Bootstrap is a framework which should be used at the beginning of a build. Any customisations should be done after the framework is in place.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28617705

http://stackoverflow.com/q/28599618
tagged with: checkbox
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28599915
upvote count: 0
has comment: http://stackoverflow.com/comment/45505549
has comment: http://stackoverflow.com/comment/45505207
type: Question
score: -2
tagged with: javascript
has title: Show and hide the text field in the same row for each checkbox
has comment: http://stackoverflow.com/comment/45505503
possible better answer: http://stackoverflow.com/a/28599915
answer count: 2
downvote count: 2
accepted answer: http://stackoverflow.com/a/28600001
has body: In my jsp, I created dynamic check boxes from database.Now I want to show and hide the text field in the same row for each check box.tell me the possible ways.I was tried with some java script and jquery but text field comes only for the first check box. function Checkbox(){ if(document.getElementById('select').checked){ document.getElementById('test').style.display='block'; document.getElementById('test1').style.display='block'; }else{ document.getElementById('test').style.display='none'; document.getElementById('test1').style.display='none'; } } <c:if test="${empty PAStranslist || PASEditValue == null}"> <c:if test="${!empty assetsList}"> <c:forEach items="${assetsList}" var="assetsList" varStatus="loop"> <c:out value='${assetsList.asset}'/> <%-- <c:if test="${assetsList.selectedCheckBox == 'true'}"> --%> <form:checkbox path="selectedCheckBox" name ="select" value="${assetsList.id}" id="select" onclick="Checkbox();"/> Asset Code <form:input path="assetCode" maxlength="20" onkeyup="check(this, '20');"></form:input> <%-- </c:if> --%> </c:forEach> </c:if> <c:if test="${empty assetsList}"> No physical assets to display </c:if> </c:if>
tagged with: jsp
has comment: http://stackoverflow.com/comment/45505216
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28600001

http://stackoverflow.com/q/28624293
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45551137
has body: A plugin developer who developed a comments-plugin that I use has instructed me to add the following JavaScript: function WPACLoadMoreComments() { window.WPACLoadMoreCount = window.WPACLoadMoreCount || 1; var url = (new Uri(location.href)).replaceQueryParam('WPACTake', window.WPACLoadMoreCount * 20).toString(); if (WPAC.LoadComments(url, {updateUrl: false})) { window.WPACLoadMoreCount++; } } I assume he meant to put it in functions.php but the site doesn't load when I insert this code. I tried to inset it at the end, I tried to wrap it with &lt;?php the function... ?&gt; How do I do that correctly?
accepted answer: http://stackoverflow.com/a/28624521
tagged with: javascript
has title: Add JavaScript function to wordpress theme
has answer: http://stackoverflow.com/a/28624326
upvote count: 2
has answer: http://stackoverflow.com/a/28624436
downvote count: 1
has answer: http://stackoverflow.com/a/28624521
favorite count: 0
tagged with: php
answer count: 4
possible better answer: http://stackoverflow.com/a/28624326
score: 1
has answer: http://stackoverflow.com/a/28624555
tagged with: wordpress
type: Question

http://stackoverflow.com/comment/45559197
has text: could you provide a fiddle or equivalent?
comment on: http://stackoverflow.com/q/28629432
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45859415
type: AnswerComment
comment on: http://stackoverflow.com/a/28726161
type: Comment
has text: ok :-) http://stackoverflow.com/questions/28792246/get-value-of-dom-element-in-code-behind Can you help me?
score: 0

http://stackoverflow.com/a/28750053
answers question: http://stackoverflow.com/q/28749937
upvote count: 1
has body: You should be able to just walk you way down your object by using the bracket notation [] to access each property in turn: var curr = oldobject; // this keeps track of our current position for (var i=0; i &lt; splitMap.length-1; i++) { if (curr.hasOwnProperty(splitMap[i]) { curr = curr[splitMap[i]]; } else { // your map is wrong! Up to you how to handle this error } } curr[splitMap[i]] = newValue; // for the last property, we set the value
downvote count: 0
has comment: http://stackoverflow.com/comment/45803470
type: Answer
has comment: http://stackoverflow.com/comment/45812043
score: 1

http://stackoverflow.com/comment/45552295
type: AnswerComment
type: Comment
has text: try OnClientClick="return Analyse()"
comment on: http://stackoverflow.com/a/28623298
score: 0

http://stackoverflow.com/a/28712287
answers question: http://stackoverflow.com/q/28712259
has body: Try this below code: $(document).ready(function(){ $('body').on('click',".buttonRmv",function(){ $(this).closest('tr').remove(); }); });
score: 0
type: Answer

http://stackoverflow.com/comment/45509026
comment on: http://stackoverflow.com/a/28601606
type: Comment
has text: iframe.onload = function () { //here you should do this ,when the iframe is complete loaded }
score: 0
type: AnswerComment

http://stackoverflow.com/q/28735388
has comment: http://stackoverflow.com/comment/45755641
has comment: http://stackoverflow.com/comment/45755685
has title: Notification in javascript - similar to new emails in gmail
has answer: http://stackoverflow.com/a/28735824
has comment: http://stackoverflow.com/comment/45755614
type: Question
has comment: http://stackoverflow.com/comment/45755752
has answer: http://stackoverflow.com/a/28735730
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45755622
answer count: 2
upvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45755714
has body: I am creating a widget which will update some live NEWS happening. I want to push notification to the widget everytime I get some new information in my database. It is similar to live feed. I am unsure how to start this one in javascript. I donot want to poll every nth second to get the information. I want the server to push information to the client everytime the server gets a new information. It is similar to gmail. You get an email even without refreshing the page. Any pointers will be definitely helpful.
has comment: http://stackoverflow.com/comment/45755651
type: UnansweredQuestion
downvote count: 2

http://stackoverflow.com/a/62298591
has body: This is the efficient &amp; clean way: (Import lodash identity and sortBy): TS: function sortByArray&lt;T, U&gt;({ source, by, sourceTransformer = identity }: { source: T[]; by: U[]; sourceTransformer?: (item: T) =&gt; U }) { const indexesByElements = new Map(by.map((item, idx) =&gt; [item, idx])); const orderedResult = sortBy(source, (p) =&gt; indexesByElements.get(sourceTransformer(p))); return orderedResult; } Or in JS: function sortByArray({ source, by, sourceTransformer = _.identity }) { const indexesByElements = new Map(by.map((item, idx) =&gt; [item, idx])); const orderedResult = _.sortBy(source, (p) =&gt; indexesByElements.get(sourceTransformer(p))); return orderedResult; }
score: 1
downvote count: 1
answers question: http://stackoverflow.com/q/28719795
has comment: http://stackoverflow.com/comment/128881409
upvote count: 2
type: Answer

http://stackoverflow.com/q/28716778
downvote count: 0
score: 1
type: Question
has title: Jquery scroll event triggers at bottom
upvote count: 1
has answer: http://stackoverflow.com/a/28719272
tagged with: javascript
tagged with: jquery
favorite count: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28721376
has answer: http://stackoverflow.com/a/28717495
type: UnansweredQuestion
has body: At http://www.mtjmedia.nl/Homepage/contact/ I have a simple jquery code that is supposed to make the big social icons appear/fade in if you're scrolling. Instead, the three icons appear when you scroll only to the bottom of the page.. Does someone know what the problem is? var $win = $(window); var $img = $('.fadeInScroll'); $win.on('scroll', function () { var scrollTop = $win.scrollTop(); $img.each(function () { var $self = $(this); var prev = $self.offset(); if (prev) { var pt = 0; pt = prev.top - $win.height(); $self.css({ opacity: (scrollTop - pt) / ($self.offset().top - pt) }); } else { $self.css({ opacity: 1 }); } }); }).scroll(); I'm using this script: http://trulycode.com/bytes/simple-appear-on-scroll/

http://stackoverflow.com/comment/45706780
type: AnswerComment
type: Comment
has text: Are you sure you have made right changes and you have paste the full source code? I can reproduce your error and also fix the error as mentioned. See the [jsfiddle](http://jsfiddle.net/e1mym9qa/)
comment on: http://stackoverflow.com/a/28707866
score: 0

http://stackoverflow.com/q/28725912
tagged with: css
possible better answer: http://stackoverflow.com/a/28726130
type: AnsweredQuestion
score: 0
has title: Can't animate font-size of child elements?
has answer: http://stackoverflow.com/a/28726054
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has body: So I have this menu that changes height when you scroll, now that works absolutely great. Only thing is, now I'm trying to animate the font-size so that the font will become smaller as well. I did some research on child selectors in jQuery ($('parent > child')), but when I applied this in my script this didn't work. Anyone has a solution? [HTML] Button Button Button Button Button content-test [CSS] #content_parent { max-width:1250px; min-width:750px; min-height:100%; box-shadow:0 0 10px 2px rgb(180,180,180); -webkit-box-shadow:0 0 10px 2px rgb(180,180,180); -moz-box-shadow:0 0 10px 2px rgb(180,180,180); } #header_parent { position:fixed; right:0; left:0; margin-left:auto; margin-right:auto; max-width:1250px; min-width:750px; height:60px; background-color:rgb(50,50,50); box-shadow:-6px 0 rgba(0,0,0,0), 6px 0 rgba(0,0,0,0), 0 6px 4px -2px rgb(180,180,180); -webkit-box-shadow:-6px 0 rgba(0,0,0,0), 6px 0 rgba(0,0,0,0), 0 6px 4px -2px rgb(180,180,180); -moz-box-shadow:-6px 0 rgba(0,0,0,0), 6px 0 rgba(0,0,0,0), 0 6px 4px -2px rgb(180,180,180); border-bottom-left-radius:2px; -webkit-border-bottom-left-radius:2px; -moz-border-bottom-left-radius:2px; border-bottom-right-radius:2px; -webkit-border-bottom-right-radius:2px; -moz-border-bottom-right-radius:2px; border-top-left-radius:0; -webkit-border-top-left-radius:0; -moz-border-top-left-radius:0; border-top-right-radius:0; -webkit-border-top-right-radius:0; -moz-border-top-right-radius:0; } #body_parent { padding-top:60px; max-width:1250px; min-width:750px; background-color:rgb(245,245,245); } table.menuItems { width:100%; height:100%; border-collapse:collapse; border:0; } .menuItems td { width:20%; height:100%; text-align:center; color:rgb(230,230,230); font-family:Sansation; font-weight:bold; font-size:25px; } [JS] $(window).on('scroll', function () { var scrollTop = $(window).scrollTop(); if (scrollTop > 0) { $('#header_parent').stop().animate({height: "40px"},50); $('#body_parent').stop().animate({paddingTop: "40px"},45)…
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28726054
has answer: http://stackoverflow.com/a/28726130
has comment: http://stackoverflow.com/comment/45738872

http://stackoverflow.com/q/28739747
linked to: http://stackoverflow.com/q/18189198
tagged with: javascript
has comment: http://stackoverflow.com/comment/45763480
duplicate of: http://stackoverflow.com/q/18189198
score: 0
answer count: 0
type: UnansweredQuestion
has body: I am using PHP file_exists() function to check whether a file exists or not: &lt;script&gt; var getval=&lt;?php echo file_exists("Settings.ini"); ?&gt;; if(getval) { // If file exits // Reading values from Settings.ini file and intializing form element } else { // If file doesn't exist // Initializing form element with default values } &lt;/script&gt; This code is working fine and I am able to initialize the form element with values from Settings.ini file if the file exists. But if the file does not exist, then I am not able to initialize the form element with default values. i.e control not going into else block. Thanks in advance for any help.
tagged with: php
has title: PHP -file_exists() Function?
has comment: http://stackoverflow.com/comment/45763166
type: Question

http://stackoverflow.com/comment/45534819
comment on: http://stackoverflow.com/q/28615885
type: Comment
has text: The question is, why not just ` `, no javascript needed ?
type: QuestionComment
score: 2

http://stackoverflow.com/comment/45556319
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28627445
has text: @JakobOlsen So you do need the encoding, but I've also made an edit for an MVC specific issue too.

http://stackoverflow.com/comment/45660267
type: AnswerComment
score: 0
type: Comment
has text: well that it's not really a problem as `$('input[name="' + params.propertytested + '"]')` will obtaint even a hidden field
comment on: http://stackoverflow.com/a/28679024

magicsuggest
tags question: http://stackoverflow.com/q/28741896
tag name: magicsuggest
type: Tag

http://stackoverflow.com/q/28683420
answer count: 0
has body: if i have an object like a.b.c.d = "exists" and i want to check if (a.b.c.d){..} is true. Then how can i do it without getting an error. if obj a doesn't exist. I get an error and program stops. I want program to continue and if obj a or b or c or d don't exist, just it should evaluate to false. it makes sense if a doesn't exit then so doesn't d, why does browser give an error here? And how can i fix this i certianly don't want to do this: if (a &amp;&amp; a.b &amp;&amp; a.b.c &amp;&amp; a.b.c.d) {..}
has comment: http://stackoverflow.com/comment/45659794
has title: how to check if property exists in children of the object?
type: Question
has comment: http://stackoverflow.com/comment/45659904
has comment: http://stackoverflow.com/comment/45659728
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45659831
linked to: http://stackoverflow.com/q/2631001
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45659873
has comment: http://stackoverflow.com/comment/45659819
duplicate of: http://stackoverflow.com/q/2631001

http://stackoverflow.com/comment/45774986
type: QuestionComment
type: Comment
has text: Of course it's obvious that one shoud set borderColor not color, not obvious why if I set `color=red` my border will also become red.
comment on: http://stackoverflow.com/q/28746216
score: 0

http://stackoverflow.com/comment/45653336
has text: @Oriol – Indeed, although I'm surprised that when I poke at the spec, HTMLCollection doesn't seem to be defined in terms of NodeList. (I was just skimming it though).
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28680172
type: Comment

http://stackoverflow.com/q/28748139
has comment: http://stackoverflow.com/comment/45779968
type: Question
has comment: http://stackoverflow.com/comment/45780632
score: 0
has comment: http://stackoverflow.com/comment/45780015
has comment: http://stackoverflow.com/comment/45780076
has comment: http://stackoverflow.com/comment/45780425
linked to: http://stackoverflow.com/q/17568630
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/21385892
has comment: http://stackoverflow.com/comment/45779869
has body: http://jsfiddle.net/Share_Knowledge/dgtqptr7/ I am trying to use autocomplete functionality of jquery ui into my project But i have no idea why THE SECOND $('.search').autocomplete() is not working. maybe i have to use $.noConflict() if yes how i can use it $.noConflict() would any body tell me how to use it to solve this problem out any help please i would be thankful using firebug i get these errors POST http://localhost/autoservice/public_html/tickets/load_spareparts/11/instance First i don't what is the word instance coming from..??? here is the order of the js files -js/jquery-ui.min.js -jquery.autocomplete.js jQuery(document).ready(function($) { $.ajaxSetup( { type: "post" } ); // THIS IS WORKING PERFECTLY $("#item").autocomplete(url+'/item_search', { minChars:0, selectFirst: false, width: 749, multiple: false, matchContains: true, formatItem: formatItem, formatResult: formatResult }); // THIS SHOW THE ERROR WHICH MENTIONED UP THERE // IT'S NOT WORKING $('#search').autocomplete({ minLength: 0, source: path3+'/get_spareparts', focus: function( event, ui) { $('#search').val( ui.item.item_id ); return false; }, select: function(event, ui) { output = ''; output += ' '; output += ' '+ui.item.item_id+' '; output += ' '; output += ' '+ui.item.item_name+' '; output += ' '+ui.item.price+' '; output += ' '; output += ' '+ui.item.desc+' '; output += ' Delete '; output += ' '; $('.inject').append(output); $(this).val(''); deleteItem(); // DELETE ITEM return false; } }) .autocomplete( "instance" )._renderItem = function( ul, item ) { return $( " " ) .append( "" + item.desc + " " + item.item_id + "" ) .appendTo( ul ); }; function deleteItem () { $('.spareTrash').on('click', function(event) { event.preventDefault(); $(this).parent().parent().fadeOut(900, function(){ $(this).remove();}); }); } }); // END READY JQUERY
has comment: http://stackoverflow.com/comment/45780097
has comment: http://stackoverflow.com/comment/45779677
has comment: http://stackoverflow.com/comment/45780896
has comment: http://stackoverflow.com/comment/45781873
has comment: http://stackoverflow.com/comment/45780285
answer count: 0
type: UnansweredQuestion
has title: jQuery autocomplete Conflict -
has comment: http://stackoverflow.com/comment/45779834

http://stackoverflow.com/a/28609274
answers question: http://stackoverflow.com/q/28609171
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45522856
has body: How about that ? students_and_teachers.map(function( name ) { name = name.split( ':' ); return name[ 0 ] === 'student' ? name[ 1 ] : ''; }).filter( Boolean ); Reference: Array.prototype.filter, Array.prototype.map, String.prototype.split

http://stackoverflow.com/comment/45552015
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28621175
has text: Hi @mscdex, how does this help me to stop the input stream from reading?
score: 0

http://stackoverflow.com/comment/45584240
type: Comment
comment on: http://stackoverflow.com/q/28642542
type: QuestionComment
has text: hilarious, everyone can run my code but me?!? Could it be something else in my environmentment?
score: 0

http://stackoverflow.com/q/28689939
has answer: http://stackoverflow.com/a/28691148
type: AnsweredQuestion
score: 2
has title: call function after complete page load
downvote count: 0
has comment: http://stackoverflow.com/comment/45671594
has body: I'm using a javascript in my html page.. I have been recording the time taken using the navigation API .. When I try to findout the total load time (navigationStart - loadEventEnd) I find that the loadEventEnd is 0 . But also found that the loadEventStart value is recorded .. I print these values on console inside window.onload = function() {} . . From the above stats I assume that my function is called after the load event has fired and before it has completed .. However using onunload function gives me the result , the result cannot be viewed as it is printed in the console and unload event is triggered when moving away from the page .. Please help me find a solution .
favorite count: 0
type: Question
possible better answer: http://stackoverflow.com/a/49774247
has answer: http://stackoverflow.com/a/49774247
has comment: http://stackoverflow.com/comment/45671698
accepted answer: http://stackoverflow.com/a/28691148
upvote count: 2
answer count: 3
has answer: http://stackoverflow.com/a/49774899
tagged with: javascript

http://stackoverflow.com/q/28719346
has comment: http://stackoverflow.com/comment/45756165
accepted answer: http://stackoverflow.com/a/28719442
score: 0
answer count: 2
has body: I have a pager with this url: news?page=1&amp;f[0]=domain_access%3A3". I need a regex to replace the page=1 with page=2 The 1 and 2 are variable, so I need to find page= + the first character after that. How can I do that @EDIT: from the answers, I distilled var url = $('ul.pager .pager-next a').attr("href"); var re = /page=(\d+)/i; var page = url.match(re); var splitPage = page[0].split("="); var pageNumber = parseInt(splitPage[1]); pageNumber += 1; var nextPagePart = 'page=' + pageNumber; var nextPageUrl = url.replace(re, nextPagePart); $('ul.pager .pager-next a').attr("href", nextPageUrl); There might be a shorter approach ?
possible better answer: http://stackoverflow.com/a/28719494
tagged with: regex
has answer: http://stackoverflow.com/a/28719494
has answer: http://stackoverflow.com/a/28719442
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45725572
has title: Javascript Regex first character after occurence
tagged with: javascript

http://stackoverflow.com/q/28721937
tagged with: http://stackoverflow.com/tag/q
score: 0
has title: Collection data from different pages for a list of data and sending them together
tagged with: arrays
answer count: 1
has answer: http://stackoverflow.com/a/28728521
accepted answer: http://stackoverflow.com/a/28728521
has body: I have an array of publishers and each publisher have motionID, this ID is used to get data from API Like 'https://example.com/v2/feeds/'+publisher.motion+'/events/?page=' publisher.motion is motionID. Every publisher of the motion have multiple pages of event. 'https://example.com/v2/feeds/'+publisher.motion+'/events/?page=1' 'https://example.com/v2/feeds/'+publisher.motion+'/events/?page=2' . . 'https://example.com/v2/feeds/'+publisher.motion+'/events/?page=n' I want to collected all the events from all pages of motion and save to that publisher.motionEvent array.And I also want to call another function when all data is collected for all publishers. And Publisher are push into allProduct array My Code: getEventsOfPublishes(objectList,'M') }).then(function(allPublisherWithMotionEvents){ console.log(allPublisherWithMotionEvents) }) here objectList is all publisher which have motionID as there Property. function getEventsOfPublishes(objectList,key){ if(objectList.length){ if(key == 'M'){ var promises = objectList.map(getEventsOfMotion); return Q.all(promises); } }else{ return {msg:"No Objects"}; } } using q.map for calling function for each publisher. function getEventsOfMotion(publisher){ if(publisher.motion !== undefined){ //console.log('motion') url = 'https://example.com/v2/feeds/'+publisher.motion+'/events/?page='; publisher.motionEvent = [] getAllDataOfEvents(1,url,'M',publisher).then(function(test){ allProducts.push(test) //console.log(test) }) }else{ console.log('yes') } } calling function 'getAllDataOfEvents' for those publisher which have motion Id, as there property. function getAllDataOfEvents(currentPage,url,key,publisher){ var deferred = Q.defer(); var result httprequest(url+currentPage, function(err, res, body) { var events = JSON.parse(body); var next; var tempDeviceObject = {} // console.log(events.objects) saveProducts(events.objects,key,publisher) if(events.links.next != null){ currentPage++ getAllDataOfEvents(currentPage,url,key,publisher).then(fu…
tagged with: node.js
type: AnsweredQuestion
type: Question
tagged with: javascript

http://stackoverflow.com/comment/45605572
score: 0
type: Comment
type: QuestionComment
has text: Can you post your work into jsfiddle please? The more you can give people to work with, the better they can help you out. Thanks.
comment on: http://stackoverflow.com/q/28654289

http://stackoverflow.com/q/28726366
has answer: http://stackoverflow.com/a/28726755
has body: I have this js object var toggleItem = { attrData : '', toggleNew : '', toggleOld : '', //var self : this, init : function(){ self = this; self.listener(); }, listener : function(){ jQuery('.btn-save').click(function(){ var current = this.id.split('_').pop(); self.toggleNew = jQuery('.toggle-data-new_'+current).val(); self.toggleOld = jQuery('.toggle-data-old_'+current).val(); self.updateForm(); }); }, updateForm : function(){ jQuery('#toggle-product-form #new').val(self.toggleNew); jQuery('#toggle-product-form #old').val(self.toggleOld); jQuery('#toggle-product-form').submit(); }, } In the past i have often come across the issue of this value getting changed to whatever element I reference with jQuery. In this case I would like to store this in a new variable called self. But it is important that self does not become globally available. You'll see at the top of the object where I wrote //var self : this, is now commented out. This is because placing var in front of it renders this error - Unexpected identifier in the console. But if I remove the var part I'm left with the same problem as I have now by placing it in the init function (it's global). Question I want it to be available to everything inside the object and nothing outside? Whatever solution works I would also plan to apply to the other three variables declared at the top. NB I know I could use the name of the object instead of self and leave this global with relatively little risk of it conflicting with something else but I'm sure there has to be a way of re-assigning the value of this whilst keeping it only accessible (in its current form) from within the toggleItem object.
type: AnsweredQuestion
has title: Storing this object in custom private variable
type: Question
has answer: http://stackoverflow.com/a/28726472
accepted answer: http://stackoverflow.com/a/28726755
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28726427
score: 0
has answer: http://stackoverflow.com/a/28726427
answer count: 3
tagged with: this
tagged with: global
tagged with: jquery

http://stackoverflow.com/comment/45764168
has text: Yeah it could be alright. Maybe have a look into disabling the cache on that picture?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28738426

http://stackoverflow.com/comment/45495743
type: AnswerComment
type: Comment
has text: Whoops, slip of the finger. Meant to say defined, hence the undefined
comment on: http://stackoverflow.com/a/28594171
score: 0

http://stackoverflow.com/q/28614035
downvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/28614115
favorite count: 0
has answer: http://stackoverflow.com/a/28614861
accepted answer: http://stackoverflow.com/a/28614262
tagged with: angularjs
answer count: 5
has answer: http://stackoverflow.com/a/72303400
has comment: http://stackoverflow.com/comment/45531478
has comment: http://stackoverflow.com/comment/45531520
type: AnsweredQuestion
score: 2
possible better answer: http://stackoverflow.com/a/72303400
has title: How to select first item in javascript object using javascript?
upvote count: 2
has body: I am quite new to javascript/angular and was pondering whether or not there is an easy way to grab the first item in a javascript object/array. EDIT: I do have control at this point in time in how I format the array, so perhaps there is a better way to do this using ID as keys? Lets say I want to match the first item in the array. My thinking is to simply loop through the object checking the ID value. The js function may look something like this: app.controller('gamesController',function(){ //Function to load the games this.loadGameIntoModal = function(game_id){ for (i=0;i&lt;=length(games);i++){ if (games[i]['id'] === game_id) { this.games = games[i]['id']; //Load the modal $("#game_modal").modal(); break; } } } }); So my question is simply, is there a better way to do this than to use a loop? var games = [ { id : 1, name : 'ABC Games', games : [ { id : 1, name : 'ABC 1', }, { id : 2, name : 'ABC 2', } , { id : 3, name : 'ABC 3', } ] }, { id : 2, name : 'XYZ', games : [ { id : 4, name : 'XYZ 1', }, { id : 4, name : 'XYZ 2', } , { id : 5, name : 'XYZ 3', } ] } ];
has answer: http://stackoverflow.com/a/28614116
type: Question
has answer: http://stackoverflow.com/a/28614262
tagged with: javascript
has comment: http://stackoverflow.com/comment/45531724

http://stackoverflow.com/q/28654061
has body: I have a need for a &lt;select&gt; on a form to control the remaining available inputs. This is achieved easily with angular by binding the &lt;select&gt; to the src of an ng-include. The problem is each time the user changes the selected value (and hence the src template), angular compiles the template from scratch and attaches a new scope. This has the effect of wiping all the input data each time. The user expects if they change back to a previously selected option, all the field data they previously entered will still be there. Is there any built in way to achieve the desired behaviour? Ideally an option so that the ng-include will re-use a previously compiled template and associated scope? One workaround is to ng-include all the templates, and use ng-show to only display the current one. This seems heavy though, there is a lot of DOM elements on the page unnecessarily. (Especially for my use-case where there will be about ~20 different templates, and this whole &lt;select&gt; element and dynamic template control may be repeated on a single page up to 40 times.) Here is a jsFiddle. The desired outcome is the counter on template 1 is persisted when changing the dropdown to template 2 and back to 1.
tagged with: angularjs
type: Question
has answer: http://stackoverflow.com/a/28654788
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45609693
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: angularjs-ng-include
has title: Reusing previously instantiated templates with ng-include
has comment: http://stackoverflow.com/comment/45605184
score: 1
favorite count: 0

http://stackoverflow.com/a/28656175
accepted answer of: http://stackoverflow.com/q/28655451
upvote count: 4
type: AcceptedAnswer
downvote count: 0
score: 4
answers question: http://stackoverflow.com/q/28655451
has body: You are likely not including the file where the provider is defined in in your karma.conf.js dependencies list. See this question: Include dependencies in Karma test file for Angular app? I would rename the $_Config to something else, '$' is usually reserved for angular-specific components.
has comment: http://stackoverflow.com/comment/74453687
has comment: http://stackoverflow.com/comment/74452199
type: Answer

http://stackoverflow.com/comment/45642770
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28674181
has text: Dropzone is actually pretty nice. I've a production site using it now, and the client was extremely happy with it. How many images are you trying to upload at once? In your console, can you inspect the `POST`?
score: 0

http://stackoverflow.com/tag/csv
type: Tag
tags question: http://stackoverflow.com/q/28703574
tag name: csv
tags question: http://stackoverflow.com/q/28727388
tags question: http://stackoverflow.com/q/28642915
tags question: http://stackoverflow.com/q/28668797
tags question: http://stackoverflow.com/q/28657344
tags question: http://stackoverflow.com/q/28683194

http://stackoverflow.com/comment/45610191
comment on: http://stackoverflow.com/q/28600431
has text: @CBroe, I tried this and the same error for that line came up. `Uncaught TypeError: Cannot read property 'value' of undefined`
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28632505
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28632247
has body: You need to call $rootScope.$apply(). $q(function(resolve, reject) { resolve(); console.log("This happens"); //This shows that resolve() is being called }).then(function() { console.log("This too!"); }); $rootScope.$apply();
accepted answer of: http://stackoverflow.com/q/28632247
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/28645511
tagged with: javascript
tagged with: jquery
has title: How to convert ascii character in string to character in jquery?
answer count: 1
type: UnansweredQuestion
has body: I have an input button : &lt;input type="button" class="btn btn-success pull-right" id="doneBtn" value="@Resource.Add (0) @Resource.productsToCampaign" /&gt; @Resource.Add and @Resource.productsToCampaign is dynamicly loaded depends on which language a user have chosen. The problem is that when i want to update (0) to some number depends on how many items user chooses, @Resource.Add in one language have some special character which encodes to &#248; when i update value of the button. what happends when user updates item list : var add = '\@Resource.Add'; $("#doneBtn").val(add + '(' + temporarySelectedItems.length + ')' + '@Resource.productsToCampaign'); charcode at will not work, because strings in different languages are not same length Any ideas?
tagged with: model-view-controller
score: 0
tagged with: asp.net-mvc-3
has answer: http://stackoverflow.com/a/28645650
type: Question
tagged with: asp.net-mvc

http://stackoverflow.com/a/28705796
has comment: http://stackoverflow.com/comment/45701315
has body: As it is your code gives me errors when I try to call it like you specify, but regardless you should simply be able to check if the date you're going to give as an answer is one of your invalid dates, and if so then return the next working day: (pseudocode) newDate.setDate(datStartDate.getDate() + new Number((~~((lngNumberOfWorkingDays + intOffset) / intWorkingDays) * intNonWorkingDays) + lngNumberOfWorkingDays + intModifier)); if (newDate == "01/01/2015" || newDate == "26/01/2015" || ....) { return addWorkingDays(newDate, 1, blnIncSat, blnIncSun); } else { return newDate; }
type: Answer
has comment: http://stackoverflow.com/comment/45701692
downvote count: 0
answers question: http://stackoverflow.com/q/28705618
score: 1
accepted answer of: http://stackoverflow.com/q/28705618
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/a/28643409
has comment: http://stackoverflow.com/comment/131373114
upvote count: 55
downvote count: 0
has comment: http://stackoverflow.com/comment/131372990
type: Answer
has comment: http://stackoverflow.com/comment/45585151
has comment: http://stackoverflow.com/comment/116594787
has body: The issue is that when the browser encounters the closing tag inside a open '; /*-->*/ Using and instead of also works. One potential downside to this might be if you also want to have JavaScript strings that also contain these closing comments or CDATA, then it may not work. Option 3 - Put the JavaScript into an external file: Of course, moving the JavaScript into an external file will avoid this issue altogether, though it might not be preferable.
answers question: http://stackoverflow.com/q/28643272
accepted answer of: http://stackoverflow.com/q/28643272
score: 55
type: AcceptedAnswer

http://stackoverflow.com/a/28685687
type: Answer
answers question: http://stackoverflow.com/q/28685513
has body: I would do something like the following: (?:^|,)([^,]+)(?=.*,\1(?:,|$)) See Regex 101 Demo here. Please note that I've taken the liberty of removing spaces from your comma-delimited list. It just makes things easier.
score: 0

http://stackoverflow.com/comment/45568610
comment on: http://stackoverflow.com/q/28634366
has text: `var getamt2 = (value1 - Number(getamt));`
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45521330
comment on: http://stackoverflow.com/a/28608515
type: Comment
has text: didn't change anything. it's only running on load... codepen added to the original post.
type: AnswerComment
score: 0

http://stackoverflow.com/a/28654788
answers question: http://stackoverflow.com/q/28654061
has comment: http://stackoverflow.com/comment/45642297
has body: I found this question interesting. Short of putting the model in a service (which is probably the correct way), I don't think there is a built in way to cache templates with ng-include without using ng-repeat, as demonstrated in this fiddle. (blank) url of the template: {{template.url}} As you point out, the downside of this solution is you end up with a lot of elements in the DOM. For fun, I wrote a version of ng-include that caches the template element and reuses it. You still end up potentially creating just as many DOM nodes in the worst case, but since they are created only on-demand, and since only one is ever in the DOM at any given time, it should remain fairly efficient from an angular perspective. Here is the fiddle for this directive. .directive('cacheInclude', function ($compile, $http, $templateCache) { return { link: function (scope, element, attrs, ctrl) { var cache = {}; var currentElement = element; var replaceCurrent = function(cacheEntry) { currentElement.replaceWith(cacheEntry); currentElement = cacheEntry; }; scope.$watch(function(){ return scope.$eval(attrs.src); }, function () { var src = scope.$eval(attrs.src); if (!cache[src]) { $http.get(src, {cache: $templateCache}).then(function (result) { cache[src] = $compile(result.data.trim())(scope.$new()); replaceCurrent(cache[src]); }); } else { replaceCurrent(cache[src]); } }); } } }) It's not "built in", but I think it is a good middle ground solution. Note, the directive is "for example only" and still requires error handling, etc.
downvote count: 0
has comment: http://stackoverflow.com/comment/45639964
type: Answer
has comment: http://stackoverflow.com/comment/45642722
has comment: http://stackoverflow.com/comment/45642073
has comment: http://stackoverflow.com/comment/45637920
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/45637818

http://stackoverflow.com/q/28683194
has comment: http://stackoverflow.com/comment/45660106
has comment: http://stackoverflow.com/comment/45659428
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/csv
tagged with: sockets
has title: Return CSV file using Socket IO + Node.Js failing
tagged with: node.js
has body: I am new to Node.Js and trying to return a CSV file using SOCKET IO on my Node Layer. This is my client which is in Angular sockets.request('get.csv',data).then(function(response){ },function(error){ console.log('Something went wrong'); console.error(error); }); This is my Node Layer:- socket.js socketService.on('get.csv',controller.dataToCSV); This is my dataToCSV function:- module.exports.dataToCSV = function (req,res){ var csv = 'Hello'; res.attachment('test.csv'); res.writeHead(200, { 'Content-Type': 'text/csv; charset=utf-8' }); res.end(csv); } I am getting an error at res.attachment TypeError: undefined is not a function I am sure I am going wrong in terms of the return type with socket. Any directions would be great. Thanks.
answer count: 0
type: Question
tagged with: export-to-csv
tagged with: javascript
has comment: http://stackoverflow.com/comment/45659967
has comment: http://stackoverflow.com/comment/45659547
score: 0

http://stackoverflow.com/comment/45658940
score: 0
comment on: http://stackoverflow.com/a/28681510
type: AnswerComment
has text: From the CryptoJS docs, I would suggest using `key.toString(CryptoJS.enc.Base64)` -- see the fiddle http://jsfiddle.net/t1tb9jad/
type: Comment

http://stackoverflow.com/comment/45582542
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28641710
has text: can you try `file_get_contents` instead of `fopen`
score: 0

http://stackoverflow.com/comment/45582194
comment on: http://stackoverflow.com/q/28641616
score: 0
has text: http://www.datejs.com/
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45580190
has text: It does work on a hidden field, and you should not be hard coding the url. Use `'@Url.Action("UpdateStatus", "Student")';` as you have done, but put that line in the main view (ditto for `var id = "@Model.StudentId";`) or assign them to the elements `data-` attributes. But why are you mixing vanilla javascript and jquery like that - its very difficult to follow.
score: 0
comment on: http://stackoverflow.com/q/28640246
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45560706
has text: Probably the last is null so Chrome isn't showing it?
comment on: http://stackoverflow.com/q/28630275
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45568728
type: Comment
comment on: http://stackoverflow.com/a/28633157
score: 0
type: AnswerComment
has text: DBS - apologies - didn't update the url for the fiddle - it's correct now. Seems to work ok. can you confirm?

http://stackoverflow.com/comment/45540593
type: Comment
type: QuestionComment
score: 0
has text: So, the easiest path - which I'm fine with, at least for now - would be to just delete the property from the scope that's bound to the control via `ng-model`, if/when that form control is disabled. Ideally, though, I'd prevent the user from losing work by storing the control's existing data somewhere, so if they then change their mind and decide to reenable the control, it still has the value they'd set previously. Hope that makes sense.
comment on: http://stackoverflow.com/q/28617609

http://stackoverflow.com/comment/130643338
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28627111
has text: `According to the specification, to show the confirmation dialog an event handler should call preventDefault() on the event. The HTML specification states that calls to window.alert(), window.confirm(), and window.prompt() methods may be ignored during this event. See the HTML specification for more details`. from https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
score: 0

http://stackoverflow.com/comment/45679973
type: QuestionComment
has text: No, I never succeed to import qml file from js
score: 0
comment on: http://stackoverflow.com/q/28694314
type: Comment

http://stackoverflow.com/q/28748773
answer count: 2
upvote count: 0
has body: I want to set interval between clicks with this code. This is the script : var inputs = document.getElementsByClassName('class-name'); for(var i=0; i&lt;inputs.length;i++) { inputs[i].click(); }
has title: I want to set interval between clicks with this code
tagged with: dom-events
favorite count: 0
has comment: http://stackoverflow.com/comment/45779551
score: -3
type: AnsweredQuestion
downvote count: 3
possible better answer: http://stackoverflow.com/a/28748885
type: Question
has answer: http://stackoverflow.com/a/28749336
accepted answer: http://stackoverflow.com/a/28749336
tagged with: javascript
has answer: http://stackoverflow.com/a/28748885
has comment: http://stackoverflow.com/comment/45779586

http://stackoverflow.com/comment/45653779
type: Comment
type: QuestionComment
has text: Can you please format your code, and define "it does not work".
score: 3
comment on: http://stackoverflow.com/q/28680400

http://stackoverflow.com/comment/45607338
has text: I've updated my question as per your request. Thanks for trying to help. Hope you can dig out the solution.
comment on: http://stackoverflow.com/q/28654688
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28613375
type: Answer
answers question: http://stackoverflow.com/q/28612960
score: 0
has body: in your code you have each td in its own tr meaning there is no next td to go to. you should adjust your jquery to focus on the rows, as in this fiddle (shown below) $().ready(function() { $(".songs").click(function(){ $('.songs').parents('tr').removeClass('active'); $(this).parents('tr').addClass('active'); }); $('#next_button').click(function(){ var current = $('tr.active'); $('.songs').parents('tr').removeClass('active'); current.next('tr').addClass('active'); }); }); You'll also notice I'm using .next() which will just grab the next element or the next element which matches the argument (in this case tr) - no need to get all then restrict to just the first. All this will make your fiddle behave as expected, however, if you want to target the td's within each of the tr's you'll have to add .find('td') to get the td out of the retrieved tr, like this. Here the only line that is changed is the one that adds the class on click of next, which is now: current.parent().next('tr').find('td').addClass('active'); Refactoring out $('.songs').parents('tr').removeClass('active'); into it's own function would also clear your code a bit and make it easier to follow, a good habit! (also +1 for using a variable to store a returned JQuery DOM object - var current = $('tr.active'); - another good habit for code clarity and efficiency, especially when you are deraling with more complicated DOM structures and functions)

http://stackoverflow.com/a/42466327
has comment: http://stackoverflow.com/comment/133311458
has comment: http://stackoverflow.com/comment/132980848
score: 0
type: Answer
has body: I know I'm a bit late to the party but Ive been hunting around for a few days to find a reasonably simple solution. None of which have been listed clearly or concisely on stack overflow or elsewhere on the web. I have in fact found a much easier way to do this. Use this java script from this Gist just as it instructs https://gist.github.com/ShockwaveNN/a0baf2ca26d1711f10e2 (Note this is referenced above and found through the link @gep shared in step one) Once the JS as completed running it will download a text file. (It does still run successfully and on large numbers, I just exported almost 2500 articles) Create a blank test.json in SublimeText. Copy all entries from your exported text file into this json file Weirdly it does seem you need to copy and past as I tried just renaming the text file and when I did that I received errors on the next step Make sure you are signed into pocket Go here: https://getpocket.com/import/springpad Select your newly created test.json Upload Note: On large uploads the import page fails to refresh (this did not seem to be an issue as all my articles did make it into my account) This allows you to directly upload json into your pocket account. Thus no more messing around with random supposed other fixes. I hope this make it a lot easier for everyone in the future.
answers question: http://stackoverflow.com/q/28648907

http://stackoverflow.com/q/28694606
has title: How to find a string in a log file and return the entire row
has body: I am trying find a processID in a log file and then return the entire line from the log file for that processID, so I can put it into an email. An excerpt from the log is below for reference. 2015-02-24 11:02:27.214+0000 INFO {anon@notarealcompany.com:ff8080814b797e84014bbb40924a1991} [SCRIPTING_LOG] [Workflow Run (2/24/15 11:02:26)] Task ID is: 56214163 "ff8080814b797e84014bbb40924a1991" is the processID. I can get the javascript to return all the processIDs that it finds in the log file but can't figure out how to return the entire line. // gets workflow ids from the scripting.log file and lists them var fr = new FileReader("scripting.log"); fr.open(); var complete = fr.readAll(); var re = new RegExp(processID, 'g'); var result = complete.match(re); var listResult = result.join("\n"); System.log("Results: " + listResult); Any help would be greatfully appreciated.
answer count: 1
has answer: http://stackoverflow.com/a/28694696
accepted answer: http://stackoverflow.com/a/28694696
tagged with: regex
type: AnsweredQuestion
score: 0
type: Question
tagged with: javascript

http://stackoverflow.com/q/28700463
has answer: http://stackoverflow.com/a/28700660
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45691258
has answer: http://stackoverflow.com/a/28700756
type: Question
has title: keep hidden div id on browser refresh
possible better answer: http://stackoverflow.com/a/28700660
score: 0
accepted answer: http://stackoverflow.com/a/28700627
answer count: 3
tagged with: javascript
tagged with: jquery
has body: I have divs set to 100% height and have them showing and hiding with a combination of css and jquery. All works perfectly until I am on index.html#panel(x) and refresh my browser. Then it converts back to a messy scroll function. Here's the crux: Is there a better way to set this up? It seems like all I'm trying to do is show and hide divs, but I need to be able to refresh the index.html#panel(x) and have it all work seamlessly. Please let it be known that I am not a jquery or javascript savant, so please be kind when you chastise how dumb I am. I've spent too many sleepless night trying to get this functionality right and need some help. Here is the code: Untitled Document Panel1 Panel2 Panel3 Panel4 Minneapolis Minneapolis LALA St Paul SF The simpler, most cross-browser solution the better, Thanks in advance!
has answer: http://stackoverflow.com/a/28700627

http://stackoverflow.com/comment/45691127
type: AnswerComment
comment on: http://stackoverflow.com/a/28699935
type: Comment
has text: Yes ! use console.log anytime this is a useful function
score: 0

http://stackoverflow.com/comment/45728580
comment on: http://stackoverflow.com/a/28720847
type: Comment
has text: So my otherClickFunction will be something like this: $(function destroyMarker(){alert("hello");}); ??
score: 0
type: AnswerComment

http://stackoverflow.com/a/28749233
score: 0
answers question: http://stackoverflow.com/q/28746441
type: Answer
has body: The GET parameters were passed to the iframe's url by facebook, I could access them via plain JS window.location.

http://stackoverflow.com/q/28686467
has comment: http://stackoverflow.com/comment/46703121
type: Question
possible better answer: http://stackoverflow.com/a/29289885
has comment: http://stackoverflow.com/comment/46767516
has answer: http://stackoverflow.com/a/29289885
has comment: http://stackoverflow.com/comment/46771402
accepted answer: http://stackoverflow.com/a/29289522
tagged with: javascript
tagged with: mobile-safari
has comment: http://stackoverflow.com/comment/46703043
answer count: 2
downvote count: 0
favorite count: 0
upvote count: 2
has answer: http://stackoverflow.com/a/29289522
has comment: http://stackoverflow.com/comment/46767231
has comment: http://stackoverflow.com/comment/46763691
score: 2
has body: I’m trying to create a scrolling form for a mobile web app using a Famous ScrollView. However, iOS exhibits severe display bugs when scrolling while the keyboard is active. This occurs whether using an InputSurface or embedding an &lt;input&gt; directly in the Surface HTML. What’s the best way to achieve a scrollable input form that supports Mobile Safari? (JSFiddle code replicated below; to see the bug, tap on a text field and then attempt to scroll while keyboard is active.) Famous.loaded(function () { var Engine = Famous.Core.Engine; var Surface = Famous.Core.Surface; var Scrollview = Famous.Views.Scrollview; var Transform = Famous.Core.Transform; var mainContext = Engine.createContext(); var scrollview = new Scrollview(); var surfaces = []; scrollview.sequenceFrom(surfaces); var inputhtml = '&lt;div&gt;&lt;input type="text" value="test: edit me" /&gt;&lt;/div&gt;'; for (var i = 0, temp; i &lt; 40; i++) { temp = new Surface({ content: inputhtml, size: [undefined, 200], properties: { backgroundColor: "hsl(" + (i * 360 / 40) + ", 100%, 50%)", lineHeight: "200px", textAlign: "center" }, index: i }); temp.pipe(scrollview); surfaces.push(temp); } mainContext.add(scrollview); });
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46702876
has comment: http://stackoverflow.com/comment/46763979
has title: Famo.us: How to put form fields inside a scrolling view that works on iOS and Safari?
tagged with: famo.us
has comment: http://stackoverflow.com/comment/46746035

http://stackoverflow.com/a/28718307
type: Answer
answers question: http://stackoverflow.com/q/28716396
has comment: http://stackoverflow.com/comment/45724481
score: 0
has comment: http://stackoverflow.com/comment/45724110
has body: Firstly I don't think that is a JSON response. The proper JSON response would be like this. { "temp": [ { "XXX": "2", "YYY": "3", "ZZZ": "4" }, { "XXX": "5", "YYY": "6", "ZZZ": "7" }, { "XXX": "1", "YYY": "2", "ZZZ": "3" } ] } Then you can extract the array by using. response["temp"]

http://stackoverflow.com/q/28613246
has answer: http://stackoverflow.com/a/28613437
score: 0
accepted answer: http://stackoverflow.com/a/28613437
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: I'm trying to create an html form to generate an url address based on input to a field
has comment: http://stackoverflow.com/comment/45534199
type: AnsweredQuestion
has body: I am trying to create a small HTML document for my team to use to create fake devices for testing purposes in our program. We currently have a link to do this with but we have to manually change parts of it in the URL field before hitting enter to process it. I came up with the idea of creating this form so we can make sure that we are filling in all the elements of the URL correctly and then copy and paste the created URL into the browser. There are static parts of the address that we don't change and then there are values we update after the '=' sign. There are 4 different environments that we can use this in. I admit it has been a while since I last worked in HTML so I've been trying to search forums and sites like W3School to find the segments of code that I think will serve the purpose I'm aiming for. The following code is where I have gotten so far but can't get it to work the way I've intended it to. If anyone can provide suggestions or feedback on what I missed or did wrong I'd appreciate it. Thank you! Item birth generator Please fill in the appropriate fields and then click Generate to create a url for an item in the chosen environment. Choice 1 Choice 2 Choice 3 Choice 4 Item Part 1 Item Part 2 Item Part 3 Item Part 4 Item Part 5 Item Part 6 Item Part 7 Item Part 8
type: Question
has comment: http://stackoverflow.com/comment/45530208
tagged with: javascript

http://stackoverflow.com/q/28631006
accepted answer: http://stackoverflow.com/a/28646672
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45562638
has comment: http://stackoverflow.com/comment/45562930
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28646672
score: 3
has comment: http://stackoverflow.com/comment/45562212
downvote count: 0
has title: MEANJS user profile functionality
has comment: http://stackoverflow.com/comment/45570647
type: Question
has comment: http://stackoverflow.com/comment/45566473
tagged with: javascript
has comment: http://stackoverflow.com/comment/45562334
has body: i'm trying to build a simple app using meanjs. i have 2 modules: the standard user module and a posts module. what i want to achieve is a user profile page which will display some info about particular user and list posts belong to that user. you can think of it as a twitter profile page. i thought it would also be best /users/username shaped url structure. but i'm fairly new on all this and now stuck. here is what i did so far: i added these lines into users.server.routes.js: app.route('/api/users/:userName').get(users.userByUsername); app.param('userName', users.userByUsername); added a function to server control like this: exports.userByUsername = function(req, res, next, username) { User.findOne({ username: username }).exec(function(err, user) { if (err) return next(err); if (!user) return next(new Error('Failed to load User ' + username)); req.profile = user; next(); }); }; i added this part to users.client.routes.js state('view.profile', { url: '/users/:username', templateUrl: 'modules/users/views/view-profile.client.view.html' }); i created a new view like this: &lt;section class="row" data-ng-controller="ViewProfileController" ng-init="findUser()"&gt; &lt;div class="col-xs-offset-1 col-xs-10 col-md-offset-4 col-md-4"&gt; ... &lt;/div&gt; &lt;/section&gt; and finally i created a new client controller: angular.module('users').controller('ViewProfileController', ['$scope', '$http', '$stateParams', '$location', 'Users', 'Authentication', function($scope, $http, $location, Users, Authentication, $stateParams) { $scope.user = Authentication.user; $scope.findUser = function () { $scope.ourUser = Users.get({ username: $stateParams.username }); }; } ]); when i try to open users/username page for any username, it just gives the main homepage to me. any ideas what is wrong or what is missing? thanks in advance.
has comment: http://stackoverflow.com/comment/58302132
upvote count: 3
answer count: 1
has comment: http://stackoverflow.com/comment/45563223
favorite count: 0
tagged with: meanjs

http://stackoverflow.com/comment/45607450
type: AnswerComment
comment on: http://stackoverflow.com/a/28655136
score: 0
type: Comment

http://stackoverflow.com/a/28690162
score: 0
answers question: http://stackoverflow.com/q/28690022
has body: I am not familiar with LinkedIn API but the [unauthorized] error could be cause of Same Origin Policy
type: Answer

http://stackoverflow.com/a/28636340
has comment: http://stackoverflow.com/comment/80342653
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/107784185
has body: There is an implementation for converting hex string to Int64 (both signed and unsigned) here: LINK That code returns right result: javascript: new HexStringToInt64StringConverter(true).convert('a2921f66350ae040') // will return -6732283969128439744 same as BitConverter.ToInt64() in BCL The functions from the link: function HexStringToInt64StringConverter(signed) { var hexCode = { '0':"0000", '1':"0001", '2':"0010", '3':"0011", '4':"0100", '5':"0101", '6':"0110", '7':"0111", '8':"1000", '9':"1001", 'a':"1010", 'b':"1011", 'c':"1100", 'd':"1101", 'e':"1110", 'f':"1111" }; var preComputedLongMath = { "20":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], "21":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2], "22":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4], "23":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8], "24":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 6], "25":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2], "26":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 4], "27":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 8], "28":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 6], "29":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 1, 2], "210":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 4], "211":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 8], "212":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 9, 6], "213":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 1, 9, 2], "214":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 3, 8, 4], "215":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 7, 6, 8], "216":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 5, 5, 3, 6], "217":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 1, 0, 7, 2], "218":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6, 2, 1, 4, 4], "219":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 2, 4, 2, 8, 8], "220":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
accepted answer of: http://stackoverflow.com/q/28623673
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28623673
type: Answer
score: 2

http://stackoverflow.com/q/28612616
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28612741
type: Question
has title: Binding a name for JavaScript function using variable name
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45528911
has body: I'm having an issue with the following: I think the issue is clear, the anonymous function does not take the name of its variable . Therefore, how do I extend Function Object Constructor to give a name to a function according to the affected variable?
tagged with: anonymous-function
has answer: http://stackoverflow.com/a/28612719
has comment: http://stackoverflow.com/comment/45528910
tagged with: extends

http://stackoverflow.com/comment/45686566
type: AnswerComment
comment on: http://stackoverflow.com/a/28696754
type: Comment
has text: Just add that three `document.write` lines below my code (instead of the `Just for testing` thing). If that does not work, please send me an email with your current (not-working) code using the contact form on my website (http://www.bytehamster.com/?q=contact) and I will take a look at it.
score: 0

http://stackoverflow.com/q/28612296
has comment: http://stackoverflow.com/comment/45528297
has body: I read about better performance in js and i understand that if i have something like this: for (i=0;i&lt;document.images.length;i++) document.images[i].src="blank.gif" So the better way is to cache the object like this: var theimages = document.images for (i=0;i&lt;theimages.length;i++) theimages[i].src="blank.gif" My question is if it is only in dom objects or if in regular objects too that is better performance. for example: var obj = {key: {one: 1, two:2, three: 3}}; obj.key.one = 'something'; obj.key.two = 'something'; obj.key.three = 'something'; In this example will be better to do this from performance respective? var obj = {key: {one: 1, two:2, three: 3}}; var objKey = obj.key; objKey.one = 'something'; objKey.two = 'something'; objKey.three = 'something';
has answer: http://stackoverflow.com/a/28612559
has title: Js object cache performance
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45528539
tagged with: object
tagged with: performance
type: Question
has comment: http://stackoverflow.com/comment/45528460
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45528407
has comment: http://stackoverflow.com/comment/45528580
score: 0

http://stackoverflow.com/comment/45653500
type: Comment
has text: Yes, I missed that in my answer. I will try to be more descriptive. Thanks mate :)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28680192

http://stackoverflow.com/comment/45734147
type: Comment
comment on: http://stackoverflow.com/a/28723665
has text: my address.json is missing i need create new one, the data which would be put in the
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45647273
has text: I am sorry, my fiddle got overwrtitten, this was my original fiddle: http://jsfiddle.net/veniarya/ygosqouh/
type: AnswerComment
comment on: http://stackoverflow.com/a/28676860
score: 0
type: Comment

http://stackoverflow.com/q/28741999
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28742145
has answer: http://stackoverflow.com/a/28742316
answer count: 2
type: UnansweredQuestion
has body: I have stored all images in a folder. and added an image in div and button "Next" in my php page, but now i am writing javascript to change the image on click of button "Next". Please tell me how can i do so?
has comment: http://stackoverflow.com/comment/45767081
type: Question
has title: change images on button click using javascript in php page

openlayers-3
type: Tag
tag name: openlayers-3
tags question: http://stackoverflow.com/q/28688466
tags question: http://stackoverflow.com/q/28628018

http://stackoverflow.com/a/28652101
has body: You're using jQuery 1.10.1 in your page, and the error you're getting: jquery.style-my-tooltips.js:26 Uncaught TypeError: undefined is not a function is referring to the .live() function used by the plugin which was removed in jQuery 1.9 $(".smt-current-element").live("mouseout mousedown click",function(){
answers question: http://stackoverflow.com/q/28652048
upvote count: 2
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/comment/45725185
type: Comment
type: QuestionComment
score: 0
has text: so are you using the template inside success callback? If so what isn't working?
comment on: http://stackoverflow.com/q/28717942

http://stackoverflow.com/comment/45564183
type: QuestionComment
comment on: http://stackoverflow.com/q/28632053
score: 0
has text: I don't quite understand what you mean by _Is there a possible way to link also a title in the class 'container'?_. Would you mind explaining that part again?
type: Comment

http://stackoverflow.com/comment/45737706
comment on: http://stackoverflow.com/a/28725615
has text: True but placing it inside of the constructor ensures that every reference is collected. It's just a matter of how you want to organize your code and if you want to repeatedly type `myObjects.push`.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28745529
has title: ScrollTo div code not working?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45773821
accepted answer: http://stackoverflow.com/a/28745719
tagged with: css
type: AnsweredQuestion
type: Question
has body: please see this fiddle http://jsfiddle.net/rabelais/Lsbnyntg/1/ When the user clicks on one of the essay links the page should scroll to the top of the essay. However there is no scrolling motion happening, it just quickly jumps to the div. I have tried playing with the animation time but it does not seem to effect it. How can I make the scrolling visible? $('ul.inner-li-texts li a').on('click', function(event) { var target = $(this.href); if ( target.length ) { event.preventDefault(); $('html, body').animate({ scrollTop: target.offset().top } 0, 10000); } });
has answer: http://stackoverflow.com/a/28745719
tagged with: scrollto
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/comment/45724506
score: 0
has text: please explain your answer, why is there an ajax call for this purpose ?
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28718563

http://stackoverflow.com/comment/45747280
comment on: http://stackoverflow.com/q/28730516
score: 0
type: Comment
type: QuestionComment
has text: but my new json data is also containing array of objects

http://stackoverflow.com/q/28733526
tagged with: http://stackoverflow.com/tag/html
has body: In the javascript I see the following defined: $('#dropDownId').change(function(){ ... do stuff... }); value 1 value 2 value 3 I've tried using the following code: webBrowser.Document.GetElementById("dropDownId").SetAttribute("value", "1"); webBrowser.Document.GetElementById("dropDownId").Children[1].SetAttribute("selected", "selected"); webBrowser.Document.GetElementById("dropDownId").InvokeMember("onchange"); I can see the drop down get changed to the right value, but the following never gets executed: $('#dropDownId').change(function(){ ... do stuff... }); Also, when I look at the properties for "dropDownId" in Chrome, the "onchange" event is null, so how can I invoke the above "change" script for the dropdown?
has answer: http://stackoverflow.com/a/28733635
type: AnsweredQuestion
has title: Why can't I trigger select change event using C# WebBrowser control?
score: 1
upvote count: 1
type: Question
tagged with: c#
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28733635
answer count: 1
downvote count: 0
favorite count: 0
tagged with: winforms

http://stackoverflow.com/a/28632893
downvote count: 0
type: AcceptedAnswer
has body: jQuery Canvas Manipulation There's a slight issue to your code, simple fix! function ReSizeImage(item, Width, Height) { var canvas = item.find("canvas"); canvas.each(function (i) { var CW = $(this).width(); //THIS GETS THE CORRECT VALUE $(this)[0].width = Width //THIS DOES NOT WORK; $(this) will be getting you a jQuery object and not a DOM element.
score: 1
has comment: http://stackoverflow.com/comment/45716176
answers question: http://stackoverflow.com/q/28632831
type: Answer
accepted answer of: http://stackoverflow.com/q/28632831
upvote count: 1
has comment: http://stackoverflow.com/comment/45566028

http://stackoverflow.com/q/28604978
tagged with: math
has answer: http://stackoverflow.com/a/28605214
answer count: 2
score: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28605214
has body: I have a JavaScript function which allows me to generate DOM elements and plot them on a circle with (good enough) even distribution around the circle. The code is as follows (I'm using jQuery): function createFields(numberOfItems, className, radius) { var container = $('#container'); for(var i = 0; i &lt; +numberOfItems; i++) { $('&lt;div/&gt;', { 'class': 'field ' + className, 'text': i + 1 }).appendTo(container); } var fields = $('.' + className), container = $('#container'), width = container.width(), height = container.height(), angle = 0, step = (2*Math.PI) / fields.length; fields.each(function() { var x = Math.round(width/2 + radius * Math.cos(angle) - $(this).width()/2); var y = Math.round(height/2 + radius * Math.sin(angle) - $(this).height()/2); if(window.console) { console.log($(this).text(), x, y); } $(this).css({ left: x + 'px', top: y + 'px' }); angle += step; }); } createFields(5, 'outer', 200); createFields(4, 'inner', 120); Fiddle: http://jsfiddle.net/z79gj8a7/ You'll notice that the generated elements begin at 90 degrees to the vertical. I'd like to plot them so that they begin at 0 degrees. Essentially, if you imagine this as a clock, I want to plot all of the items 3hrs earlier. I've tried modifying the angle in the script to -90 and also subtracting 90 from the angle += step line but it's not having the desired effect. Could anyone who's better at maths than I suggest a way to get the elements to be plotted -90 degrees from where they are now? (I'm aware I could just rotate the #container but that seems like a hack as I'd have to rotate the elements to compensate to keep their content in the correct orientation). Many thanks.
tagged with: degrees
type: AnsweredQuestion
tagged with: angle
upvote count: 2
possible better answer: http://stackoverflow.com/a/28605407
has title: Rotate evenly-distributed elements placed on a circle with jQuery
has answer: http://stackoverflow.com/a/28605407
type: Question

http://stackoverflow.com/q/28734249
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28734328
accepted answer: http://stackoverflow.com/a/28734328
tagged with: parsing
favorite count: 0
downvote count: 2
has title: assign the value the variable to my object identifier json
tagged with: node.js
has body: first, excuse my english, isn't very good. I'm creating a json object like this: data = {UUIDDevice: {"Latitude": Latitude, "Longitude": Longitude, "Model": ModelDevice, "IDDevice": UUIDDevice, "Platform": PlatformDevice } }; My problem is that the object identifier: UUIDevice does not take the value of the variable, only puts UUIDevice like that: { UUIDDevice: //&lt;--Here should there be a text like: 35e620c299bc087a { Latitude: '6.2720517', Longitude: '-75.5478177', Model: 'XT1033', IDDevice: '35e620c299bc087a', Platform: 'Android' } } I was trying with a variable as string to later, apply to it JSON.parse(), well, thats works fine, but returns the object identifier into quotes, so when I try to get a property from my object like: data.UUIDevice.Model happens an error: "Cannot read property "Model" " I hope you can help me with this, I think that can be about concatenation in the object identifier but I don't know how would be.
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45753832
type: Question
upvote count: 0
score: -2

http://stackoverflow.com/comment/45622887
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28663562
has text: I think you'd want in your `forEach()` something like `this.color=d3.interpolate("#ffffcc", "#147907")(this.total/100);` so it creates that property on the current object in the iteration. `payments_data[d]` is another form of `payments_data.d`, and in your case, `d` is an object and not a string/property name.
score: 0

http://stackoverflow.com/a/28621771
has comment: http://stackoverflow.com/comment/45545859
type: Answer
has comment: http://stackoverflow.com/comment/45545892
has comment: http://stackoverflow.com/comment/45545792
score: 0
has body: Call the same function when you set the value of the text box: success: function(output){ $('#resultip').val(output); selectByText($.trim($('#resultip').val())); }
answers question: http://stackoverflow.com/q/28621688
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45545929
accepted answer of: http://stackoverflow.com/q/28621688

http://stackoverflow.com/q/28746245
has answer: http://stackoverflow.com/a/28746508
type: Question
has title: Onsen UI Carousel getActiveCarouselItemIndex() not working
answer count: 1
tagged with: javascript
tagged with: onsen-ui
tagged with: angularjs
has body: Hi I am trying this code : {{dayitem}} in app.js (model) console.log(cardays); I am trying to get getActiveCarouselItemIndex() by console.log(cardays.getActiveCarouselItemIndex()) which is not working. console.log say cardays is undefined. Any help would be appreciated Regards
score: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/45537989
type: QuestionComment
has text: Also check your console for errors. There probably is one.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28617370

http://stackoverflow.com/a/28857225
has body: I was going through the same headache of bundling different things. I did some research and figured out a way to bundle everything into a single html page. Including images and fonts. It also minifies and optimizes every file. So your whole single page app can really be in a single html page. All you have to do is pass in the start page (Ex. Index.html) I just published my project on Git Hub and nugget its called SPAFramework/SpaBundler you can try it and also help further develop it as it is really just a working rough draft.
answers question: http://stackoverflow.com/q/28676345
score: 0
type: Answer

http://stackoverflow.com/q/28685928
tagged with: safari
type: Question
has answer: http://stackoverflow.com/a/28701800
tagged with: ios
has title: jQuery .on( 'ended' ) not working on mobile
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has body: I am facing an issue with event handlers in iOS mobile Safari. I have a button that is bound on click to play a series of different sound files. The code works as intended on Chrome, Firefox, IE and Safari. However on mobile devices it only plays the first sound in the series. I have a feeling the mobile Safari doesn't fire the "ended" event trigger when the audio is done playing. Does anyone have any experience with this? Any suggestions? Again, it's working as intended on every browser except for iOS mobile Safari. The code is below. jQuery(document).ready(function($) { $('.audio-button').click( function(){ $('.audio-button').toggle(); $('.disabled-audio').toggle(); var pinyinlinks = $( this ).attr('audio'); var pinyinsplit = pinyinlinks.split(','); pinyinsplit = pinyinsplit.map(function(el) { return 'http://mandarin.cards/wp-content/themes/cards/audio/' + el; }); console.log(pinyinsplit); var pinyincount = pinyinsplit.length; if ( pinyincount > 1 ){ var myaudio = []; var next = 0; for ( var i = 0; i < pinyincount; i++ ) { myaudio[i] = new Audio( pinyinsplit[i]); if ( i != pinyincount - 1 ){ $( myaudio[i] ).on('ended', function(){; next = next + 1; myaudio[next].play(); }) }; } myaudio[0].play(); setTimeout(function(){ $('.disabled-audio').toggle(); $('.audio-button').toggle(); }, 2300); } else { var myaudio = new Audio( pinyinlinks ); myaudio.play(); } } ) }); Read Word Read Word
type: UnansweredQuestion

http://stackoverflow.com/a/28631422
score: 4
upvote count: 4
answers question: http://stackoverflow.com/q/28631364
type: AcceptedAnswer
downvote count: 0
has body: A jQuery selector never returns null or an array, it returns a jQuery object. It looks like an array in the console because it has properties that make it "array-like", but it isn't actually an array and will not compare equal to []. For more about this, see What makes a jQuery object show up as an array in Chrome&#39;s Developer Tools? If you want to know if anything was matched, use .length: if ($('#selectYears option[value="' + $(this).val() + '"]').length != 0) {
type: Answer
accepted answer of: http://stackoverflow.com/q/28631364

http://stackoverflow.com/q/28648255
answer count: 2
has title: What is the best practice for importing angularjs using webpack?
has answer: http://stackoverflow.com/a/31440497
has body: How do you use Webpack and AngularJS together, and how about template loading and on demand fetching of resources? An example of a well written webpack.config.js file for this purpose would be very much appreciated. All code snippets displayed here can be accessed at this github repo. Code has been generously adapted from this packetloop git repo. webpack.config.json var path = require('path'); var ResolverPlugin = require("webpack/lib/ResolverPlugin"); var config = { context: __dirname, entry: ['webpack/hot/dev-server', './app/app.js'], output: { path: './build', filename: 'bundle.js' }, module: { loaders: [{ test: /\.css$/, loader: "style!css-loader" }, { test: /\.scss$/, loader: "style!css!sass?outputStyle=expanded" }, { test: /\.jpe?g$|\.gif$|\.png$|\.svg$|\.woff$|\.ttf$/, loader: "file" }, { test: /\.html$/, loader: "ngtemplate?relativeTo=" + path.join(__dirname, 'app/') + "!raw" }] }, // Let webpack know where the module folders are for bower and node_modules // This lets you write things like - require('bower/&lt;plugin&gt;') anywhere in your code base resolve: { modulesDirectories: ['node_modules', 'lib/bower_components'], alias: { 'npm': __dirname + '/node_modules', 'vendor': __dirname + '/app/vendor/', 'bower': __dirname + '/lib/bower_components' } }, plugins: [ // This is to help webpack know that it has to load the js file in bower.json#main new ResolverPlugin( new ResolverPlugin.DirectoryDescriptionFilePlugin("bower.json", ["main"]) ) ] }; module.exports = config; To import AngularJS into the main app.js you do the following: app/vendor/angular.js 'use strict'; if (!global.window.angular) { require('bower/angular/angular'); } var angular = global.window.angular; module.exports = angular; And then use it in app.js like so, app.js ... var angular = require('vendor/angular'); // Declare app level module var app = angular.module('myApp', []); ... Is the following correct? Is there an easier way to do this? I've seen a few (not a lot by any standards) posts …
tagged with: webpack
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/59587197
has answer: http://stackoverflow.com/a/31960399
upvote count: 52
favorite count: 0
score: 52
tagged with: angularjs
has comment: http://stackoverflow.com/comment/52673899
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/33502112
has comment: http://stackoverflow.com/comment/50850440
type: Question

http://stackoverflow.com/comment/45749686
type: Comment
type: QuestionComment
has text: You should use event delegation to handle your click events on the dynamic content
comment on: http://stackoverflow.com/q/28731797
score: 0

http://stackoverflow.com/q/28616082
upvote count: 3
has answer: http://stackoverflow.com/a/28620875
has body: > What I want here are 10 canvases, 5 on the top and 5 on the bottom, each with width 17% and height 25.5%, and appropriate spacing between (see bottom image). Each image drawn on a canvas corresponds to the same area of the full image (see top image). This is kind of like a destination-in, but this is really just a crop of the full image onto smaller canvases using context.translate and context.drawImage(). Please see the two lines inside the innermost for loop with comments that deal wtih context.translate and context.drawImage for clue as to what might be going on. Please see the attached image of what I am trying to achieve with html5 context.translate() and context.drawImage(). Any help greatly appreciated. Thank you. //get parent's width and height var parent = document.getElementById("parent"); var parentWidth = parent.offsetWidth; var parentHeight = parent.offsetHeight; //get below canvas var belowCanvas = document.getElementById('belowCanvas'); var belowCtx = belowCanvas.getContext('2d'); //create temporary canvas var tmpCanvas = document.createElement('canvas'); var tmpCtx = tmpCanvas.getContext('2d'); //initialize width and height of temporary canvas and below canvas to equal parent tmpCanvas.width = belowCanvas.width = parentWidth; tmpCanvas.height = belowCanvas.height = parentHeight; //draw below canvas in black for visual aid of how things are cropped in above canvases belowCtx.rect(0,0,parentWidth,parentHeight); belowCtx.fillStyle = 'black'; belowCtx.fill(); //draw temporary canvas var centerX = parentWidth/4; var centerY = parentHeight/4; var radius = parentHeight/4; tmpCtx.rect(0,0,parentWidth,parentHeight); tmpCtx.fillStyle = 'blue'; tmpCtx.fill(); tmpCtx.beginPath(); tmpCtx.arc(centerX, centerY, radius*1.5, 0, 2 * Math.PI, false); tmpCtx.fillStyle = 'green'; tmpCtx.fill(); tmpCtx.lineWidth = 2 tmpCtx.strokeStyle = '#003300'; tmpCtx.stroke(); tmpCtx.beginPath(); tmpCtx.arc(parentWidth - centerX, centerY, radius*1.5, 0, 2 * Math.PI, false); tmpCtx.f…
accepted answer: http://stackoverflow.com/a/28620875
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
type: AnsweredQuestion
score: 3
downvote count: 0
has title: HTML5 context.drawImage() crop is not working after calling context.translate()
type: Question
tagged with: javascript

http://stackoverflow.com/a/28992993
type: Answer
has body: I decided to abandon this approach and use php SESSION variables instead.
score: 0
answers question: http://stackoverflow.com/q/28617996

http://stackoverflow.com/q/28669884
score: 6
type: Question
has answer: http://stackoverflow.com/a/28669954
upvote count: 6
favorite count: 0
possible better answer: http://stackoverflow.com/a/28669954
has answer: http://stackoverflow.com/a/28669955
has title: Javascript prompt box without the cancel button?
has answer: http://stackoverflow.com/a/28669965
tagged with: prompt
has comment: http://stackoverflow.com/comment/84222637
answer count: 3
has comment: http://stackoverflow.com/comment/45633820
has body: Is there a way to create a input prompt box that doesn't have the cancel button, or doesn't allow the user to close the prompt until some value is entered?
type: AnsweredQuestion
downvote count: 0
accepted answer: http://stackoverflow.com/a/28669965
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45763849
type: Comment
type: AnswerComment
has text: So basically is it possible to overwrite the delay completely? And is there any tineout limit for the total of all retries? E.g try every 1min up to 5min?
score: 0
comment on: http://stackoverflow.com/a/28739220

http://stackoverflow.com/comment/45523710
score: 0
has text: @dfsq that is a typo , I removed & checked it.Still it is only creating edit button
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28609622

http://stackoverflow.com/comment/45632298
type: QuestionComment
has text: "I want the outcome to be that the text is red, but the way jss operates, the text comes out red." Typo?
score: 1
comment on: http://stackoverflow.com/q/28669083
type: Comment

http://stackoverflow.com/q/28705913
answer count: 0
tagged with: d3.js
type: UnansweredQuestion
tagged with: charts
tagged with: dom
has comment: http://stackoverflow.com/comment/45703638
type: Question
tagged with: javascript
has title: D3js inverting graphs with y-values between 9 and 10
score: 0
has body: So I'm dynamically creating a bunch of simple line charts with D3 and everything is going well, but for some reason charts with ranges that go from 9-10 get inverted and look absolutely terrible/do not function properly. the first one, the values are upside down this one is fine... Here is some code... var dataRange = d3.extent(quoteObjects, function(d){ return d.close }); var dateRange = d3.extent(quoteObjects, function(d){ return d.date }); // Set chart variables var vis = d3.select("#"+type), WIDTH = $('#chart-box').width(), HEIGHT = $('#'+type).innerHeight(), MARGINS = { top: 20, right: 20, bottom: 20, left: 60, }, // set scales xScale = d3.time.scale().range([MARGINS.left, WIDTH - MARGINS.right]).domain(dateRange), yScale = d3.scale.linear().range([HEIGHT - MARGINS.top, MARGINS.bottom]).domain(dataRange), // create displayed axis xAxis = d3.svg.axis() .scale(xScale) .tickValues( xScale.ticks(6) ) yAxis = d3.svg.axis() .scale(yScale) .tickValues( yScale.ticks(6) ) .orient("left"); console.log("WH", WIDTH, HEIGHT); if (type == "intraday"){ xAxis.tickFormat(d3.time.format("%H")) } // append x axis vis.append("svg:g") .attr("class", "axis") .attr("transform", "translate(0," + (HEIGHT - MARGINS.top) + ")") .call(xAxis); // append y axis vis.append("svg:g") .attr("class", "axis") .attr("transform", "translate(" + (MARGINS.left) + ",0)") .call(yAxis); // create line based on "close" values var lineGen2 = d3.svg.line() .x(function(d) { return xScale(d.date); }) .y(function(d) { return yScale(d.close); }) .interpolate("basis"); // append "close" line vis.append('svg:path') .attr('d', lineGen2(quoteObjects)) .attr('stroke', '#931a28') .attr('stroke-width', 3) .attr('fill', '#222');
has comment: http://stackoverflow.com/comment/45702081
tagged with: http://stackoverflow.com/tag/svg

http://stackoverflow.com/comment/45677068
has text: Im not sure i follow. I rotated the image because the image used points down while the image shown at your link here http://s6.postimg.org/uvdgh7uzl/foto.png is rotated and pointing right. As for the text, I put the wrong link to the jsfiddle (fixed it now). It looks pretty close to what you showed. See http://prntscr.com/6968bw
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28691739

http://stackoverflow.com/a/28730448
has comment: http://stackoverflow.com/comment/45751342
has comment: http://stackoverflow.com/comment/45750186
has comment: http://stackoverflow.com/comment/45749540
has comment: http://stackoverflow.com/comment/45748370
accepted answer of: http://stackoverflow.com/q/28730389
has comment: http://stackoverflow.com/comment/45748241
score: 1
has comment: http://stackoverflow.com/comment/45749913
answers question: http://stackoverflow.com/q/28730389
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: There is block scoping in JavaScript from ecmascript version 6 with the let keyword. That aside, the way it works with the var statement is that the statement floats to the top of the function before the function is being executed. Variable declarations take place before anything else, regardless of the blocks they are in, including inside for loop statements. The actual assignments of the variables does happen in place, so they are undefined but not undeclared until the line of code where they get assigned something. As for your specific example, remember that primitive values like numbers are not assigned by reference but by value, and that the updating of x will only happen on uneven numbers and will be undefined the first time round, but if it would be objects, they would refer to the same object once you assigned one to the other (regardless of if/else conditions). To provide further confusion, note that console in browsers is asynchronous, so you could print objects to the console (not primitives though) and inspect them where you would not get the state of the object at the time of the console.log statement, but at a later time. That's very confusing for debugging. Yes JavaScript in practice definitely has a bit of a learning curve.
upvote count: 1
has comment: http://stackoverflow.com/comment/45748086

http://stackoverflow.com/comment/45721784
score: 0
type: AnswerComment
type: Comment
has text: This definitely seems like the logical solution to the speed issues OP is experiencing.
comment on: http://stackoverflow.com/a/28717036

http://stackoverflow.com/comment/45566693
has text: A nice idea, but having had a look at the .one() function, it seems it will execute "once for each event type." Which is precisely what I'm attempting to avoid. So we're falling back to the setTimeout I originally mentioned just in an alternative layout.
comment on: http://stackoverflow.com/a/28633157
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/45728554
type: QuestionComment
comment on: http://stackoverflow.com/q/28720675
type: Comment
has text: I currently have nothing that gets close to working, but Forlan07 below has posted ^.*?[0-9], which gets me the second half of the string, but is not giving me the first half as an array output.
score: 0

http://stackoverflow.com/comment/45531102
score: 0
type: AnswerComment
type: Comment
has text: im a little confused in what youre saying. I added a line that will empty the table when you change it.. but, in my AJAX, what are you receiving? can you `console.log(results)` and see the results in json format?
comment on: http://stackoverflow.com/a/28610839

http://stackoverflow.com/comment/45707461
score: 0
has text: http://jsfiddle.net/arunpjohny/cj1hysf3/1/ ?
comment on: http://stackoverflow.com/q/28709146
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45594123
has text: @charlietfl Yes it is; `value`.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28648228
score: 1

http://stackoverflow.com/comment/45630215
has text: what do you mean with LogLevel SERVE ? could be SEVERE?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28660021
score: 0

http://stackoverflow.com/a/28689485
type: Answer
score: 2
has body: You can follow this change: button1 button2 button3 button4 Make use of data-* attribute to hold the specific url for each link which is going to be clicked. Now just one change and you would have a common click event for all ajax calls: $('.button').on('click', function() { var url = $(this).data('url'); var index = $(this).index(); $.ajax({ url: url, data: { value1: 'value1', value2: 'value2' }, success: function(response) { $('.some_dom'+index).html(Handlebars.resource({items: response.items})); } }); }); As per your update in your question you can try doing this: success: function(response) { if(url.indexOf('1') != -1){ $('.some_dom1').html(Handlebars.resource({items: response.items})); }else if(url.indexOf('2') != -1){ $('.some_dom2').html(Handlebars.resource({items: response.items})); }else if(url.indexOf('3') != -1){ $('.some_dom3').html(Handlebars.resource({items: response.items})); } } In success you have to check if the current url of ajax call is having something different to other calls, so if that matches then you can differentiate it within the if/else if conditions.
downvote count: 0
answers question: http://stackoverflow.com/q/28689332
upvote count: 2

http://stackoverflow.com/comment/45580227
comment on: http://stackoverflow.com/q/28639719
type: Comment
type: QuestionComment
has text: Where does the `1` in `[2,1,3]` come from?
score: 0

http://stackoverflow.com/a/28658651
has comment: http://stackoverflow.com/comment/45613245
score: 0
answers question: http://stackoverflow.com/q/28658562
has body: This could be done using the mouseover event on the body element. document.getElementsByTagName('body')[0].addEventListener("mouseover", function(){ // If idle then set status to available }); EDIT: Here's an idea. The Window.requestAnimationFrame() function is only executed when the tab/window is active. So if the function is not called, that means the user is not viewing the tab or the tab is not active. Check this example. Run the script, then switch tabs for a few seconds, then switch back var isTabOpen=true; var tabTimer=null; function tabCheck(){ //This function is only called when the tab is open. if(tabTimer) clearTimeout(tabTimer); tabTimer = setTimeout(function(){ isTabOpen = false; },1000); isTabOpen=true; } setInterval(function(){ window.requestAnimationFrame(tabCheck); document.getElementsByTagName('body')[0].innerHTML += (isTabOpen+'&lt;br/&gt;'); },1000);
type: Answer

http://stackoverflow.com/comment/45784156
type: Comment
has text: Are you sure anyway`s, that you have access to a MySQL database in the target environment? Never heard of a MySQL server running on a mobile phone.
type: AnswerComment
comment on: http://stackoverflow.com/a/28749667
score: 0

http://stackoverflow.com/comment/45674872
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28690557
has text: Upvoting you. I thought the same too after all the tries. Hope it turns out good for David. :)
score: 0

http://stackoverflow.com/comment/119362222
comment on: http://stackoverflow.com/a/28756348
has text: Resurrecting this old thread because I find the advice here no longer seems true. I have a `RequestMemory` store (dstore 1.2.1) which has loaded its data for display in a dgrid (0.4.2). Calling `RequestMemory::refresh()` on the store causes it to call `Cache::invalidate()` which sets `this.allLoaded = false`, but then `refresh()` calls `fetch()` which calls `Cache::_fetch` checks `this.isAvailableInCache()` which tests `this.isValidFetchCache` which is true, so the cached data is used. I'm going nuts trying to make the Cache behave. Is there a discussion somewhere I've missed?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28721024
tagged with: javascript
tagged with: angularjs
has body: I've got a form which is used to update a user's information, both in the Firebase JSON tree and the seperate database which holds the email + password combination for the users. Whenever you want to update either the email or password, you need to provide an email + password combination for it to work. However, when you only want to update the JSON tree you can do it without a password. My form requires you to enter your current password before anything can happen, but if you type in the wrong password it will still update the display name of the user. So my question is, is there a way that I can require the correct password before actually updating anything in the database? The code in my controller: //If the user has entered a new display name if (sharedInfo.getUser().displayName !== $scope.user.displayName) { var isNameChanged = userLogic.changeDisplayName($scope.user); isNameChanged.then(function(isSuccessful) { if (isSuccessful === true) { $scope.isSuccessful = true; } else { $scope.error = 'Update failed'; } }); } Function in my service: changeDisplayName: function(user) { //Get the user ID var userData = sharedInfo.getAuthState(); return fbRef.getSyncedReference('users/' + userData.uid).$update({displayName: user.displayName}).then(function() { return true; }, function(error) { return false; }); }
has comment: http://stackoverflow.com/comment/45769912
answer count: 0
type: UnansweredQuestion
tagged with: firebase
tagged with: passwords
has comment: http://stackoverflow.com/comment/45756297
type: Question
score: 0
has title: How to require the user's password when you want to update the user's information in the Firebase JSON tree?

http://stackoverflow.com/comment/45787469
comment on: http://stackoverflow.com/a/28727711
type: AnswerComment
type: Comment
has text: Did you try to set it directly in the response headers? Meta tags are a poor substitute. I added them only because I have no experience with the stack you are using. To help further I would need more information about the server technologies used.
score: 0

http://stackoverflow.com/q/28626093
has answer: http://stackoverflow.com/a/28627152
upvote count: 4
has comment: http://stackoverflow.com/comment/45553638
favorite count: 0
has comment: http://stackoverflow.com/comment/45553350
answer count: 3
has comment: http://stackoverflow.com/comment/45553521
has answer: http://stackoverflow.com/a/28626362
has answer: http://stackoverflow.com/a/28626495
has comment: http://stackoverflow.com/comment/45554436
tagged with: asynchronous
has comment: http://stackoverflow.com/comment/45553325
has comment: http://stackoverflow.com/comment/45553156
has comment: http://stackoverflow.com/comment/45553389
tagged with: node.js
has title: Thinking in node if Java background
has body: I am a Java Developer where everything is working in sequential way (or concurrently with multiple threads), one after another. And it's logical to place things in a sequential way. But node works in concurrent order with single thread. How it can be beneficial even if it is working only on single thread? Frankly telling, I didn't get the concept of single thread in node. Only one thread handle everything? Any advice would be beneficial on how I can start thinking in node.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45553762
has comment: http://stackoverflow.com/comment/45553243
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28627152
score: 3
possible better answer: http://stackoverflow.com/a/28626362
tagged with: java
tagged with: javascript

http://stackoverflow.com/a/28655944
has body: Here you go: http://jsfiddle.net/h3vo8LL1/2/ . You had 2 issues there: You need to pass the incoming slide element to featuredProjectTextAnimation() and find the .animated element in it, instead of selecting all of your text slides. You need to have each slide initially hidden, here, just for example, I set opacity to 0 on the outgoing slide element, and on begin I set it to 1. You can also use display: none or whatever suits you. HTH!
accepted answer of: http://stackoverflow.com/q/28614890
type: AcceptedAnswer
score: 4
has comment: http://stackoverflow.com/comment/45621195
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/45624108
has comment: http://stackoverflow.com/comment/45617393
has comment: http://stackoverflow.com/comment/45608990
downvote count: 0
has comment: http://stackoverflow.com/comment/46057715
has comment: http://stackoverflow.com/comment/45790413
answers question: http://stackoverflow.com/q/28614890

http://stackoverflow.com/comment/45604033
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28653336
has text: Also, you may want to set replace: true in your directive, since you're invoking a directive as an HTML element. This will remove the contrived element and replace it with the div you're expecting...
score: 0

http://stackoverflow.com/q/28687739
has body: I'm displaying elements from an array inside a div. Clicking "next" or "previous" cycles through the list of array elements in order. I would like to add a transition effect to the displayed content when it switches. var theArray = ["1","2","3","4","5"]; var dancefloor = document.getElementById("dancefloor"); var prev = document.getElementById("prev"); var next = document.getElementById("next"); var current = 0; function justDance(x) { dancefloor.innerHTML = ' ' + theArray[x] + ' '; } function nextNum() { current++; justDance(current); } function prevNum() { current--; justDance(current); } justDance(current); #dancefloor p { transition: all 2s; } Previous Next Here is the fiddle: http://jsfiddle.net/kLLpmba2/ I've also tried adding style.transition to the dancefloor element directly in the JS, to no avail. What am I missing here?
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45667929
score: 1
upvote count: 1
type: Question
has title: Javascript transitions on DOM elements
has answer: http://stackoverflow.com/a/28687949
has answer: http://stackoverflow.com/a/28688124
tagged with: css-transitions
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28687949
answer count: 2
has comment: http://stackoverflow.com/comment/45670036
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28688124

http://stackoverflow.com/a/28678840
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/28678689
score: 1
has body: There is a "play" event, which fires when the video begins playing, and a "pause" event that fires when the video is paused. Alternatively, the "paused" property will be false when the video is playing and true when it is not.
upvote count: 1

http://stackoverflow.com/q/28631053
has comment: http://stackoverflow.com/comment/45562125
has answer: http://stackoverflow.com/a/28645765
answer count: 3
has answer: http://stackoverflow.com/a/28631347
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45562112
has comment: http://stackoverflow.com/comment/45563128
favorite count: 0
accepted answer: http://stackoverflow.com/a/28645765
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/45562367
has comment: http://stackoverflow.com/comment/45562668
score: -1
has answer: http://stackoverflow.com/a/28644408
has comment: http://stackoverflow.com/comment/45562143
has comment: http://stackoverflow.com/comment/45587306
has comment: http://stackoverflow.com/comment/45562082
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/45563864
possible better answer: http://stackoverflow.com/a/28644408
type: Question
has comment: http://stackoverflow.com/comment/45562288
type: AnsweredQuestion
has body: HTML page ..................................................................... <form:form method="post" action="saveMiData.action" id="minorityForm" commandName="MinInterestModel"> <spring:message code="Minority.validNumber" />* <spring:message code="MinorityInterest.elementName" /> <form:select id="glListName0" path="glElementId" name="glListName" class="input-block-level" size="1" multiple="bbn"> </form:select> <spring:message code="MinorityInterest.AccountType" /> <form:select path="accountType" id="accountName0" name="accountName" class="input-block-level" multiple="bbn"> select Debit Credit </form:select> <spring:message code="MinorityInterest.preAcq" /> <spring:message code="MinorityInterest.Share" /> <img onclick="addMore()" src="<%=Config.getStaticURL()%>resources/img/Add-field.png" /> <img onclick="removeMI(this)" src= "<%=Config.getStaticURL()%>resources/img/remove-field.png" /> <spring:message code="MinorityInterest.TotalAmount" /> <form:hidden path="parenCompanyId" id="PcId"/> <form:hidden path="childCompanyId" id="CcId"/> <form:hidden path="financialYearId" id="FyId"/> <form:hidden path="reportingPeriodId" id="rPId"/> save </form:form> My approach on removal function: function removeMI(){ alert("vaibhavremove"); // alert($('#preacq0').attr('id','preacq0'+ cloneCount--).remove()); if(cloneCount==1){ alert("No more textbox to remove"); return false; } cloneCount--; $("#preacq0" + cloneCount).remove(); } It works fine but my requirement is when click on minus button, the selected div will be removed, not the last one, as I'm creating the div id dynamically. Code for creating div id: Remove button markup: <img onclick="removeMI()" src= "<%=Config.getStaticURL()%>resources/img/remove-field.png" /> Thanks in advance.
has comment: http://stackoverflow.com/comment/45585090
has title: onClick completely remove a specific DIV

http://stackoverflow.com/q/28731406
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/28731458
tagged with: xmlhttprequest
tagged with: php
has answer: http://stackoverflow.com/a/28731509
has title: Undefined $_POST after xmlhttp request
answer count: 3
tagged with: mysql
has body: My code makes an xmlhttp request to a php file, sending an ID so that a record can be identified and deleted from the database. However, when performing the delete query, I'm get an error saying 'comicID' is undefined (the variable using the ID value sent by POST). I'm not sure how to make sure it is defined correctly. Currently, the error I'm getting back from error handling is: "No comic supplied." and the error I get when removing the ISSET section of code is: "Error. Pages in comic not deleted." As it stands, the delete query doesn't work. Javascript: function delComic() { var radioButtons = $("#listID input:radio[name='comicList']"); var radioID = radioButtons.index(radioButtons.filter(':checked')); console.log(radioID); if (radioID &lt; 0) { window.alert("You must select a comic before deleting."); } else { var xmlhttp = new XMLHttpRequest(); var url = "delCom.php?comicID="+radioID; xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) { var message = xmlhttp.responseText; loadComic(); window.alert(message); } } xmlhttp.open("POST", url, true); xmlhttp.send(); } } PHP: &lt;?php if (isset($_POST["comicID"])) { $comic = $_POST["comicID"]; $dir = 'comics/'.$comic.'/'; if (!file_exists($dir)) { mkdir($dir, 0777, true); } include_once('includes/conn.inc.php'); mysqli_query($conn, "DELETE FROM serieslink WHERE comicID = '$comic'"); $query = ("DELETE FROM page WHERE comicID = '$comic'"); if (!$result = mysqli_query($conn, $query)) { echo ("Query1 error: " . mysqli_error($conn)); exit; } else { if (mysqli_affected_rows($conn) &gt; 0) { $dirHandle = opendir($dir); while($file = readdir($dirHandle)) { if(!is_dir($file)) { unlink("$dir"."$file"); } } closedir($dirHandle); rmdir($dir); $query2 = ("DELETE FROM comic WHERE comicID = '$comic'"); if (!mysqli_query($conn, $query2)) { echo ("Query2 error: " . mysqli_error($conn)); exit; } else { if (mysqli_affected_rows($conn) &gt; 0) { echo ("The selected comic was successfully d…
has answer: http://stackoverflow.com/a/28748022
tagged with: javascript
type: AnsweredQuestion
score: 2
accepted answer: http://stackoverflow.com/a/28748022
downvote count: 0
favorite count: 0
tagged with: ajax
possible better answer: http://stackoverflow.com/a/28731458

http://stackoverflow.com/q/28598618
linked to: http://stackoverflow.com/q/25374991
favorite count: 0
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45503531
downvote count: 1
score: 2
linked to: http://stackoverflow.com/q/19623738
has title: Where "this" points to in JS and why
type: Question
linked to: http://stackoverflow.com/q/3127429
has comment: http://stackoverflow.com/comment/45503645
tagged with: javascript
upvote count: 3
has comment: http://stackoverflow.com/comment/45503642
has body: var Result = Result || {}; Result.Controller = function (){ var _self = this; _self.router = new v2.Router(_self); }; I have above code of javascript, here I want to know where will "this" points to? Is it Controller or Result? and why?
tagged with: web

http://stackoverflow.com/a/28618250
upvote count: 1
answers question: http://stackoverflow.com/q/28618191
type: Answer
has body: It all eventually depend on how you organize your routes, since you can inherit routes and provide resolve clause for each child and the parents, but you also have stateChangestart stateChangeSuccess events that will allow you to do something similar to that. for further assistance please provide samples of your routes
has comment: http://stackoverflow.com/comment/45539749
has comment: http://stackoverflow.com/comment/45542267
downvote count: 0
score: 1

http://stackoverflow.com/comment/45623586
has text: Show a full HTML tag that is using one of the HREFs. "Right now the url points locally e.g. file:///Users/**/project/file.html." Do you mean it has the absolute path from your own machine, or the absolute local path of the target user's machine? If the 2nd, then isn't that exactly what you want? You want them to just open it from the local folder and link to other files relative in the same local folder.
comment on: http://stackoverflow.com/q/28662200
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28799619
has comment: http://stackoverflow.com/comment/109727042
has comment: http://stackoverflow.com/comment/45884035
accepted answer of: http://stackoverflow.com/q/28644340
has body: It's possible... on any site :) However, there is no cross-browser method. In Chrome and Opera (and most probably Safari, but I cannot test it now) you can access the clipboard as you wrote in your question. In fact, this method is just workaround for the Chromium bag Issue 31426. The following code implements this functionality. Press Alt-PrtScr, click in the editor field and paste. I simply print the image data; in the real program I could send it to my server for the further processing, for example. $(document).ready(function() { $('#editor').on('paste', function(e) { var orgEvent = e.originalEvent; for (var i = 0; i < orgEvent.clipboardData.items.length; i++) { if (orgEvent.clipboardData.items[i].kind == "file" && orgEvent.clipboardData.items[i].type == "image/png") { var imageFile = orgEvent.clipboardData.items[i].getAsFile(); var fileReader = new FileReader(); fileReader.onloadend = function() { $('#result').html(fileReader.result); } fileReader.readAsDataURL(imageFile); break; } } }); }); #editor { width: 500px; min-height: 40px; border: solid 1px gray; padding: 4px; } #resultcnt { width: 100%; margin-top: 16px; } #result { display: block; max-width: 90%; margin: 16px 0 32px 0; font-size: 12px; color: blue; overflow: visible; word-break: break-all; } Copyed image src: In IE and Firefox you can achieve the same result using a different approach. Lucky, these browsers have no problem to paste print screen into editor, so you don't need to access clipboard at all. You just listen to the paste event and using the interval catch the point of time when the image is already created but still not rendered. Then you simply get the image source and empty the editor. The following code implements this algorithm. When you run it in IE or Firefox the result will be the same as the previous sample's results in Chrome and Opera: Copyed image src:
answers question: http://stackoverflow.com/q/28644340
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 13
score: 13

http://stackoverflow.com/comment/82331845
has text: `Xrm.Page` is now deprecated as of v9.0 https://learn.microsoft.com/en-us/dynamics365/get-started/whats-new/customer-engagement/important-changes-coming#some-client-apis-are-deprecated
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28617601
type: AnswerComment

http://stackoverflow.com/q/28621605
tagged with: javascript
tagged with: fullcalendar
has title: Call a function when we drag and create event, Jquery full calendar
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45545415
type: UnansweredQuestion
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45558890
type: Question
has body: I have just started using jquery full calendar, but I am in a situation here. I just want to call a function when I create an even by dragging. But I used a select function like this: select: function(start, end, allDay, event, resourceId, resources) { } But I can this is called only after creating that event by dragging. Is there any function in full calendar that can be called, at the starting of drag and create an event.
has answer: http://stackoverflow.com/a/42653177

http://stackoverflow.com/comment/45653048
score: 0
type: Comment
has text: @JonathanOwenChute - I added a third version that uses binary flags.
comment on: http://stackoverflow.com/a/28679837
type: AnswerComment

http://stackoverflow.com/comment/45665445
comment on: http://stackoverflow.com/a/28686446
score: 2
type: AnswerComment
has text: there are more than one way to pass information to angular controller and one of them is controller as, that way you can write it like this " var self = this;" this is not the problem, he can use multiple levels of controllers. actually his way is better
type: Comment

http://stackoverflow.com/comment/45629683
comment on: http://stackoverflow.com/q/28667314
type: QuestionComment
has text: I don't "own" the server. It's a 3rd party web service.
type: Comment
score: 0

http://stackoverflow.com/q/28705875
has answer: http://stackoverflow.com/a/28705998
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/45701351
tagged with: javascript
has body: I have an application connected to Firebase and displayed with an ng-repeat, see code below. The connection works and displays, but the description item has a \n inline to create separate paragraphs, which unfortunately is being stripped out and the paragraphs simple print to page as one big paragraph. I am currently using Angular 1.3.8. I've tried ngSanitize and its either not working or I am using it incorrectly. Any help is greatly appreciated. Thank you. {{ m.company }} {{ m.address }} {{ m.address2 }} {{ m.url }} {{ m.name }} {{ m.title }} {{ m.phone }} {{ m.email }} {{ m.description }}
has comment: http://stackoverflow.com/comment/45701448
has answer: http://stackoverflow.com/a/28706065
score: 0
answer count: 2
has title: Keep formatting from being stripped from JSON in Angular from Firebase
tagged with: angularjs-ng-repeat
tagged with: angularjs
type: UnansweredQuestion
tagged with: firebase

http://stackoverflow.com/a/28615860
type: AcceptedAnswer
has body: You can't write to files via Javascript, as others have said, but if you just want to store JSON objects in a different file and don't need to change the files, just throw them in a .js file and call that file in script tags before you call your main JS file. As long as it's in the global scope, the questions object will be available to methods in other files.
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28615525
has comment: http://stackoverflow.com/comment/45646386
accepted answer of: http://stackoverflow.com/q/28615525

http://stackoverflow.com/q/28728865
tagged with: javascript
has answer: http://stackoverflow.com/a/28729104
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45744075
has comment: http://stackoverflow.com/comment/45744205
has answer: http://stackoverflow.com/a/28728974
answer count: 4
has title: how can I submit the value of an unchecked checkbox
tagged with: jquery
has answer: http://stackoverflow.com/a/28728999
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: php
tagged with: checkbox
has answer: http://stackoverflow.com/a/28729075
has comment: http://stackoverflow.com/comment/45744207
score: 0
has body: I have a user edit page with a set of user permissions. Each permission is basically a checkbox. If checked the user has the permission if unchecked the user does not have the permission. So if I want to remove a permission I would uncheck the box and vice versa to add a permission. I got everything to work using a hidden input, but the problem that I am having is that it is submitting both the hidden input and the checkbox value. For example even if I don't make a change and click the update button, I get a message that reads: Removed access from 1 permission levels Added access to 1 permission levels I will show you my code below. Something to keep in mind is that each input calls a different function. Here is the inputs: &lt;ul class="list-group permission-summary-rows"&gt; &lt;?php //List of permission levels user is apart of foreach ($permissionData as $v1) { if(isset($userPermission[$v1['id']])){ ?&gt; &lt;li class="list-group-item"&gt; &lt;?php echo $v1['name']; ?&gt; &lt;span class="pull-right"&gt; &lt;input type="hidden" name="removePermission[&lt;?php echo $v1['id'] ?&gt;]" id="removePermission[&lt;?php echo $v1['id'] ?&gt;]" value="&lt;?php echo $v1['id'] ?&gt;" &gt; &lt;input type="checkbox" checked data-toggle="switch" name="addPermission[&lt;?php echo $v1['id'] ?&gt;]" id="addPermission[&lt;?php echo $v1['id'] ?&gt;]" value="&lt;?php echo $v1['id'] ?&gt;" &gt; &lt;/span&gt; &lt;/li&gt; &lt;?php } } ?&gt; &lt;?php //List of permission levels user is not apart of foreach ($permissionData as $v1) { if(!isset($userPermission[$v1['id']])){ ?&gt; &lt;li class="list-group-item"&gt; &lt;?php echo $v1['name']; ?&gt; &lt;span class="pull-right"&gt; &lt;input type="checkbox" data-toggle="switch" name="addPermission[&lt;?php echo $v1['id'] ?&gt;]" id="addPermission[&lt;?php echo $v1['id'] ?&gt;]" value="&lt;?php echo $v1['id'] ?&gt;" &gt; &lt;/span&gt; &lt;/li&gt; &lt;?php } } ?&gt; Here is the PHP: //Remove permission level if(!empty($_POST['removePermission'])) …

http://stackoverflow.com/a/28603625
type: Answer
accepted answer of: http://stackoverflow.com/q/28603596
score: 2
answers question: http://stackoverflow.com/q/28603596
has comment: http://stackoverflow.com/comment/45516050
upvote count: 2
has body: You can select the td by index using :eq(): $(document).on('click', '#guardarBtn', function (event) { var $tr = $(this).closest('tr'); var email = $tr.find('td:eq(3) input').val(); alert(email); }); Example fiddle
has comment: http://stackoverflow.com/comment/45515653
has comment: http://stackoverflow.com/comment/45515583
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45519308

http://stackoverflow.com/q/28606841
tagged with: javascript-objects
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28607130
downvote count: 0
type: Question
upvote count: 2
answer count: 2
possible better answer: http://stackoverflow.com/a/28608079
tagged with: javascript
tagged with: session-storage
has title: Session Storage: how to store multiple objects
has body: Im trying to store multiple student objects (built from a form submission) into session storage and then eventually loop over session storage and display them on a page. Im not very familiar with any of this and its my first crack at it... How do i store multiple students ? i feel like i need an append... im just overwriting every time... Thanks ! btw... must be pure JS HTML First Name : Last Name : Email Address : Create Student Cancel JS function createStudent(){ var student = new Object(); student.fName = document.getElementById('fName').value; student.lName = document.getElementById('lName').value; student.email = document.getElementById('email').value; sessionStorage.setItem('student', JSON.stringify(student)); var retrievedObject = sessionStorage.getItem('student'); console.log('retrievedObject: ', JSON.parse(retrievedObject)); }
favorite count: 0
accepted answer: http://stackoverflow.com/a/28607130
has answer: http://stackoverflow.com/a/28608079

http://stackoverflow.com/comment/45557921
type: Comment
has text: $.find.tokenize does exist in newer version of jquery
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28628323

http://stackoverflow.com/q/28673069
tagged with: recursion
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28673169
answer count: 1
has comment: http://stackoverflow.com/comment/45639714
has answer: http://stackoverflow.com/a/28673169
has comment: http://stackoverflow.com/comment/45639564
has title: getting undefined from recursive function in javascript
type: AnsweredQuestion
has body: I was about one hour trying to figure out why i am getting undefined from this function, the function works well, it stops when the condition triggers and the value of the randomAlphabet is correct, sure is a stupid bug but it makes me feel very annoying. Here is the code: (function() { var getAlphabet = function() { var alphabet = []; for ( var asciiCode = 97; asciiCode &lt; 123; asciiCode++ ) { alphabet.push(String.fromCharCode(asciiCode)); } return alphabet; }; var getRandomAlphabet = function(alphabet, randomAlphabet) { var alphabet = alphabet || getAlphabet(); var alphabetLength = alphabet.length; var randomAlphabet = randomAlphabet || []; if ( alphabetLength === 0 ) { return randomAlphabet; }; var getRandomIndex = function(min, max) { return Math.floor(Math.random() * (max - min) + min); }; // remove the random item from the original alphabet var randomIndex = getRandomIndex(0, alphabetLength); var randomItem = alphabet.splice(randomIndex, 1)[0]; // add the random item to the random alphabet randomAlphabet = randomAlphabet.concat(randomItem); getRandomAlphabet(alphabet, randomAlphabet); }; // this returns undefined console.log(getRandomAlphabet()); })();
has comment: http://stackoverflow.com/comment/45639583
type: Question

http://stackoverflow.com/a/28725672
has comment: http://stackoverflow.com/comment/45737868
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28724776
has body: &lt;script&gt; var vel = 1; function incrementVel() { vel++; initSlider(); document.getElementById("velocita").value = vel; } function decrementVel() { vel--; initSlider(); document.getElementById("velocita").value = vel; } function initSlider() { if ( DYN_WEB.Scroll_Div.isSupported() ) { DYN_WEB.Event.domReady( function() { var wndo = new DYN_WEB.Scroll_Div('wn', 'lyr1'); wndo.makeSmoothAuto( {axis:'h', bRepeat:true,repeatId:'rpt1', speed:vel , bPauseResume:false,} ); }); } } &lt;/script&gt; &lt;button onclick="decrementVel()"&gt;-&lt;/button&gt;&lt;button onclick="incrementVel()"&gt;+&lt;/button&gt; &lt;input type="text" id="velocita"&gt;
has comment: http://stackoverflow.com/comment/45741066
has comment: http://stackoverflow.com/comment/45738099
has comment: http://stackoverflow.com/comment/45739282

http://stackoverflow.com/a/30387274
score: 3
has body: Just came across this which got me part of the way there but as noted if you use only element.text() you only get the last one. But you can use element.append() repeatedly in the same cell with the %%javascript and and all of the output will go to the following cell. Just make sure to append a &lt;br&gt; if you want a carriage return. Like for example function assert(cond,msg) { if (!cond) { element.append(msg + "&lt;br&gt;"); } }
downvote count: 0
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/28711667

http://stackoverflow.com/comment/45752257
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28698185
type: QuestionComment
has text: Your code works for me, please be more clear on what is not working for you...

http://stackoverflow.com/comment/45660101
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28638565
has text: I updated my question with as many details I could. Hope it'll be enough for someone to give me a hint. I'll be more than happy to add more stuff if needed.
score: 0

http://stackoverflow.com/comment/45736919
type: Comment
type: QuestionComment
has text: We are using typescript with ES5 transpiler
comment on: http://stackoverflow.com/q/28725112
score: 0

http://stackoverflow.com/q/28738960
downvote count: 2
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/45761890
has body: I am trying to restrict submitting a form for specific email domains under html/php. Basically i do not want any user to sign up over specific email domains. For instance, all email domains will be ok except below ones; @deny.com @reject.net @spam.org How can i achieve this behavior with using jQuery, regular expression or any better way to do so ? Thanks in advance,
has answer: http://stackoverflow.com/a/32043554
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28739136
answer count: 4
has answer: http://stackoverflow.com/a/67808190
has comment: http://stackoverflow.com/comment/45761676
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45761749
type: Question
has comment: http://stackoverflow.com/comment/45761723
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45809205
tagged with: regex
has answer: http://stackoverflow.com/a/28739330
has title: how to restrict specific email domain(s) while submit a form
score: -1

http://stackoverflow.com/a/43694337
score: 86
has comment: http://stackoverflow.com/comment/80137541
has comment: http://stackoverflow.com/comment/80520083
downvote count: 2
upvote count: 88
has comment: http://stackoverflow.com/comment/82034912
answers question: http://stackoverflow.com/q/28627908
has comment: http://stackoverflow.com/comment/81991087
has body: I stumbled over this thread searching for answer to similar case. Basically all answers are found, but it's still hard to extract the essentials from them. Kinds of Access Assume a class Foo probably derived from some other class(es) with probably more classes derived from it. Then accessing: from static method/getter of Foo class: some probably overridden static method/getter: this.method() this.property some probably overridden instance method/getter: impossible by design own non-overridden static method/getter: Foo.method() Foo.property own non-overridden instance method/getter: impossible by design from instance method/getter of Foo class: some probably overridden static method/getter: this.constructor.method() this.constructor.property some probably overridden instance method/getter: this.method() this.property own non-overridden static method/getter: Foo.method() Foo.property own non-overridden instance method/getter: not possible by intention unless using some workaround: Foo.prototype.method.call( this ) Object.getOwnPropertyDescriptor(Foo.prototype,'<property>' ).get.call(this) Keep in mind that using this isn't working this way when using arrow functions or invoking methods/getters explicitly bound to custom value. Background When in context of an instance's method/getter this is referring to current instance. super is basically referring to same instance, but somewhat addressing methods/getters written in context of some class current one is extending (by using the prototype of Foo's prototype). definition of instance's class used on creating it is available per this.constructor. When in context of a static method/getter there is no "current instance" by intention and so: this is available to refer to the definition of current class directly. super is not referring to some instance either, but to static methods/getters written in context of some class current one is extending. Conclusion Try this code: class A { constructor( input ) { this.loose = this.co…
type: Answer
has comment: http://stackoverflow.com/comment/81976115
has comment: http://stackoverflow.com/comment/80873335

http://stackoverflow.com/a/28648273
has comment: http://stackoverflow.com/comment/45594744
answers question: http://stackoverflow.com/q/28648162
has comment: http://stackoverflow.com/comment/45594501
has comment: http://stackoverflow.com/comment/45594299
has body: You are running 2 filters and then accessing the parent's twice of each filter. Is it possible that you could do: test1 test2 test3 .... and so on OR test1 test2 test3 .... and so on This way you could use simple selectors on the LIs that you actually want to remove? var remove = function remove(items){ $.each(items, function(index,value){ $('.'+value).remove(); }); }
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/45594538
downvote count: 0
has comment: http://stackoverflow.com/comment/45594399
score: 1

http://stackoverflow.com/q/28642193
tagged with: javascript
has comment: http://stackoverflow.com/comment/45583340
score: 3
has title: page freeze when parsing a large JSON file
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45583076
favorite count: 0
has answer: http://stackoverflow.com/a/28642243
has body: I am trying to load a 8MB json file using JSON.parse in Javascript, but the page would freeze for about 1-2 minutes, is there a way to parse async and put a loading info or even percentage info improving the user interface? I google'd a little bit found jsonstream (https://github.com/dominictarr/JSONStream), my understanding is that it's for nodejs? and could not understand that. If someone have some simple example shown would be greatly appreciated. Thanks!!
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28642243
upvote count: 3
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/45583097

http://stackoverflow.com/comment/45687968
type: QuestionComment
has text: One best practice is calculating on server only the data of the pagination tab you show. If you show e.g. results 100 to 199 on a page, order your data and get items 100 to 199 only from server and you save the server from calculating so long. Handling less amount of data per view may be better of in efficiency, although you load each page from server.
type: Comment
comment on: http://stackoverflow.com/q/28698723
score: 1

http://stackoverflow.com/comment/45707578
score: 0
has text: Are you trying to generate password hash on the client and pass the hash down to the server for validation?
comment on: http://stackoverflow.com/q/28706485
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28645217
answers question: http://stackoverflow.com/q/28645056
has body: Create a coloumn to the table where you save the post details as posted_at and have DATETIME as its data type, Use $CurrentTime = date("Y-m-d H:i:s" ); and insert while you create the post i.e., insert So while retrieving the data just find the difference between the posted time and current time by $PostedTime = strtotime($FetchedData-&gt;posted_at) - strtotime(date("Y-m-d H:i:s" )); Then you shall convert the difference time as per your wish.
type: Answer
accepted answer of: http://stackoverflow.com/q/28645056
score: 0
type: AcceptedAnswer

http://stackoverflow.com/q/28600173
has answer: http://stackoverflow.com/a/28600415
accepted answer: http://stackoverflow.com/a/28600415
type: AnsweredQuestion
has title: bootstrap embedded/inline datepicker show last month on setDates
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45507009
score: 0
answer count: 1
tagged with: jquery
has body: I'm using bootstrap datepicker and I'm trying to set dates (events) from returned array of dates, but when I set dates by using datepicker's method (setDates), It's shows the month of the last date in the array of events, how to let it return to the current month. var events = ['02/02/2015','02/05/2015','02/09/2015','03/09/2015']; $('.calendar').datepicker({ multidate: true, daysOfWeekDisabled: "0,1,2,3,4,5,6", todayHighlight: true }); $('.calendar').datepicker('setDates', events); JSFiddle
tagged with: twitter-bootstrap
tagged with: datepicker

http://stackoverflow.com/comment/45746958
type: Comment
has text: Also I see that my code: $('#example').dataTable({ "ajax": { "url": 'getFin.php', ... etc. NEVER CALL getFin.php - I see that this file never called from console log
type: QuestionComment
comment on: http://stackoverflow.com/q/28730147
score: 0

http://stackoverflow.com/q/28727683
type: Question
has answer: http://stackoverflow.com/a/28728305
has body: I am getting this weird error that I attempting to debug. I have an input field that has the current time pre-displayed as the value. When I run the page I get the Uncaught Type error referring to the JavaScript file line number 8 (document.getElemntByID(&quot;theTime&quot;).valueAsDate=b;) Is it trying to say ValueAsDate is not defined? What do I put in place of it? Any help is most appreciated. html &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset=&quot;UTF-8&quot; content=&quot;HTML,CSS,XML,JavaScript&quot;&gt; &lt;script src=&quot;Scripts/jquery.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; &lt;script src=&quot;Scripts/Global.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;Styles/Design.css&quot;&gt; &lt;/head&gt; &lt;body&gt; &lt;form action=&quot;&quot; method=&quot;post&quot;&gt; &lt;fieldset&gt; &lt;table border=&quot;0px&quot; &gt; &lt;tr&gt; &lt;td colspan = &quot;2&quot; id=&quot;formHeader&quot;&gt; Select Date and Time &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class=&quot;spaceUnder&quot; id=&quot;formBody&quot;&gt;Date: &amp;nbsp;&amp;nbsp;&lt;input type=&quot;date&quot; id=&quot;theDate&quot;&gt;&lt;/td&gt; &lt;td align=&quot;center&quot; class=&quot;spaceUnder&quot; id=&quot;formBody&quot;&gt;Time: &amp;nbsp;&lt;input type=&quot;time&quot; id=&quot;theTime&quot; &gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/fieldset&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; JavaScript $(document).ready(function() { myTimer(); }); function myTimer() { var a = new Date(); var b = new Date(a.getFullYear(), a.getMonth(), a.getDate(), a.getHours() - 8, a.getMinutes()); //$(&quot;#theTime&quot;)[0].valueAsDate = b; document.getElementById(&quot;theTime&quot;).valueAsDate =b; }
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45741906
tagged with: jquery-events
answer count: 2
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has title: Uncaught Type Error: Cannont set Property 'valueAsDate' of null
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45741858
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45741978
has answer: http://stackoverflow.com/a/28728030
upvote count: 1

http://stackoverflow.com/q/28624076
type: Question
has answer: http://stackoverflow.com/a/28624418
score: 1
linked to: http://stackoverflow.com/q/1760250
linked to: http://stackoverflow.com/q/1060008
answer count: 2
upvote count: 1
tagged with: arrays
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: How to get javascript Timer to stop when not viewing tab/window
has body: I am running a page with a timer that I'm using to run in a iframe of a page so that I know that someone was on there actually with window in focus paying attention to screen and if leave have the timer pause until back viewing the window or in focus. I have 4 timer files: timer.css timer.js timer.php &amp; timerb.js I believe I would execute it in the following file and code, but that is where I am stuck as don't know what or where to add it for sure and no luck yet and why here asking so please take a look and let me know if you can help. File: timer.js function adTimer() { timer++; if(timer == fulltimer) { var show="Click "+key; $("#buttons").fadeIn(); $("#timer").html(show); } else { setTimeout(adTimer, 1000); } $("#bar").width((timer/fulltimer)*200); }
tagged with: timer
downvote count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28624151

http://stackoverflow.com/comment/45656214
type: AnswerComment
type: Comment
has text: nyuen I understood that from the beginning. I left out the on hover jQuery code I used. Thanks though for the communication.
comment on: http://stackoverflow.com/a/28665249
score: 0

http://stackoverflow.com/comment/45726474
has text: No, don't delete the question, it will be found by others who search and serve as a signpost for them. Admittedly, those questions are hard to find, it's only that I have them on my personal dupe list :-)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28719614
score: 0

http://stackoverflow.com/a/28631176
downvote count: 1
score: -1
answers question: http://stackoverflow.com/q/28626307
upvote count: 0
has body: If you want to search dynamically then you can use typeahead directive of angular-ui, you need to add its dependency in your app, in your case you can use following code: &lt;input type="text" ng-model="customSelected" typeahead="item as item.name for item in items | filter:{name:$viewValue}"&gt; for more details on typeahead, check http://angular-ui.github.io/bootstrap/#/typeahead
type: Answer

http://stackoverflow.com/comment/45656139
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28681461
has text: @JanosWeisz yes exactly, now I think it's not a css problem but may be related to processing the data in javascript.

http://stackoverflow.com/a/28723210
type: AcceptedAnswer
downvote count: 0
has body: Change this line {{title}} to {{title}} Camel-case should be converted to snake-case.
has comment: http://stackoverflow.com/comment/45733181
type: Answer
accepted answer of: http://stackoverflow.com/q/28723118
answers question: http://stackoverflow.com/q/28723118
score: 3
upvote count: 3

http://stackoverflow.com/q/28735025
tagged with: php
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28735101
score: 1
tagged with: mysql
upvote count: 1
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28735101
answer count: 1
downvote count: 0
tagged with: jquery
has body: I have form that has two kinds of input field, 1) input field for ID, 2) input field for name. I already have a mysql database with a table filled with ID and name data. What I want to do is when I type an ID number in the input field for ID, and when it loses focus, the jquery script will automatically fill the input field for name according to the ID number in the database. So my html input form is something like this: html : &lt;input type='text' name='id' class='input_id'&gt; &lt;input type='text' name='name' class='input_name'&gt; &lt;br&gt; &lt;input type='text' name='id'&gt; &lt;input type='text' name='name'&gt; jquery script: $(document).ready(function) { $('.input_id').blur(function() { $.post('search_name.php', { id: $('.input_id').val() }, function(data) { $('.input_name').val(data); }); }); }); php (search_name.php) code : &lt;?php $con = mysqli_connect('localhost','root','','database'); $id = $_POST['id']; $sql = "SELECT * FROM table WHERE id='$id'"; $query = mysqli_query($con, $sql); $result = mysqli_fetch_array($query); $name = $result['name']; echo $name; mysqli_close($con); ?&gt; The problem is in one form, I will have 20 rows of ID and name input field, how do I modify my jquery script so that when ID input field in row 1 loses focus, it will only auto-fill name input field in row 1, the one in row 2 will only auto-fill name input field in row 2 and so on, rather than writing the same script 20 times. I tried using traversing method such as (this) and (next), but I could not seem to get it working. I also tried using (:focus) method too, I am not sure whether I use it wrongly or it is not meant for this. All suggestions are welcomed. Thx in advance.
favorite count: 0
has title: Jquery Ajax couldn't get the current focused input element
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45660966
type: Comment
type: QuestionComment
has text: Unfortunately I cannot as it relies on a couple of backend servlets to populate the dropdown data. I just thought this might be a simple issue of oversight on my part and thought I might as well put it up on stack overflow while wrestling with it.
comment on: http://stackoverflow.com/q/28683919
score: 0

http://stackoverflow.com/comment/45502969
comment on: http://stackoverflow.com/q/28598193
has text: @m59 ill look into that and i didn't see the rest of of your 1st comment. thanks tho!!!
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28666538
has body: Started learning Backbone JS. Reading Codeschool docs. I just didn't understood why we need to declare this.model.on('....') in initialize, instead of just using 'this.render();' in toggleStatus function. Please someone explain me clearly. Below is the code I copy-pasted from docs: Before: var TodoView = Backbone.View.extend({ events: { 'change input': 'toggleStatus' }, toggleStatus: function(){ this.model.toggleStatus(); this.render(); //Doesn’t work for other model changes , WHY IT DOESN'T WORK?? }, render: function(){ this.$el.html(this.template(this.model.toJSON())); } } }); After: var TodoView = Backbone.View.extend({ events: { 'change input': 'toggleStatus' }, initialize: function(){ this.model.on('change', this.render, this); }, toggleStatus: function(){ this.model.toggleStatus(); }, render: function(){ this.$el.html(this.template(this.model.toJSON())); } });
tagged with: backbone.js
score: 0
has title: why cannot we declare this.render inside togglestatus function?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28667101
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45638640
type: AnswerComment
comment on: http://stackoverflow.com/a/28669577
type: Comment
score: 0
has text: Hi Paul , I got what you said. :-)

http://stackoverflow.com/q/28737342
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: angularjs
upvote count: 10
accepted answer: http://stackoverflow.com/a/28737440
type: Question
has answer: http://stackoverflow.com/a/28737440
type: AnsweredQuestion
has body: I have a problem - I've forgotten how to code! I have an angularJS directive that is on a parent wrapper tag (a DIV) and in my directive I wish to loop through the children (first Child DIVs). I have the following &lt;div data-check-attributes&gt; &lt;div data-ng-repeat="user in Users" data-id="{{ user.ID }}" data-ng-click="doSomething(user.ID)" data-new="{{ user.newUser }}" class=""&gt; &lt;div&gt; {{ user.userName }} &lt;/div&gt; &lt;div&gt; {{ user.userAge }} &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; Now in my directive I wish to loop through the first child divs (there could be many of these, but I am seeing 10 users in my loaded view) and perform certain checks and modifications in my directive, using the data attributes, the $location object and potentially many more... however I can't remember how to loop through the first child divs, I seem to get errors with everything I tried... so far I have this, which doesn't work! In the example below I just want to write the data-id of the first child nodes to the console .directive('checkAttributes', function ($location) { return{ restrict: 'A', link: function (scope, element) { // will use $location later console.log(angular.element(element)[0]); // this outputs the HTML console.log(angular.element(element)[0].children().length); // this errors, TypeError: object is not a function for (var i = 0; i &lt; angular.element(element)[0].children.length; i++) { console.log(angular.element(element)[0].children[i].getAttribute('data-id')); } } }; }); I'm confused... please help!
score: 10
has title: Loop through the children of an element in a AngularJS directive

http://stackoverflow.com/q/28627469
type: Question
has comment: http://stackoverflow.com/comment/45555549
answer count: 2
linked to: http://stackoverflow.com/q/203198
has comment: http://stackoverflow.com/comment/45558277
tagged with: javascript
has comment: http://stackoverflow.com/comment/45555547
tagged with: jquery
score: 0
has body: I want to create after every container a click function. It had worked but not anymore. When I want to create the event, he don't recognize the container because in debugger I can see he's going over the box of code. // Decide list order, load the thumbnail for each publication. var place = "first"; $('#archive').prepend('&lt;div class="container" id="'+entry.publicationID+'"&gt;&lt;/div&gt;'); $('.container:' + place).append('&lt;div class="thumb"&gt;&lt;/div&gt;'); $('.thumb:' + place).css("background-image", 'url(' + entry.thumbnailURL + ')'); $('.thumb:' + place).css("filter", 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=' + entry.thumbnailURL + ',sizingMethod="scale")'); $('.thumb:' + place).css("-ms-filter", 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=' + entry.thumbnailURL + ',sizingMethod="scale")'); // Load the publication title below each thumbnail. $('.thumb:' + place).after('&lt;div class="title"&gt;&lt;/div&gt;'); $('.title:' + place).append(entry.publicationName); // Load the publication startsdate &amp; enddate. $('.title:' + place).after('&lt;div class="date"&gt;&lt;/div&gt;'); $('.date:' + place).append(sdate + " tot " + edate); // Set up publication links. $('.container:' + place).click(function(){ loadPub(entry.publicationID, entry.publicationName); setActive(entry.publicationID); //Change css of current element });
has answer: http://stackoverflow.com/a/28627649
has answer: http://stackoverflow.com/a/28627597
has title: Calling class attribute not working
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/203198
tagged with: css
tagged with: onclick

http://stackoverflow.com/a/28685333
type: Answer
has body: Try this: $("img").on("mouseover", function(){ $(this).attr("src","img2.png"); });
answers question: http://stackoverflow.com/q/28620310
score: 0

http://stackoverflow.com/comment/45666309
has text: if preventDefault works
type: QuestionComment
comment on: http://stackoverflow.com/q/28686936
type: Comment
score: 1

http://stackoverflow.com/a/28718764
score: 3
type: Answer
downvote count: 1
answers question: http://stackoverflow.com/q/28717819
upvote count: 4
has body: Yeah; looks like envify-loader was the easy solution. I just added the following to my webpack loaders: { test: /config\.js$/, loader: "envify-loader" } And the config.js (and only that file) is modified to include any referenced environment variables statically :)
has comment: http://stackoverflow.com/comment/51004953

http://stackoverflow.com/comment/45729209
type: Comment
type: AnswerComment
score: 0
has text: the javascript-date-swiss-army-knife, so to say.
comment on: http://stackoverflow.com/a/28720834

http://stackoverflow.com/comment/45552131
comment on: http://stackoverflow.com/q/28625578
score: 0
type: Comment
type: QuestionComment
has text: add `success: function(data) { $('#someElement').html(data); }` to add the returned html to the DOM

http://stackoverflow.com/comment/46237403
type: Comment
comment on: http://stackoverflow.com/a/28941420
score: 0
type: AnswerComment
has text: 1. it does not use `math`. 2. i know point of this website, and talking about points, I have been contributing and editing/reviewing for 5 years, so your claim has no basis. 3. you simply claim it's not cross browser, while i tested it on IE9+, FF and Chrome, and it works, and I see no reason why it shouldn't. If you care that deeply about the comment being posted as an "answer", then I shall submit it as such.

http://stackoverflow.com/comment/45728523
type: QuestionComment
has text: http://errors.angularjs.org/1.3.9/$injector/nomod?p0=app ensure@https://code.angularjs.org/1.3.9/angular.js:1688:45 module@https://code.angularjs.org/1.3.9/angular.js:1762:20 https://code.angularjs.org/1.3.9/angular.js:4094:35 forEach@https://code.angularjs.org/1.3.9/angular.js:323:24 loadModules@https://code.angularjs.org/1.3.9/angular.js:4078:12 createInjector@https://code.angularjs.org/1.3.9/angular.js:4004:22 doBootstrap@https://code.angularjs.org/1.3.9/angular.js:1446:34 bootstrap@https://code.angularjs.org/1.3.9/angular.js:1467:23
comment on: http://stackoverflow.com/q/28720017
score: 0
type: Comment

http://stackoverflow.com/comment/45737693
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28725510
has text: I am trying to subtract `purchMile` from `currentMile` and divide it by `warrMile` for the first field
score: 0

http://stackoverflow.com/q/28667689
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28668112
score: 0
has answer: http://stackoverflow.com/a/28669018
type: Question
tagged with: video
type: AnsweredQuestion
has title: Pause HTML5 video if it was interacted with using spacebar like youtube?
has body: I'm using "vanilla" javascript :) I'm trying to replicate youtube's method of pausing video if spacebar is pressed. I'm able to get video to pause if the event is bound to the window but not the video, here is my code. window.addEventListener("keyup", function(evt) { if (evt.keyCode === 32) { if (video.paused) { video.play(); } else { video.pause(); } } }); As in the code above, using window works, but if i change window to video it doesn't work anymore even if I've interacted with the video player. Reason of necessity : if user is watching a video and wants to leave a comment, everytime they press the spacebar the video starts and pauses over and over again. So I need it to only pause or start if user has interacted with the video player and not clicked anywhere else, like youtube. Kind thanks. Edit: Noticed youtube uses Tabindex (never used it before), to make controls focusable, so that has something to do with it? That's only controls though and not the actual screen.
has comment: http://stackoverflow.com/comment/45629919
answer count: 2
accepted answer: http://stackoverflow.com/a/28669018
tagged with: javascript
has answer: http://stackoverflow.com/a/28668112
has comment: http://stackoverflow.com/comment/45629881

http://stackoverflow.com/a/28604931
answers question: http://stackoverflow.com/q/28603701
downvote count: 0
has body: Module.filter('exclude', function () { return function (items, exclude) { return items.filter(function (item) { return exclude.indexOf(item.id) === -1; // Checking if the itemid is present already in the array }); } }); And in your markup
score: 1
type: Answer
upvote count: 1

http://stackoverflow.com/a/28605160
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45515255
has body: var data = [ { product_id: 34, product_name: "Coca-Cola", price: 0.7 }, { product_id: 24, product_name: "Shredded Beef Steak Wrap", price: 2.99 } ]; Then calcultate sum : var total = 0; $(data).each(function(index,item) { total += item.price; }); total = parseFloat(total.toFixed(2)) Display : $("#result").html(total); Working exemple here : http://jsfiddle.net/9jpdLkp2/
downvote count: 0
answers question: http://stackoverflow.com/q/28605044
type: Answer
has comment: http://stackoverflow.com/comment/45516202

http://stackoverflow.com/a/28650406
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28650136
type: Answer
answers question: http://stackoverflow.com/q/28650136
upvote count: 1
score: 1
has body: You need to use the JavaScript function .sort() with a custom comparator, in which you will parse the start dates and compare them. the custom comparator is a function that receives 2 items, and returns negative/zero/positive value as per your custom comparison requirements. the .sort() function uses the provided comparator and uses it to compare the elements during sorting: var _dateArray = [{ startTime: 'Sat Feb 21 2015 19:00:00 GMT+0530 (IST)', endTime: ' Sat Feb 21 2015 20:00:00 GMT+0530 (IST)' }, { startTime: 'Sat Feb 21 2015 19:00:00 GMT+0530 (IST)', endTime: ' Sat Feb 21 2015 20:00:00 GMT+0530 (IST)' }, { startTime: 'Sat Feb 21 2015 17:00:00 GMT+0530 (IST)', endTime: ' Sat Feb 21 2015 19:15:00 GMT+0530 (IST)' }, { startTime: 'Sat Feb 21 2015 20:00:00 GMT+0530 (IST)', endTime: ' Sat Feb 21 2015 21:00:00 GMT+0530 (IST)' }, { startTime: 'Sat Feb 21 2015 16:30:00 GMT+0530 (IST)', endTime: ' Sat Feb 21 2015 16:45:00 GMT+0530 (IST)' }, { startTime: 'Sat Feb 21 2015 16:30:00 GMT+0530 (IST)', endTime: ' Sat Feb 21 2015 17:15:00 GMT+0530 (IST)' }]; //this is our comparator function function DateComparator(dateAPair, dateBPair) { var DateA = new Date(dateAPair.startTime); var DateB = new Date(dateBPair.startTime); if (DateA &lt; DateB) { return -1; } else if (DateA &gt; DateB) { return 1; } else { return 0; } } console.log(_dateArray); _dateArray.sort(DateComparator); console.log(_dateArray);
type: AcceptedAnswer

http://stackoverflow.com/q/28640841
favorite count: 0
answer count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: google-chrome
score: 2
type: Question
tagged with: debugging
has body: When I change Tabs in Chrome, a HTTP request automatically fires for the focus Tab. I expect a request to happen if I type a URL and press enter or if I click a submit button, but why is it happening just because I change tabs? This is a problem as I'm trying to trace through code in a .NET application and my debug breakpoint keeps fireing from new requests that are not real. I have include screenshots demonstrating the issue and a video with a simple Fiddler Trace using both Chrome and Firefox to demonstrate the requests. please Note I turned off all plugins in chrome just incase that was the issue Watch Video Example: Here is a video of the issue Here are some screenshots of the issue: About to Click on a Tab, at the moment Fiddler is Empty Clicking Chrome Tab fires request to the Server
downvote count: 0
tagged with: javascript
has title: HTTP request fires when Chrome browser tab changes focus
tagged with: asp.net
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45624651
type: Comment
comment on: http://stackoverflow.com/a/28656132
score: 0
type: AnswerComment
has text: Thank you- this was a pretty clear example (that reminds me that I need to think about using array methods like unshift better!) which also gives me the steps to get all possible combinations. Like I mentioned, I brute forced it with my first try, so I know that there are two answers and I'd like my recursion method to account for that as well.

http://stackoverflow.com/a/28624708
has comment: http://stackoverflow.com/comment/45558425
score: 1
has comment: http://stackoverflow.com/comment/45555978
accepted answer of: http://stackoverflow.com/q/28624255
answers question: http://stackoverflow.com/q/28624255
downvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45555626
has comment: http://stackoverflow.com/comment/45557433
type: Answer
has body: While setting a position you are using a pixel based system starting from the top left. The (2,5) element you refer to are only labels on x and y axis without any other meaning. So D3 will use (2,5) as distance in pixel from the top left... Note: to avoid incurring in problems you can even work by submultiples of dimension of the chart as here: vis.append("text") .attr("x", (w / 2)) .attr("y", (h / 2)) .attr("text-anchor", "middle") .style("font-size", "16px") .text("test2"); Fiddle here: http://jsfiddle.net/s2yn3b4p/ Update: To align with labels on x and y axis created with: x = d3.scale.linear().domain([0, 10]).range([p, w - p]), y = d3.scale.linear().domain([0, 10]).range([h - p, p]); You can make usage of: .attr("y", 5*(h/10)) .attr("x", 2*(w/10))
upvote count: 1
has comment: http://stackoverflow.com/comment/45551866
has comment: http://stackoverflow.com/comment/45555459
has comment: http://stackoverflow.com/comment/45551744

http://stackoverflow.com/comment/45712310
type: QuestionComment
has text: If you view the source of the page, what is `#clientFileName#` appearing as?
comment on: http://stackoverflow.com/q/28712058
score: 0
type: Comment

http://stackoverflow.com/a/28705827
answers question: http://stackoverflow.com/q/28705739
has comment: http://stackoverflow.com/comment/45704854
has body: You should have a look at CSS transitions. Basically you just need to change the right style from 300px to 0px and using transition: right 1s; you would see your element being animated https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Using_CSS_transitions Otherwise, you could have a look at jQuery.... (I feel bad).
score: 2
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28705739
has comment: http://stackoverflow.com/comment/45705009

http://stackoverflow.com/comment/87645619
comment on: http://stackoverflow.com/q/28715799
has text: You can try an installable trigger - see https://stackoverflow.com/questions/36871241/how-to-allow-onedit-function-to-affect-protected-cell-in-a-google-sheet
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45505245
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28599636
has text: use this `instanceOfFileReader.readAsDataURL(blob);`
type: QuestionComment

http://stackoverflow.com/q/28652546
has body: I want to get CSS selector of jQuery items set. By jQuery items set in this case I mean jQuery set created basing on some css selector and extended by some jQuery functions like .children etc like $(".basic-selector").children(); It's easy to get for simple scenario like direct selection: $("div.someclaass").selector //works ok - gives div.someclass But I also need to get css selector for more complex scenarios (and here jQuery is not returning valid css selector) $("div.someclass").children("p").selector //schould give div.someclass &gt; p And for more comples scenarios like $("ul, ol").children("li").selector //should give ul &gt; li, ol &gt;li Is it possible? Requirements: It must be valid css selector I cant change js code of creating sets It should work for all this kind of jQuery functions that can have css selector - like children, find, next, nextAll, .filter (with css param) etc. There are some functions like .prev or .parent that will not have css selector - I'm aware of that. Why do I need that? - I've got my plugin. It takes some jQuery set that was created basing on selector and executes some function on those items. But also - function needs to be executed in the future on new items added later that would match the set if they would exisit in the time of set creation code execution. For good understanding please check plugin page.
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45602908
has comment: http://stackoverflow.com/comment/45602567
has comment: http://stackoverflow.com/comment/45602288
score: 0
tagged with: css-selectors
has comment: http://stackoverflow.com/comment/45609856
tagged with: jquery-selectors
has answer: http://stackoverflow.com/a/28654086
answer count: 1
has comment: http://stackoverflow.com/comment/45602312
has title: Get CSS selector of all matching items in jQuery
type: UnansweredQuestion
tagged with: css
type: Question

http://stackoverflow.com/q/28645036
type: AnsweredQuestion
tagged with: javascript
has body: I'm trying the access the input field value using ng-model searchQuerybut it's not getting set. After removing typehead and typeahead-editable it works fine. Value - {{searchQuery}} Thanks for your help.
score: 0
has answer: http://stackoverflow.com/a/28668745
answer count: 1
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45588105
has title: AngularJs: ng-model is not getting set with typehead
accepted answer: http://stackoverflow.com/a/28668745
has comment: http://stackoverflow.com/comment/45588018
type: Question

http://stackoverflow.com/q/28611284
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28611416
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28611416
upvote count: 1
answer count: 1
has title: Replace *variable* text but keep case
favorite count: 0
type: AnsweredQuestion
has body: I need to replace some text in a javascript variable without losing case, ie. "MAT" ==> "MATch string in db" instead of "Mat" ==> "match string in db" Right now I'm doing this (doesn't keep the original case): var user_str = $("#user-input").val(); var db_match = db_match.replace(new RegExp(user_str, "ig") , '' + user_str + ''); I found cases where people needed to replace static text, but in my case I need to replace variable content instead. Obviously this doesn't work either: var user_str = $("#user-input").val(); db_match = db_match.replace(/(user_str)/ig, "$1"); Any idea how to do this?
downvote count: 0
score: 1

http://stackoverflow.com/comment/45567762
type: AnswerComment
score: 0
type: Comment
has text: oh yea , both solution working...but 2nd solution looks perfect :)
comment on: http://stackoverflow.com/a/28633708

api
tags question: http://stackoverflow.com/q/28636389
tags question: http://stackoverflow.com/q/28631959
tags question: http://stackoverflow.com/q/28614194
tags question: http://stackoverflow.com/q/28701131
tags question: http://stackoverflow.com/q/28646946
type: Tag
tags question: http://stackoverflow.com/q/28743923
tags question: http://stackoverflow.com/q/28709164
tag name: api
tags question: http://stackoverflow.com/q/28750222

http://stackoverflow.com/comment/45755651
comment on: http://stackoverflow.com/q/28735388
has text: https://developer.mozilla.org/en-US/docs/Web/API/notification
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28611586
has comment: http://stackoverflow.com/comment/45527197
score: 0
has body: You've got something trying to start up a digest cycle when one is already running. You should check directives and any other code you have which calls either $apply() or $digest() directly. I would try commenting out all of those $apply() and $digest() calls and see what happens. My guess is that the page will load successfully but you might not get everything on it updated. So then you can open another question and we can see what can be done to get rid of the call which is trying to start another digest cycle.
has comment: http://stackoverflow.com/comment/45556546
answers question: http://stackoverflow.com/q/28611410
type: Answer

http://stackoverflow.com/a/28704293
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28704111
type: Answer
answers question: http://stackoverflow.com/q/28704111
has body: Oh DUH, super simple answer here. All I need to do is access the scope directly and change the variable there: element.bind('scroll', function() { $scope.$apply(function() { $scope[attrs.scrollTop] = element.prop('scrollTop'); //DUH console.log("scrollTop", $scope[attrs.scrollTop]); }); });

http://stackoverflow.com/comment/45634207
has text: it's not easy. i would actually look at the rules the script defines and then grep your js files for a smoking gun. you might be able to use devtool's profile/timeline tools: layout events get connected to the stack trace in the GUI. lastly, and i mean lastly, you can clobber the style properties with a logging setter (using O.DP and a list of css property names and arguments.callee.caller), but ouch...
comment on: http://stackoverflow.com/q/28670087
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45761546
type: Comment
has text: You're welcome. :) If my answer solved your issue, I'd be happy if you accept it.
comment on: http://stackoverflow.com/a/28736929
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45580838
has text: It would require both Javascript (to make an Ajax call) and PHP (to accept the call, get the answer, and return it).
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28640743

http://stackoverflow.com/comment/45698796
type: QuestionComment
comment on: http://stackoverflow.com/q/28698082
score: 0
has text: i am still at a loss why you cannot change the generation method for the banner. Nothing stops you to overwrite any generated elements (if you anyhow can change the html?) It rather seems like you would like to have a workaround for a bad design (no offense meant)
type: Comment

http://stackoverflow.com/a/28820361
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28685432
has body: To answer my own question, the answer was actually pretty easy in the end, if you read up about parallel promises in the Parse docs https://parse.com/docs/js_guide#promises-parallel what the example misses is that the function passes to the final then() can accept an array of results, e.g. Parse.Promise .when([query0.find(), query1.find()]) .then(function (query0Results, query1Results) { res.render('index', { query0Results: query0Results, query1Results: query1Results, } ); });
upvote count: 1
type: Answer

http://stackoverflow.com/a/28656700
downvote count: 0
has comment: http://stackoverflow.com/comment/45609906
type: Answer
has comment: http://stackoverflow.com/comment/45609798
has comment: http://stackoverflow.com/comment/45610009
has comment: http://stackoverflow.com/comment/45609774
upvote count: 2
answers question: http://stackoverflow.com/q/28656596
score: 2
has comment: http://stackoverflow.com/comment/45609882
has body: It can be achieved with angular element: angular.element('body').append($compile("&lt;calendar&gt;&lt;/calendar&gt;")($scope));

http://stackoverflow.com/comment/45727720
comment on: http://stackoverflow.com/q/28718408
has text: Java is to Javascript as elect is to electronic
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45508983
has text: 1) The height in resizeIframe is not dynamic but static to 350px. 2) You can't resize your iframe if the parent's site is from different domain (same domain policy).
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28601736
score: 1

http://stackoverflow.com/comment/45738215
type: QuestionComment
type: Comment
has text: What does your server log say?
comment on: http://stackoverflow.com/q/28725815
score: 0

http://stackoverflow.com/comment/51479852
score: 0
comment on: http://stackoverflow.com/a/28667322
type: Comment
type: AnswerComment
has text: If I am to send this session data to my server and store it, then later, when the bookmarklet is clicked, I can ask the server if this user is authenticated. Is that correct? That doesn't seem secure.

http://stackoverflow.com/comment/45583634
type: AnswerComment
comment on: http://stackoverflow.com/a/28642127
has text: What do you mean with link? Something like this $currentdatetime = date('Ymd');
type: Comment
score: 0

http://stackoverflow.com/q/28653353
score: 0
answer count: 1
has body: I'm trying to create a simple counter using session storage, the objective is to show the item increase when you click on the respective add item. I'm having problems to check if the item is in the array and if it is not add it to array. my problem is in function itemsUpdate() Sorry i'm can't express the problem very well, try the demo and you will understand here is the demo: http://jsfiddle.net/t77hqka6/2/ `function itemsUpdate(items, item) { for (var i in items) { if (items[i].id === item.id) { console.log(items); items[i].value++; console.log(items); break; } else{ items.push(item); } } if(items.length === 0) items.push(item); }`
favorite count: 0
upvote count: 1
has answer: http://stackoverflow.com/a/28653517
has title: Session storage update items count
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28653517
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28676340
type: Answer
has body: Quick &amp; Dirty: $(document).ready(function(){ $(".foo").click(function(){ var low = parseInt($(this).attr("number")); var high = low + 7; $(".foo").each(function(){ var num = $(this).attr("number"); if (num &gt; low &amp;&amp; num &lt; high){ //YourFunction } }); }); });
score: 1
answers question: http://stackoverflow.com/q/28676075
upvote count: 1
downvote count: 0

http://stackoverflow.com/q/28695992
accepted answer: http://stackoverflow.com/a/28696544
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/45682465
favorite count: 0
upvote count: 1
has title: how to use AJAX?
tagged with: php
has body: I'm trying to use AJAX so that you don't see the reload refresh. i want if i change the select button from 1 to 5 that you can see 5 live change and that i can use the 5 in a php variable. i got this: &lt;script&gt; $(document).on('change', '#hoeveelheid', function(e) { var j_Hoeveelheid = this.options[e.target.selectedIndex].text; $.ajax({ type: 'POST', url: 'do.php', data: {aantal : j_Hoeveelheid}, success: function (data) { $('.test').html(data); } }); } &lt;/script&gt; Now is my question what i need to set in the do.php file? so that my script works without any refresh visible.
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28696544
has comment: http://stackoverflow.com/comment/45682651
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/45682455
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45682564
has comment: http://stackoverflow.com/comment/45682617

http://stackoverflow.com/comment/45550598
type: AnswerComment
score: 0
type: Comment
has text: No solution for my bonus question? :D
comment on: http://stackoverflow.com/a/28624694

http://stackoverflow.com/a/28612857
answers question: http://stackoverflow.com/q/28612737
type: Answer
upvote count: 1
has body: An example could be: if (!foo || foo.bar !== baz) { function1(); } else { function2(); } Similar to kamituel's one, but shorter, and maybe easier to read.
has comment: http://stackoverflow.com/comment/45529269
downvote count: 0
score: 1

http://stackoverflow.com/comment/45625415
has text: `function translate2(x){ var newStr=''; x = "Hello World"; for(var i=0; i<x.length; i++) { newStr+=x.charAt(i); } console.log(newStr); }`
comment on: http://stackoverflow.com/a/28665179
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/52594014
answers question: http://stackoverflow.com/q/28706485
upvote count: 2
has comment: http://stackoverflow.com/comment/92142196
has body: Here's another option which actually compares the bytes as opposed to converting to a string representation. const crypto = require('crypto'); const password = 'Password123'; const storedHashString = 'J9IBFSw0U1EFsH/ysL+wak6wb8s='; const storedSaltString = '2nX0MZPZlwiW8bYLlVrfjBYLBKM='; const storedHashBytes = new Buffer.from(storedHashString, 'base64'); const storedSaltBytes = new Buffer.from(storedSaltString, 'base64'); crypto.pbkdf2(password, storedSaltBytes, 1000, 20, 'sha1', (err, calculatedHashBytes) =&gt; { const correct = calculatedHashBytes.equals(storedHashBytes); console.log('Password is ' + (correct ? 'correct ' : 'incorrect ')); } ); 1000 is the default number of iterations in System.Security.Cryptography.Rfc2898DeriveBytes and 20 is the number of bytes we are using to store the salt (again the default).
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/92127846
type: Answer

http://stackoverflow.com/comment/45786348
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28732018
has text: See how fast you got an answer after you posted your full code? ;-) Glad you found your solution, *cheers!*

http://stackoverflow.com/a/28628121
score: 0
type: Answer
has body: try with beforeSend in the ajax of the autocomplete: beforeSend : function(){ showloader = false; } like as below: source: function(request, response) { $.ajax({ url: "autoComplete.php?type=vendor_id", dataType: "json", beforeSend: function() { // add this showloader = false; // change to false }, data: { term: request.term }, success: function(data) { response(data); } }); },
answers question: http://stackoverflow.com/q/28627947
has comment: http://stackoverflow.com/comment/45558227

http://stackoverflow.com/q/28640560
has title: Something not allow me to show 2 things in one page
has comment: http://stackoverflow.com/comment/45580603
tagged with: javascript
has comment: http://stackoverflow.com/comment/45635212
has comment: http://stackoverflow.com/comment/45580610
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45580842
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45580788
tagged with: css
has comment: http://stackoverflow.com/comment/45580576
has body: So I made them on JSFiddle alone...you can see them by clicking the links...But when I put them together in one page...its not opening when I'm changing a javascript its working the other one...can some help me please...I think jquery.min.js is the problem..but how can I fix it 1st Code: $(function() { $( "#dialog-form" ).dialog({ autoOpen: false, resizable: false, modal: true, open: function() { // On open, hide the original submit button $( this ).find( "[type=submit]" ).hide(); }, buttons: [ { text: "Save", click: $.noop, type: "submit", form: "dialog-form" // <-- Make the association }, { text: "Close", click: function() { $( this ).dialog( "close" ); } } ] }); $( "#create-user" ).on( "click", function() { $( "#dialog-form" ).dialog( "open" ); }); }); Show Show2 Save Show 2nd Code: Watch Something $(document).ready(function(){ $("a[data-rel='movieSS']").colorbox(); $(".movieTrailer").colorbox({iframe:true, width:705, height:580}); $('.more-count span').html($('.comment').size()); }); Here is the links 1st JSFiddle 2nd JSFiddle
linked to: http://stackoverflow.com/q/2810399
answer count: 0
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45580754
has comment: http://stackoverflow.com/comment/45580722
type: Question
has comment: http://stackoverflow.com/comment/45580649

http://stackoverflow.com/q/28634761
linked to: http://stackoverflow.com/q/7792519
has comment: http://stackoverflow.com/comment/45569526
type: UnansweredQuestion
answer count: 0
has title: javascript detect if iphone browser closes
type: Question
tagged with: ios
tagged with: javascript
score: 0
has body: I'm trying to detect if on ios (or any other mobile device for that matter) goes into background mode. onblur doesn't seem to fire. I was just wondering if there was another method I could use. Cheers
has comment: http://stackoverflow.com/comment/45569654

http://stackoverflow.com/a/31317136
has body: Please try the below code: (Just replace the "card: stripe_card_token" => "source: stripe_card_token") attr_accessor :stripe_card_token def save_with_payment if valid? customer = Stripe::Customer.create(description: email, plan: plan_id, source: stripe_card_token) self.stripe_customer_token = customer.id save! end end
type: Answer
answers question: http://stackoverflow.com/q/28649717
accepted answer of: http://stackoverflow.com/q/28649717
score: 3
upvote count: 3
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28684570
type: Question
has answer: http://stackoverflow.com/a/28684600
has comment: http://stackoverflow.com/comment/45661985
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3
type: UnansweredQuestion
has body: I'm new to programming. I am trying to display JSON data into an HTML file using JQuery. I am getting an error of Uncaught TypeError: Cannot read property 'length' of undefinedresumeBuilder.js:147 education.displayresumeBuilder.js:178 (anonymous function) in my console, and I'm not sure why. Any light you can shed on this error would be much appreciated! Here is my resumeBuilder.js file: var eduction = { "schools": [ { "name": "McGill University", "location": "Montreal, Quebec, Canada", "degree": "Master of Arts", "major": "Second Language Education", "url": "mcgill.ca" } ], "onlineCourses": [ { "title": "Full Stack Web Development Course", "school": "Bloc.io", "url": "bloc.io" } ] }; education.display = function() { if(education.schools.length > 0 || education.onlineCourses.length > 0) { for(i in education.schools) { $("#education").append(HTMLschoolStart); var formattedSchoolName = HTMLschoolName.replace("%data%", education.schools[i].name).replace("#", education.schools[i].url); var formattedSchoolDegree = HTMLschoolDegree.replace("%data%", education.schools[i].degree); var formattedSchoolLocation = HTMLschoolLocation.replace("%data%", education.schools[i].location); var formattedSchoolMajor = HTMLschoolMajor.replace("%data%", education.schools[i].major); $(".education-entry:last").append(formattedSchoolName + formattedSchoolDegree); $(".education-entry:last").append(formattedSchoolLocation); $(".education-entry:last").append(formattedSchoolMajor); } if(education.onlineCourses.length > 0) { $("#education").append(HTMLonlineClasses); for(i in education.onlineCourses) { $("#education").append(HTMLschoolStart); var formattedOnlineTitle = HTMLonlineTitle.replace("%data%", education.onlineCourses[i].title).replace("#", education.onlineCourses[i].url); var formattedOnlineSchool = HTMLonlineSchool.replace("%data%", education.onlineCourses[i].school); var formattedOnlineURL = HTMLonlineURL.replace("%data%", education.onlineCourses[i].url).replace("#", education.onlineCou…
has answer: http://stackoverflow.com/a/28684731
has title: JSON JQUERY Uncaught TypeError: Cannot read property 'length' of undefined
has answer: http://stackoverflow.com/a/28684586

http://stackoverflow.com/q/28737974
tagged with: javascript
tagged with: instant
has comment: http://stackoverflow.com/comment/45760815
duplicate of: http://stackoverflow.com/q/4327416
answer count: 0
type: UnansweredQuestion
tagged with: php
linked to: http://stackoverflow.com/q/4327416
type: Question
has title: How do I create a search similar to the browser 'find'?
has comment: http://stackoverflow.com/comment/45761060
has body: I'm looking for some advice/help, I have a page which lists 100's of SKU's and I need to create a search where you enter the stockcode and it will take you to that specific section of the page. In a nutshell it will work like the browser 'find'. This must be done with out the page reloading... Again the question is: How do I create a search similar to the browser 'find'?
tagged with: search
score: 0
tagged with: find

http://stackoverflow.com/comment/45545929
type: AnswerComment
has text: `selectByText($.trim(output));` - like this?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28621771

http://stackoverflow.com/q/28634421
has comment: http://stackoverflow.com/comment/45569147
has answer: http://stackoverflow.com/a/28652600
accepted answer: http://stackoverflow.com/a/28652600
type: AnsweredQuestion
has body: I am trying to implement the Form Validator from Jquery. onSuccess, I do an ajax-call. I was wondering why I need to push the submit-button twice before the validation starts working? The script is in a separate file which is included. If I call $.validation() on the page itself, it works immediately. Here is the js-code: $(document).ready(function () { $("#frmNews").submit(function (e) { e.preventDefault(); // -- form validation $.validate({ language: nederlands, onError: function () { // -- show alert $("#feedback-error").removeClass('hidden'); // -- back to top $("html, body").animate({scrollTop: 0}, "slow"); }, onSuccess: function () { // -- show preloader $('body').toggleClass('loaded'); $.ajax({ type: 'POST', url: '/ajax', data: $("#frmNews").serialize(), success: function (data) { var result = $.trim(data); if (result == 'success') { // -- show alert $("#feedback-success").removeClass("hidden"); // -- clear all fields emptyAllInputFields("#frmNews"); // -- back to top $("html, body").animate({scrollTop: 0}, "slow"); // -- hide preloader $('body').toggleClass('loaded'); } else if (result == 'error_saving') { // -- alert $("#feedback-error").removeClass("hidden"); // -- back to top $("html, body").animate({scrollTop: 0}, "slow"); // -- hide preloader $('body').toggleClass('loaded'); } } }); } }); }); });
has comment: http://stackoverflow.com/comment/45569098
tagged with: forms
type: Question
has comment: http://stackoverflow.com/comment/45568753
tagged with: validation
has title: jQuery form Validator: need to submit twice
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45569746
tagged with: ajax
score: 0

http://stackoverflow.com/comment/45504918
comment on: http://stackoverflow.com/a/28599267
type: AnswerComment
score: 0
type: Comment
has text: everything is wrapped within a $(), which is similar to what you have written if I'm not mistaken.

http://stackoverflow.com/comment/45786671
score: 0
has text: not sure what makes that difficult, should be very simple css
type: QuestionComment
comment on: http://stackoverflow.com/q/28749999
type: Comment

http://stackoverflow.com/a/28653961
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/28650815
has body: it turns out the strangeness with the matrices was the whole issue, further inspection lead me to the quaternion rotations and how they were exported from blender (my own file type so my bad) I'd not noticed blender has its quaternions formatted (W, X, Y, Z) where gl-matrix.js (the math library I'm using) is formatted (X, Y, Z, W) a few tweaks to the loading later and the model is animating perfectly! for the record of this question here was the loop I found worked finalBones = [] foreach bone in bones parent = bone mat = identityMatrix while (parent.parent != null) mat *= parent.transformMatrix mat *= parent.poseMatrix parent = parent.parent finalBones.push(mat)
score: 3
downvote count: 0

http://stackoverflow.com/q/28598765
score: 1
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28598865
tagged with: javascript
tagged with: ajax
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has title: Change Javascript src Depending On PHP Output
has body: How do you change the the Javascript src in foo.html in reaction to the output created from cond1.php via AJAX? For example, if cond1.php echoes 1 then src="something.js". I'd like to know this because in my actual project I will be using the Google Books API and I will need to use a different src depending on the output from the PHP file. foo.html cond1.php <?php $input = $_POST["inputText"]; if ($input == "") { echo "0"; } else { echo "1"; } ?>
tagged with: http://stackoverflow.com/tag/xml
favorite count: 0
type: UnansweredQuestion
tagged with: php
has answer: http://stackoverflow.com/a/28598829
downvote count: 0

http://stackoverflow.com/comment/45573638
has text: if you do new Rectangle() it will still run rectangle orignal function but Rectangle.protoype.constructor() will call Shape() @clarkk
comment on: http://stackoverflow.com/a/28636628
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45613779
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28659051
has text: For me, it works by adding `height:100%` to *html*, *section*, and *aside*, and then `height: calc(100% - 50px);` to *#bounds*

http://stackoverflow.com/comment/45675179
type: Comment
type: QuestionComment
has text: then try with `if(event.deltaY < 0)` or else.
comment on: http://stackoverflow.com/q/28691790
score: 0

http://stackoverflow.com/q/28620819
has answer: http://stackoverflow.com/a/41046837
answer count: 4
has comment: http://stackoverflow.com/comment/45544107
has body: Only started JS a couple of days ago, and I'm already having some troubles getting a toggle to work. I want the button to toggle between on and off when clicked. function click() { var change = document.getElementById("toggle"); if (change.innerHTML == "on"); { change.innerHTML = "off"; } else { change.innerHTML = "on"; } } on Is this how I should go about it?
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/7035842
has answer: http://stackoverflow.com/a/28621334
has title: How to change button text on click using JavaScript?
type: Question
has comment: http://stackoverflow.com/comment/45544644
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/28621597
has comment: http://stackoverflow.com/comment/45544088
has comment: http://stackoverflow.com/comment/45544067
has answer: http://stackoverflow.com/a/28620850
downvote count: 2
upvote count: 6
favorite count: 0
has comment: http://stackoverflow.com/comment/45544670
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/28671170
has comment: http://stackoverflow.com/comment/45636409
has body: So if you use JS than mean is client side, your DOM page have free access of all objects of your page coef events. May be in this step you dont need to use a regex just using DOM. jquery lib can easy update DOM object. in your step you want only tag. So i suggest : //using jquery $("p").each(function(){ console.log($(this)) }); //js var paras = document.getElementsByTagName("p"); for(p in paras){ console.log(paras[p]) }
score: 0
has comment: http://stackoverflow.com/comment/45641316
answers question: http://stackoverflow.com/q/28670152
type: Answer

http://stackoverflow.com/comment/45656811
has text: so all I need to do is to pass the date into `value` with the `mm/dd/yyyy` format? actualy the datepicker format is `dd-mm-yy`
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28681691
score: 0

http://stackoverflow.com/q/28707487
tagged with: http://stackoverflow.com/tag/json
type: Question
answer count: 1
tagged with: .net
tagged with: javascript
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45704723
has answer: http://stackoverflow.com/a/28707693
has body: I want to parse json code embedded inside html source under js function &lt;script type="text/javascript"&gt; someFunction({ data: [{"Href":"http://someimg.jpg"}] }); &lt;/script&gt; I've found the way how to parse json from but I dont know how to select data from someFunction inside variable to operate further.
tagged with: c#
has title: select row data from javascript function parsing html source

http://stackoverflow.com/comment/45759391
has text: @BK Saru , Does it helpful to you ? Solved Now ?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28737697
type: Comment

http://stackoverflow.com/comment/45764076
type: Comment
has text: Good point, yet still depends on use case and runtime. But generally regex is better. But as we mentioned earlier, premature optimization..
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28740098

palindrome
tags question: http://stackoverflow.com/q/28621599
tag name: palindrome
type: Tag

http://stackoverflow.com/q/28626529
tagged with: javascript
type: AnsweredQuestion
score: 7
has body: In fabric.js I want to add some key interaction on my canvas. If an IText object is selected I want it to be deleted if I hit the "del" key. I accomplished this by: $('html').keyup(function(e){ if (e.keyCode == 46) { obj = canvas.getActiveObject(); canvas.remove(obj); } }); Now the problem is that when I am in the middle of editing the IText and hit the DEL key, the object is obviously also removed. I want to prevent this by something like this: $('html').keyup(function(e){ canvas.observe('text:editing:entered', editing = true); console.log(editing); if (editing == false) { if (e.keyCode == 46) { removeObject(); } }; }); = only remove the object if I am not in the middle of editing the IText I found this fire event "editing:entered" here: http://fabricjs.com/docs/fabric.IText.html So I try to catch this with the above code. However, it looks like this event already fires when I select the text and did not really start to edit it. Any ideas how to solve this and check if I am really just editing the IText?
favorite count: 0
has title: fabric.js get "edit" state of IText object
type: Question
upvote count: 7
answer count: 1
has answer: http://stackoverflow.com/a/28641967
tagged with: fabricjs
downvote count: 0
accepted answer: http://stackoverflow.com/a/28641967

angularjs-scope
tags question: http://stackoverflow.com/q/28677310
tags question: http://stackoverflow.com/q/28709024
tags question: http://stackoverflow.com/q/28638392
tags question: http://stackoverflow.com/q/28664573
tags question: http://stackoverflow.com/q/28670213
tags question: http://stackoverflow.com/q/28621640
tags question: http://stackoverflow.com/q/28649343
tags question: http://stackoverflow.com/q/28680987
tags question: http://stackoverflow.com/q/28734475
tags question: http://stackoverflow.com/q/28709476
tags question: http://stackoverflow.com/q/28690110
tags question: http://stackoverflow.com/q/28718710
tags question: http://stackoverflow.com/q/28721607
tags question: http://stackoverflow.com/q/28620195
tags question: http://stackoverflow.com/q/28623217
tags question: http://stackoverflow.com/q/28629265
tags question: http://stackoverflow.com/q/28620092
tags question: http://stackoverflow.com/q/28727919
tag name: angularjs-scope
tags question: http://stackoverflow.com/q/28730084
tags question: http://stackoverflow.com/q/28700640
tags question: http://stackoverflow.com/q/28600063
tags question: http://stackoverflow.com/q/28663009
tags question: http://stackoverflow.com/q/28637581
tags question: http://stackoverflow.com/q/28731985
tags question: http://stackoverflow.com/q/28617609
tags question: http://stackoverflow.com/q/28622309
tags question: http://stackoverflow.com/q/28688483
tags question: http://stackoverflow.com/q/28632647
tags question: http://stackoverflow.com/q/28612667
type: Tag

http://stackoverflow.com/a/28647956
type: Answer
answers question: http://stackoverflow.com/q/28647836
score: 0
has comment: http://stackoverflow.com/comment/45593996
has body: Additionally to script problems pointed out by void, it seems all of your images lie on top of each other due to same absolute position and size, so that one of them will occlude all others.
has comment: http://stackoverflow.com/comment/45593628

http://stackoverflow.com/q/28650231
tagged with: angularjs
score: 3
type: AnsweredQuestion
has body: I have the following array: var date = { '2015': [{ 'month': 'Januar', 'day': 31 }, { 'month': 'Februar', 'day': 28 }] }; And I would like to make a ng-repeat equals to the number of days: Output needed: &lt;div ng-repeat="date in date.2015"&gt; {{date.month}} &lt;!-- Displays 12 month name --&gt; &lt;div ng-repeat="day in date.2015+{{$index}}+'.day'"&gt; {{day}} &lt;!-- displays 31, 30 or 28 times the day --&gt; &lt;!-- The day should also increment from 0 to the number --&gt; &lt;/div&gt; &lt;/div&gt; I hope this is clear. ng-repeat="day in date.2015+{{$index}}+'.day'" does not work
upvote count: 3
accepted answer: http://stackoverflow.com/a/28650596
type: Question
possible better answer: http://stackoverflow.com/a/28650310
has answer: http://stackoverflow.com/a/28650310
answer count: 2
linked to: http://stackoverflow.com/q/28651453
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28650596
favorite count: 0
has title: AngularJs: ng-repeat="item in arrayValue"

http://stackoverflow.com/comment/45642489
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28674229
has text: @Fergoso Can you create a fiddle? And did Zeratops answer not help you?
type: AnswerComment

http://stackoverflow.com/q/28594596
has answer: http://stackoverflow.com/a/28594613
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/45223638
has answer: http://stackoverflow.com/a/45223638
upvote count: 1
tagged with: href
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45495847
accepted answer: http://stackoverflow.com/a/28594613
has title: Using JavaScript to open a window to a specific size
score: 1
has body: I'm wanting to open a window to a specific size using the window.open method when my button div is clicked. I referenced some other online sources, and got it this far. I'm not sure what I'm doing wrong, the width works in firefox, however the height does not. None of it works in Chrome.
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/28593666
has body: reading on ng-checked attribute I realize we can use angular expressions to determine wether a checkbox is checked or not. I have images and dates. I want to make a table representing which image is active at a specific date. this sql fiddle should help you understand what I mean. In the fiddle, the four checkboxes are checked, but one of them (the one corresponding to the first image and the 'feb' date) should not be checked, since 'feb' is not in the dates of the first image (see the $scope definition below) My problem is that the expression date = image.dates in the ng-checked attribute always return true, hence the four checked checkboxes. What expression could I use to verify that a specific date is in the image's defined dates? I can change the data model, so if it would be easier to have the dates of a specific image as an array rather than a string please go ahead. view {{date}} {{image.name}} app var myApp = angular.module('myApp',[]); function MyCtrl($scope) { $scope.images = [ {name:'Image 1',dates:'jan'}, {name:'Image 2',dates:'jan,feb'} ]; $scope.dates = [ "jan", "feb" ]; }
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28593729
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28593729
has comment: http://stackoverflow.com/comment/45494036
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45494022
has title: Using angularjs expression to check boxes
type: Question

http://stackoverflow.com/q/28744983
tagged with: javascript
has title: Why won't my code print the value of a variable to the console?
has comment: http://stackoverflow.com/comment/45772583
has body: Overall I am trying to make a program that takes in users marks, then spits out the mean and the median. This is for an assignment in my computer science course. For some reason when I write the line, console.log(avg); it displays NaN instead of the value of the avg variable. Am I doing something wrong elsewhere in my code? Here is the rest of my code: var userMarks = []; for (var counter = 0; counter &lt; 3; counter++) { userMarks.push(prompt("What is your mark?")); } console.log(userMarks); var sum = 0; for (var i = 0; i &lt; userMarks.length; i++) { sum += parseInt(userMarks[i], 3); } var avg = sum / userMarks.length; console.log(avg);
possible better answer: http://stackoverflow.com/a/28758499
has comment: http://stackoverflow.com/comment/45772556
has answer: http://stackoverflow.com/a/28758499
has comment: http://stackoverflow.com/comment/45772548
has comment: http://stackoverflow.com/comment/45772586
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28745054
accepted answer: http://stackoverflow.com/a/28745054
type: Question
score: 0
answer count: 2

http://stackoverflow.com/comment/45519336
type: AnswerComment
comment on: http://stackoverflow.com/a/28607130
score: 0
type: Comment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/71252/discussion-between-jayd-and-naeem-shaikh).

http://stackoverflow.com/comment/45736868
type: Comment
comment on: http://stackoverflow.com/a/28725001
has text: Ooh ok I totally didn't know that this was what the OS was doing and that this was how it worked! Gratitude for clarifying, it makes sense now.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45524171
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28609749
score: 1
has text: Let me know if this [fiddle](http://jsfiddle.net/Superman/mANPs/) is helpful.

http://stackoverflow.com/comment/45612221
has text: I tried this before and am trying it now again - but i don't get the animation, just a jump. Any idea why?
comment on: http://stackoverflow.com/a/28658120
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28673312
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28673692
has comment: http://stackoverflow.com/comment/45640948
has comment: http://stackoverflow.com/comment/45641355
type: AnsweredQuestion
score: 1
tagged with: authentication
upvote count: 1
has title: Am I correctly using promise?
type: Question
has comment: http://stackoverflow.com/comment/45640325
accepted answer: http://stackoverflow.com/a/28673692
tagged with: javascript
answer count: 1
downvote count: 0
has body: I am new to angularJs and I am trying to implement login/logout in my application. I have an AuthService which logs user in, and a SessionService which writes the auth token to local storage (I am using jwt) Here the AuthService: 'use strict'; angular.module('App') .factory('AuthService', ['ApiService', 'SessionService', '$q', '$timeout', 'jwtHelper', function (ApiService, SessionService, $q, $timeout, jwtHelper) { // inherit var service = Object.create(ApiService); service.login = login; service.logout = logout; service.check = check; service.user = user; return service; function login(credentials) { return service.form('user.login', credentials) .then(function success(response) { SessionService.setToken(response.token); return response; }); } function logout() { // here we use a promise so it's easier to handle // logout in the controller by chaining methods var d = $q.defer(); $timeout(function () { SessionService.setToken(); d.resolve(); }, 0); return d.promise; } function check() { var token = SessionService.getToken(); return !!token &amp;&amp; !jwtHelper.isTokenExpired(token); } function user() { return service.call('user', {cache: true}); } }]); The problem I am facing it's in the logout method. I have no server call to do, just clear the local storage and user is logged out, but I'd like to handle this with a promise so in the controller I can do the following: function logout() { AuthService.logout().then(function success() { $state.go('login'); }); } Is this a good way of achieving this ?

http://stackoverflow.com/comment/45956687
comment on: http://stackoverflow.com/a/28706293
has text: @falcons1112 Glad I was able to help :) Though as you move on, you should look into flash messages, a more infallible, easily extensible way to show messages to your users. :) https://github.com/plasticbrain/PHP-Flash-Messages
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28730093
upvote count: 3
has comment: http://stackoverflow.com/comment/45750993
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28719939
type: Answer
answers question: http://stackoverflow.com/q/28719939
has body: I would guess that angular is accessing $scope.friends while it is still a promise. Have you tried resolving the variable by using the resolve statement in the .state-definition? app.js should look something like this: .state('tab.friends', { url: '/friends', views: { 'tab-friends': { templateUrl: 'templates/tab-friends.html', controller: 'FriendsCtrl', resolve: { allfriends: function(Friends) { return Friends.all(); } } } } }) and the controller would be: .controller('FriendsCtrl', function($scope, allfriends) { $scope.friends = allfriends; }) I think you need to use $q for correctly resolving, so the Service needs to look like this: .factory('Friends', function($http, $q) { var friends = []; return { all: function(){ var dfd = $q.defer(); $http.get("http://yanupla.com/apps/ligajaguares/equipos.json").then(function(response){ friends = response.data; console.log(friends); dfd.resolve(friends); }); return dfd.promise; }, get: function(friendId) { for (var i = 0; i &lt; friends.length; i++) { if (friends[i].id === parseInt(friendId)) { return friends[i]; } } return null; } } }); For more information on this, i recommend reading this formula from ionic: http://learn.ionicframework.com/formulas/data-the-right-way/ Additionally, this helped me a great deal in understanding the concept of promises: http://andyshora.com/promises-angularjs-explained-as-cartoon.html
score: 3

http://stackoverflow.com/comment/45587295
type: Comment
comment on: http://stackoverflow.com/a/28644408
score: 0
type: AnswerComment
has text: thanks, but it does not work, i want remove on id basis

http://stackoverflow.com/a/28721336
answers question: http://stackoverflow.com/q/28720919
has comment: http://stackoverflow.com/comment/45731669
accepted answer of: http://stackoverflow.com/q/28720919
upvote count: 1
type: AcceptedAnswer
has body: In your wineView the template attribute references the contents of an element (so in this case a string) which you are then trying to use as a function (hence the error) try passing the element to the underscore template function then use this in your render to then pass your model app.WineView = Backbone.View.extend({ tagName: 'li', template: _.template($('#wine').html()), render: function() { this.$el.html(this.template(this.model.toJSON())); return this; } });
type: Answer
has comment: http://stackoverflow.com/comment/45731924
downvote count: 0
score: 1

http://stackoverflow.com/comment/45649162
type: Comment
comment on: http://stackoverflow.com/a/28677290
has text: do i need to do anything with parameter 'deployedOn=20150223' in my .js file?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45639424
type: AnswerComment
score: 0
type: Comment
has text: FullPage.js is great, very easy to use.
comment on: http://stackoverflow.com/a/28672795

http://stackoverflow.com/a/28697593
has comment: http://stackoverflow.com/comment/45690737
type: AcceptedAnswer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45685825
has comment: http://stackoverflow.com/comment/45685953
accepted answer of: http://stackoverflow.com/q/28697390
has comment: http://stackoverflow.com/comment/45685560
type: Answer
has comment: http://stackoverflow.com/comment/45686150
answers question: http://stackoverflow.com/q/28697390
has body: Seems like you just want to namespace things, so use an object. var myAppFunctions = {}; myAppFunctions.ui = { a : function () { console.log("a"); } }; myAppFunctions.db= { b : function () { console.log("b"); } }; myAppFunctions.math= { double : function(num) { return num * 2; }, half: function (num) { return num / 2; } }; console.log( myAppFunctions.math.double(3) );
upvote count: 1
has comment: http://stackoverflow.com/comment/45690888
has comment: http://stackoverflow.com/comment/45691326
has comment: http://stackoverflow.com/comment/45686010
has comment: http://stackoverflow.com/comment/45689477
has comment: http://stackoverflow.com/comment/45685708
has comment: http://stackoverflow.com/comment/45689615

http://stackoverflow.com/q/28639537
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has body: Okay, I'm trying to search google and I can't find anything out on this. Probably because I don't know what the technique is called. Does anyone have any insight into how the tag input box on this website converts your text to tag items that can be removed by clicking the x? I'm sure there is plenty of information on how to achieve this, I just don't know what it's called.
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has title: Html/Javascript: Input Text To Item
has comment: http://stackoverflow.com/comment/45578747
has comment: http://stackoverflow.com/comment/45578834
has comment: http://stackoverflow.com/comment/45578748
has answer: http://stackoverflow.com/a/28639829
upvote count: 1
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45578755
has comment: http://stackoverflow.com/comment/45578598
type: Question
accepted answer: http://stackoverflow.com/a/28639829

asp.net-mvc
tags question: http://stackoverflow.com/q/28604610
tags question: http://stackoverflow.com/q/28730528
tags question: http://stackoverflow.com/q/28608548
tags question: http://stackoverflow.com/q/28621535
tags question: http://stackoverflow.com/q/28651878
tags question: http://stackoverflow.com/q/28739962
tags question: http://stackoverflow.com/q/28673240
tags question: http://stackoverflow.com/q/28623368
tags question: http://stackoverflow.com/q/28633755
tags question: http://stackoverflow.com/q/28686190
tags question: http://stackoverflow.com/q/28696664
tags question: http://stackoverflow.com/q/28745653
tags question: http://stackoverflow.com/q/28605515
tags question: http://stackoverflow.com/q/28705230
tags question: http://stackoverflow.com/q/28640027
tags question: http://stackoverflow.com/q/28670840
tags question: http://stackoverflow.com/q/28655063
tags question: http://stackoverflow.com/q/28666676
tags question: http://stackoverflow.com/q/28699890
tags question: http://stackoverflow.com/q/28606633
tags question: http://stackoverflow.com/q/28625578
tags question: http://stackoverflow.com/q/28678467
tags question: http://stackoverflow.com/q/28749989
tags question: http://stackoverflow.com/q/28664050
tags question: http://stackoverflow.com/q/28605494
tags question: http://stackoverflow.com/q/28714034
tags question: http://stackoverflow.com/q/28645511
tags question: http://stackoverflow.com/q/28727550
tags question: http://stackoverflow.com/q/28721409
tags question: http://stackoverflow.com/q/28647196
tags question: http://stackoverflow.com/q/28600828
tags question: http://stackoverflow.com/q/28748826
tags question: http://stackoverflow.com/q/28628307
tags question: http://stackoverflow.com/q/28737397
tags question: http://stackoverflow.com/q/28594833
tags question: http://stackoverflow.com/q/28627387
tags question: http://stackoverflow.com/q/28605198
tag name: asp.net-mvc
tags question: http://stackoverflow.com/q/28674628
tags question: http://stackoverflow.com/q/28724884
tags question: http://stackoverflow.com/q/28654466
tags question: http://stackoverflow.com/q/28729687
tags question: http://stackoverflow.com/q/28705628
tags question: http://stackoverflow.com/q/28747704
tags question: http://stackoverflow.com/q/28604512
tags question: http://stackoverflow.com/q/28640246
tags question: http://stackoverflow.com/q/28663517
tags question: http://stackoverflow.com/q/28603082
tags question: http://stackoverflow.com/q/28605001
tags question: http://stackoverflow.com/q/28665814
tags question: http://stackoverflow.com/q/28735543
tags question: http://stackoverflow.com/q/28681185
tags question: http://stackoverflow.com/q/28620454
tags question: http://stackoverflow.com/q/28595910
type: Tag
tags question: http://stackoverflow.com/q/28696540
tags question: http://stackoverflow.com/q/28606379
tags question: http://stackoverflow.com/q/28722135
tags question: http://stackoverflow.com/q/28689226
tags question: http://stackoverflow.com/q/28645663
tags question: http://stackoverflow.com/q/28709641
tags question: http://stackoverflow.com/q/28732641
tags question: http://stackoverflow.com/q/28646418

http://stackoverflow.com/comment/45744408
comment on: http://stackoverflow.com/q/28716353
score: 0
type: Comment
type: QuestionComment
has text: turn off interpolation. I am not sure if these are supported on android, but you could give it a try: https://stackoverflow.com/questions/17617254/images-in-web-browser-are-blurred-a-bit-how-to-fix-it

http://stackoverflow.com/a/28677088
accepted answer of: http://stackoverflow.com/q/28677054
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: Return exits the function. Nothing after it is executed. alert("Please enter something....... "); return false; document.getElementById('&lt;%=txtRate.ClientID %&gt;').focus(); //&lt;-- I will not run move it before alert("Please enter something....... "); document.getElementById('&lt;%=txtRate.ClientID %&gt;').focus(); //&lt;-- I will run return false;
answers question: http://stackoverflow.com/q/28677054
score: 7
upvote count: 7

http://stackoverflow.com/q/28742969
tagged with: javascript
has comment: http://stackoverflow.com/comment/45768769
upvote count: 4
score: 0
answer count: 2
downvote count: 4
possible better answer: http://stackoverflow.com/a/28748156
has answer: http://stackoverflow.com/a/28748156
favorite count: 0
has comment: http://stackoverflow.com/comment/45768791
has body: I'm playing around with Coffee script (I'm new to this "language") and tried just a very basic example: x = [1, 2, 3] for element in x console.log(element) This does what it says, for each of the elements it outputs it to the console. It's only when I took a lot at the Javascript it compiled to that I can't understand why they do this: (function() { var element, i, len, x; x = [1, 2, 3]; for (i = 0, len = x.length; i &lt; len; i++) { element = x[i]; console.log(x[i]); } }).call(this); Would it not just be better and more natural to do: for(i = 0; i &lt; x.length; i++) { console.log(x[i]); } Why does coffee script compile to such a way that does not seem natural? If I was writing the same exact code in Javascript, I would follow the method that I did, but I might be wrong in that the way I did it (Javascript) is not the most efficient or "natural" and the coffee script method is a better solutions.
has title: Why does CoffeeScript compile to unidiomatic JavaScript?
has comment: http://stackoverflow.com/comment/45768789
has answer: http://stackoverflow.com/a/28743558
has comment: http://stackoverflow.com/comment/45768707
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45779106
accepted answer: http://stackoverflow.com/a/28743558
tagged with: coffeescript
type: Question
has comment: http://stackoverflow.com/comment/45781847

http://stackoverflow.com/q/28594269
has comment: http://stackoverflow.com/comment/45495505
has comment: http://stackoverflow.com/comment/45495443
has title: AngularJS: ng-model does not update when ng-options refreshes
upvote count: 2
answer count: 1
has comment: http://stackoverflow.com/comment/45495374
tagged with: javascript
has answer: http://stackoverflow.com/a/28594598
type: AnsweredQuestion
score: 2
has body: I'm new to AngularJS, so I apologize if this question is naive. We have cascading selects that populate as you select values. When the value of Select A changes, the values in Select B also change since they filter based on the value in Select A. So here is the scenario: Choose option from Select A Choose option from Select B Change selection for Select A Observe that options in Select B update accordingly. Observe that bound model for Select B does not update accordingly. This seems so basic that we are really scratching our heads. What is the point of two-way data binding if this scenario isn't covered? Here is my view: Make: Select a make {{makeng}} Model: Select a model {{modelng}} Here's a Plunkr, demonstrating: http://plnkr.co/edit/9XrKgW?p=preview P.S. The above example is purely fictional and forked from another plunkr. Just the easiest way to demonstrate what we are seeing.
downvote count: 0
accepted answer: http://stackoverflow.com/a/28594598
favorite count: 0
tagged with: angularjs
type: Question

http://stackoverflow.com/comment/45734074
has text: I like the way you are thinking @alecxe , i was thinking the same way and comment out every other code then this from that 'it()' , atm it looks like: http://pastebin.com/VNvYfeFx
comment on: http://stackoverflow.com/a/28722613
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/28750791
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28750512
has body: Jquery you can show hide an element by ID easily using $('#element').toggle(); so put this in a click event $('#buttonID').click(function() { $('#elementID').toggle() });

http://stackoverflow.com/q/28676446
has comment: http://stackoverflow.com/comment/45646675
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/45647039
linked to: http://stackoverflow.com/q/14530734
tagged with: ios
tagged with: javascript
tagged with: jquery
has title: .click doesnt work on touch devices although it works on browser
has comment: http://stackoverflow.com/comment/45647946
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45646368
has comment: http://stackoverflow.com/comment/45648154
type: UnansweredQuestion
has body: .click doesnt work on touch devices although it works on browser! I am using a .click function that works fine on browsers, but when i try it on touchscreen devices, it won't work (the function isn't even called). The function should be called when i choose an select option. Is it possible that the problem is that the touch on an select option is not treated as a click? Is there a way to use the touch as a click in this specific situation? $brandImageOptions.find('.selecter-item').click(function(){ //The console.log won't work with a touch, but will work with a click console.log("This event is happening LOL WUT Right? RIGHT?!"); //DO STUFF }); I also tried: $brandImageOptions.find('.selecter-item').on('click', function(){ //The console.log won't work with a touch, but will work with a click console.log("This event is happening LOL WUT Right? RIGHT?!"); //DO STUFF }); and: $brandImageOptions.find('.selecter-item').on('click, touchstart', function(){ //The console.log won't work with a touch, but will work with a click console.log("This event is happening LOL WUT Right? RIGHT?!"); //DO STUFF }); Thank for helping :) The html is: MARCA CHEVROLET GMC AC-DELCO
has comment: http://stackoverflow.com/comment/45646445
tagged with: android
has comment: http://stackoverflow.com/comment/45646511
has comment: http://stackoverflow.com/comment/45646557
has comment: http://stackoverflow.com/comment/45646351

web-services
type: Tag
tags question: http://stackoverflow.com/q/28622216
tags question: http://stackoverflow.com/q/28681473
tags question: http://stackoverflow.com/q/28606715
tags question: http://stackoverflow.com/q/28743923
tags question: http://stackoverflow.com/q/28712469
tag name: web-services
tags question: http://stackoverflow.com/q/28736735
tags question: http://stackoverflow.com/q/28672818
tags question: http://stackoverflow.com/q/28617921
tags question: http://stackoverflow.com/q/28632997

http://stackoverflow.com/comment/45613099
type: QuestionComment
comment on: http://stackoverflow.com/q/28658562
has text: Research keywords: [Page Visibility API](http://www.w3.org/TR/page-visibility/), `visibilitychange` event.
score: 1
type: Comment

http://stackoverflow.com/q/28703574
has body: I have been struggling with this one for a while. I am trying to download CSV file generated by Google Adwords "download report" button. I can click the link just fine and see the resource in the background. The problem is that in order to download it, casperJS/phantomJS requires a URL to the file... but the CSV is generated on the spot and has the same URL as the page I am on (following that link just leads you to the homepage, not the CSV file so casperJS can't download it). Is there a way to save that resource without the URL? I found this workaround: downloading a file that comes as an attachment in a POST request response in PhantomJs But unfortunately, Google Adwords report button has no form that I can reference.
upvote count: 11
has comment: http://stackoverflow.com/comment/56728374
tagged with: casperjs
type: UnansweredQuestion
score: 11
tagged with: phantomjs
tagged with: javascript
type: Question
linked to: http://stackoverflow.com/q/16144252
has answer: http://stackoverflow.com/a/34512598
has comment: http://stackoverflow.com/comment/56741719
linked to: http://stackoverflow.com/q/12461096
answer count: 1
downvote count: 0
has title: CasperJS - downloading generated file with no URL
favorite count: 0
tagged with: download
tagged with: http://stackoverflow.com/tag/csv

http://stackoverflow.com/comment/45595618
type: QuestionComment
has text: I want to be able to take each object e.g. 2009-01 and print its content
comment on: http://stackoverflow.com/q/28649023
score: 0
type: Comment

http://stackoverflow.com/a/28659592
downvote count: 1
has body: If it's a permanent hard limit at 5 you could do something like $.each(data, function(i,item){ var upload = item.id; if (i &lt; 5) output.append(upload); }); Only appending if the index variable is less that 5 (on a 0 index, anyway)
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28659515
upvote count: 1

http://stackoverflow.com/q/28669033
upvote count: 2
tagged with: twitter-bootstrap
type: UnansweredQuestion
has body: I'm working a site using this Bootstrap example, with a simple slide in sidebar navigation. http://ironsummitmedia.github.io/startbootstrap-simple-sidebar/# It is slightly modified, so I have a button for the menu to open: // Opens the sidebar menu $("#menu-toggle").click(function (e) { e.preventDefault(); $("#sidebar-wrapper").toggleClass("active"); }); And a button for the menu to close: // Closes the sidebar menu $("#menu-close").click(function (e) { e.preventDefault(); $("#sidebar-wrapper").toggleClass("active"); }); I want to add functionality, so it will close if I click anywhere outside the sidebar. So far I have this: // Close the menu on click outside of the container $(document).click(function (e) { var container = $("#sidebar-wrapper"); if (!container.is(e.target) // if the target of the click isn't the container... &amp;&amp; container.has(e.target).length === 0 // ... nor a descendant of the container &amp;&amp; event.target.id !== "menu-toggle") // for the functionality of main toggle button { container.removeClass("active"); } }); But it seems to remove the "active" class this way. Best regards.
tagged with: javascript
has title: Close sidebar on click outside
type: Question
has answer: http://stackoverflow.com/a/28669056
answer count: 3
downvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/43713841
favorite count: 0
has answer: http://stackoverflow.com/a/65236502
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 2

http://stackoverflow.com/a/28749087
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
has body: If you want to run the promises in sequence, you can use Promise.reduce() for that: Promise.reduce startEndTimes, (total, startEndTime) -&gt; oandaClient getCandlesAsync( "#{dbInstrument.base}_#{dbInstrument.quote}" startEndTime.startTime startEndTime.endTime 'S5' ).then (candles) -&gt; console.log candles total.concat candles , [] .then (allCandles) -&gt; # use allCandles If you want to precede each call with a delay as you are running them in sequence, you can do that too: Promise.reduce startEndTimes, (total, startEndTime) -&gt; Promise.delay 10000 .then () -&gt; oandaClient getCandlesAsync( "#{dbInstrument.base}_#{dbInstrument.quote}" startEndTime.startTime startEndTime.endTime 'S5' ) .then (candles) -&gt; console.log candles total.concat candles , [] .then (allCandles) -&gt; # use allCandles
upvote count: 2
answers question: http://stackoverflow.com/q/28748742
accepted answer of: http://stackoverflow.com/q/28748742

http://stackoverflow.com/comment/45780161
type: QuestionComment
comment on: http://stackoverflow.com/q/28748684
type: Comment
score: 0
has text: I your code your interval is 1200 and the jumping might be because of your visual perception.Just keep it to 5000 and try.

http://stackoverflow.com/comment/45645811
score: 0
type: Comment
type: QuestionComment
has text: Please [show us your code](http://stackoverflow.com/help/mcve) so that we can see [what you have tried so far](http://whathaveyoutried.com).
comment on: http://stackoverflow.com/q/28676181

http://stackoverflow.com/comment/45781558
has text: I noticed that there were a couple of typos in the PHP function. Try with the changes. Yes, it should go in the , either in a header.php template or in index.php.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28708594
type: AnswerComment

http://stackoverflow.com/comment/45643546
score: 0
type: AnswerComment
type: Comment
has text: Why string "$(location.reload())" working in console but not working when i run test? Test code: `js.exec('$(location.reload())') browser.driver.executeScript('$(location.reload())')`
comment on: http://stackoverflow.com/a/28673410

http://stackoverflow.com/comment/75717232
type: AnswerComment
comment on: http://stackoverflow.com/a/28609036
score: 0
type: Comment
has text: Oops, I left out `+` from the list of characters mistakenly allowed in my comment above...discovering my omission 2 minutes after SO's cutoff for editing comments :/

http://stackoverflow.com/comment/45529153
score: 0
type: AnswerComment
has text: no, the function isn't getting called during the assignment. you are using the function as a variable. so after this operation p.foo and o.foo both reference the defined method foo() in the global scope. The assignment doesn't actually call the method. Assignments return the value being assigned so you can do `c = (a = b)` and everything will equal `c`. Since the thing being assigned is the foo function, that is what gets called at the end.
type: Comment
comment on: http://stackoverflow.com/a/28609266

http://stackoverflow.com/comment/45753841
type: Comment
comment on: http://stackoverflow.com/a/28721931
has text: After hours of trial and error, this was closest to the right answer. I ultimately did put quotes around the "name" in the PHP string and that fixed the problem...even though the plugin documentation and demos clearly showed that no quotes were needed. I now see that when you create an object by doing this: `var a = {name: "value"}`, you don't need the quotes, but when you are converting a string to an object via JSON.parse, the 'name' in the string to be converted must be quoted. Newbie mistake perhaps...noting it for others.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28596384
has title: Click a point on a highcharts graph from outside of the chart
type: Question
has answer: http://stackoverflow.com/a/28600334
accepted answer: http://stackoverflow.com/a/28600334
upvote count: 1
tagged with: highcharts
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/16233681
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45513383
type: AnsweredQuestion
downvote count: 0
score: 1
has body: I have a highcharts graph that has click events bound to it in order to fire a dropdown on the same page. It looks something like this: series: { point: { events: { click: function(event) { creditSideBar(event.point.y, formdate); } } } }; This function then triggers some magic to a sidebar element. What I'd like to be able to do is also trigger this click on the last point of the graph from an outside element within the same page. For instance the user would click a link such as: Last Point This link would find the last plot point on the graph and fire a click event just as if the user was clicking on the point of the graph themselves. Is is it possible to do with on highcharts?

http://stackoverflow.com/q/28636544
tagged with: angularjs
tagged with: minify
has body: I have my angular clientside javascript broken up such that a controller/filter/service/etc. is contained in its own file. Because I want to minify, I have to use inline dependency injection, so a controller might look like: ["$scope", "$aService", function ($scope, $aService) { // Do something } ] The difficulty is that JSLint is reporting errors which I take to mean that it is attempting to interpret the above code as JSON, which it is not -- it is a fragment of javascript. How can I get around this / tell jslint to treat this file as javascript instead? The specific JSLint Errors: Expected a JSON value. (E003) Expected ']' and instead saw 'function'. (W116) Expected '(end)' and instead saw '('. (W116)
has comment: http://stackoverflow.com/comment/45572930
answer count: 0
type: UnansweredQuestion
type: Question
tagged with: dependency-injection
has comment: http://stackoverflow.com/comment/45573281
has title: JSLint: interperet file as JS code fragment, not JSON
has comment: http://stackoverflow.com/comment/45574608
has comment: http://stackoverflow.com/comment/45573182
score: 0
has comment: http://stackoverflow.com/comment/45574519
tagged with: jslint
tagged with: javascript

http://stackoverflow.com/comment/45538704
type: AnswerComment
comment on: http://stackoverflow.com/a/28617663
score: 0
type: Comment
has text: Cool, the issue is that the variable i does not exist when the listener function is invoked. Hence why I suggested it that way. Glad you tailored it to suit your needs.

http://stackoverflow.com/comment/45712447
type: QuestionComment
has text: " i set the container2 top location as 130" where is container2, do you mean container1?
score: 0
comment on: http://stackoverflow.com/q/28712148
type: Comment

header
type: Tag
tag name: header
tags question: http://stackoverflow.com/q/28717433

http://stackoverflow.com/comment/45625378
type: AnswerComment
has text: I think you should be able to test it in a browser if you hold the click button of your mouse for more than 750 ms on the element you want to test the taphold.
type: Comment
comment on: http://stackoverflow.com/a/28664792
score: 0

http://stackoverflow.com/q/28723106
has answer: http://stackoverflow.com/a/28725304
has title: Backbone events selector - like jQuery
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28725304
has body: With a plain jQuery selector for an event I might do this: var ele = $('ul.list li'); $('a',ele).on('click',function(){}); Which targets all links under ele in the DOM (I think!). With backbone, my current events function in a view looks like: events: function(){ var e = {}; e['click a'] = 'someFunction'; return e; } How do I do the same using backbone, that is, target all links under ele..? Specifically the element I want to target is the el from the same view, which is created (not referenced) using tagName: 'li'. UPDATE: So I guess what I'm really asking is: Using Backbone views, how do I attach events only to DOM elements that are children of the view's DOM element..?
score: 0
answer count: 1
tagged with: jquery
tagged with: backbone.js
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45737014

http://stackoverflow.com/comment/45663812
score: 2
has text: Even if it wasn't the best solution, it's still a good answer, and you should always feel free to add those. :)
comment on: http://stackoverflow.com/q/28685388
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28697863
downvote count: 0
has body: You are submitting your form with your input type=submit. Try adding a button without type submit or add an eventlistener to your form and add event.preventDefault().
answers question: http://stackoverflow.com/q/28697815
upvote count: 3
type: Answer
score: 3

http://stackoverflow.com/comment/45642357
score: 1
has text: @RaphaelMüller: Actually that's not the [task](http://eloquentjavascript.net/03_functions.html#p_8y74cOkS91)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28674102

http://stackoverflow.com/comment/45730433
type: QuestionComment
comment on: http://stackoverflow.com/q/28721834
has text: Knowing what's inside `myitems` (at least its structure) would probably help.
score: 0
type: Comment

http://stackoverflow.com/a/28719774
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45766071
has comment: http://stackoverflow.com/comment/45726740
has body: .controller('ListaCtrl', function ($scope, dbFactory) { dbFactory.method().$promise.then( function(res){ $scope.items = res; //or res.data }, function(){ //error call back } ); });
downvote count: 0
answers question: http://stackoverflow.com/q/28719565
has comment: http://stackoverflow.com/comment/45767950
has comment: http://stackoverflow.com/comment/45726319
type: Answer
has comment: http://stackoverflow.com/comment/45767853

http://stackoverflow.com/comment/45521445
score: 0
type: AnswerComment
has text: Nice to see that after 2 years on this site you finally found a question to answer! Thanks again :)
type: Comment
comment on: http://stackoverflow.com/a/28594298

http://stackoverflow.com/comment/45502048
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28597820
has text: Take a look at this [page](http://blogs.msdn.com/b/mattgi/archive/2006/11/15/accessing-session-data-from-javascript.aspx). It is old but still might fight your needs.
type: QuestionComment

http://stackoverflow.com/comment/45534374
comment on: http://stackoverflow.com/a/28615280
type: AnswerComment
has text: Probably a [CORS](http://enable-cors.org/) issue then, What browser are you using ? I think firefox is fine with loading local file through JS, Chrome isn't as friendly. Best bet is to run it on a server.
score: 0
type: Comment

http://stackoverflow.com/a/28636789
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has body: I claim no knowledge of vaadin, but in general, for composition you should use the destination-out mode to clear something existing with what you draw on top. copy will as you discovered just copy, so everything existing will be cleared as 0-bytes are copied over. Try: canvas.setGlobalCompositeOperation("destination-out");
type: Answer
accepted answer of: http://stackoverflow.com/q/28636262
answers question: http://stackoverflow.com/q/28636262

http://stackoverflow.com/a/28706735
type: Answer
answers question: http://stackoverflow.com/q/28705792
has body: The best thing would probably be to wrap your plugin inside a component and execute the function inside didInsertElement Something like: App.SomeComponent = Ember.Component.extend({ didInsertElement: function(){ initializeMyPlugin(); } }); I suggest watching this by Evil Trout to get many more details about wrapping a jQuery plugin in your component
score: 0
has comment: http://stackoverflow.com/comment/45820127

http://stackoverflow.com/q/28641438
tagged with: php
type: AnsweredQuestion
downvote count: 0
accepted answer: http://stackoverflow.com/a/28641686
score: 1
has body: I cannot get the data from my javascript file to my PHP file. I have looked over the look many times and it just doesn't work. Maybe its something simple. Suggestions?? The "yes" response comes back fine from the javascript but the PHP "var_dump($_GET);" comes back with array "(size=0) empty" I'm lost to what's going on. Javascript: $.ajax({ type: 'POST', url: './dev.php', data: {tradeOf: tradeOf, test: "test"), success: function(response) { alert("yes") } }) PHP: &lt;?php var_dump($_GET); ?&gt;
type: Question
has answer: http://stackoverflow.com/a/28641686
has title: AJAX and PHP Data Transfer not working
tagged with: javascript
answer count: 2
upvote count: 1
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28641494
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28641494
has comment: http://stackoverflow.com/comment/45582008

http://stackoverflow.com/a/28657320
type: Answer
has body: one way to do it is to put a function on your getTokenStatus service. this is a simplified example, yet it shows how to pass an argument to your resolve function. app.factory('getTokenStatus',['$q', '$timeout', '$route', function($q, $timeout, $route){ this.action = function(tokenType) { var defer = $q.defer(); $timeout(function(){ var res = { path: $route.current.params.token, tokenType: tokenType } defer.resolve(res); },1000); return defer.promise; } return this; }]); and call it from your resolve object: app.config(function($routeProvider){ $routeProvider .when("/123/:token", { template: " hello ", controller: 'testCtrl', resolve: { tokenStatus: function(getTokenStatus) { return getTokenStatus.action('firstToken').then(function(res){ console.log(res); }); } } }) here's a plnkr
downvote count: 0
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28656956

http://stackoverflow.com/comment/45596365
score: 0
type: AnswerComment
type: Comment
has text: You can store the data in database/cookie and fetch them.
comment on: http://stackoverflow.com/a/28649452

http://stackoverflow.com/q/28735859
has comment: http://stackoverflow.com/comment/45756518
has answer: http://stackoverflow.com/a/28736218
accepted answer: http://stackoverflow.com/a/28736218
has comment: http://stackoverflow.com/comment/45756267
type: Question
has title: How to write js after using requirejs
has body: I wrote this in the header template : &lt;script data-main="/js/init.js" src="/js/require.js"&gt;&lt;/script&gt; In /js/init.js I required jquery and some other JS classes before the initial code. But in the body I need to load some separated JS code, and it needs to use jquery. e.g. This is what it is before I used requirejs : &lt;script&gt; $(function(){ $('#loginForm').submit(function(){ return false; }); }); &lt;/script&gt; For some reason it cant be put into /js/init.js and have to be write directly in this template. So how should I write them? Example:http://www.kannewyork.com/test.html its not work.
tagged with: javascript
has comment: http://stackoverflow.com/comment/45756443
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45756550
tagged with: requirejs
type: AnsweredQuestion

http://stackoverflow.com/a/28727959
downvote count: 1
answers question: http://stackoverflow.com/q/28725125
upvote count: 8
type: Answer
has body: The statics object of a React Class is a way to define static methods (i.e., methods that don't need any context to run). That being said, it doesn't make sense to call a static method from this. It looks like you're looking for a "static" property (i.e., non-mutable). So, you should use it like this.props.title on render(). To set the value of title, you should do &lt;Widget title='a title'/&gt;. It worths mentioning that you can set default properties, by defining the getDefaultProps method. More about statics and about props on React's doc.
score: 7

http://stackoverflow.com/comment/45552744
has text: It seems that a new request is not made at all after 500ms. Is it, because I do not obtain an error after 500ms and therefore no new request is made? It seems to me, that I have to start the tick function somewhere else before getting into .success?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28625567
score: 0

http://stackoverflow.com/comment/45763234
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28739541
has text: Thank you very much! I really need to learn regexp by the time..:)

http://stackoverflow.com/comment/45708755
type: QuestionComment
comment on: http://stackoverflow.com/q/28709809
score: 0
type: Comment
has text: as was mentioned, you are missing the most important part of the error; the module which is failing to load.

http://stackoverflow.com/comment/45558516
type: AnswerComment
has text: dont worry.. its just that my answer got accepted and your didnt. your answer is helpful as well. :) i upvoted
type: Comment
comment on: http://stackoverflow.com/a/28628860
score: 0

http://stackoverflow.com/a/28612553
accepted answer of: http://stackoverflow.com/q/28612517
has body: You are close, the method document.getElementById() returns an HTML element by using the id of the element HTML: &lt;html&gt; &lt;body&gt; &lt;div id="main"&gt; This is my main content to be hidden &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; Javascript: var element = document.getElementById("main"); element.classList.add("hidden"); If you want to use the class attribute to select your elements rather than the id you can use: document.getElementsByClassName() and then loop over the results Here is a JSFiddle example: http://jsfiddle.net/mko3uf9f/
type: Answer
upvote count: 3
score: 3
answers question: http://stackoverflow.com/q/28612517
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45749768
type: Comment
type: QuestionComment
has text: Is the only answer to pull the doSomeMutation function out so it can be tested in isolation from the rest of the fsFxnWrapper?
comment on: http://stackoverflow.com/q/28731628
score: 0

http://stackoverflow.com/a/28719032
type: Answer
answers question: http://stackoverflow.com/q/28715776
has body: The fast way: It is a void event handler, so you can just make it async and delay it: private async void Browser_ScriptNotify(...) { ... await Task.Delay(1); ... // everything here will execute after the original ScriptNotify event // was completely finished, as it continues on the same (UI) thread. } Proper way would be to use a queue or some messaging implementation.
score: 0
has comment: http://stackoverflow.com/comment/45756147

http://stackoverflow.com/a/28693106
upvote count: 2
answers question: http://stackoverflow.com/q/28685286
type: AcceptedAnswer
downvote count: 0
has body: The outer SVG element has a getCurrentTime method that can be used to find how far along the animation timeline you are. Once you know that you can work out how far along your animation is from the attributes it has and whether it's about to end. There is also an end that's sent when an animation ends which you can use if you want. E.g. elem.setAttribute("onend", "alert('done')"); I'm not sure whether webkit supports begin/end events yet but Firefox does.
has comment: http://stackoverflow.com/comment/45708803
accepted answer of: http://stackoverflow.com/q/28685286
type: Answer
score: 2

http://stackoverflow.com/q/28686332
tagged with: http://stackoverflow.com/tag/html
score: -2
downvote count: 2
tagged with: knockout.js
has body: Occassionally people will have trouble clicking on textboxes in a modal popup window on my site. This issue is not consistent and I have not been able to reproduce it, but I've had enough reports of it that I'm confident the issue exists. Tabbing into the textbox works and also makes the textbox clickable again, which is very confusing to me. I'm looking for possible reasons this could happen and things to look for.
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28686536
has comment: http://stackoverflow.com/comment/45665268
has answer: http://stackoverflow.com/a/28686384
upvote count: 0
has title: Problems with clicking on input areas
tagged with: jquery
favorite count: 0
type: Question
answer count: 2

http://stackoverflow.com/a/28728173
upvote count: 4
downvote count: 0
answers question: http://stackoverflow.com/q/28728078
accepted answer of: http://stackoverflow.com/q/28728078
has comment: http://stackoverflow.com/comment/45742808
score: 4
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45742790
type: Answer
has body: The second time around, in the click handler, you shouldn't use var, as that would redeclare bar within the function scope of the click handler. Simply remove the var as such: $(function(){ var bar = "0"; $('change').click(function() { bar = "1"; // Remove `var` }); $('action').click(function(){ alert(bar); } }); This is thanks to javascript's support for closures. I really recommend reading the closure bit (and rest) of Eloquent Javascript, available here: http://eloquentjavascript.net/03_functions.html

http://stackoverflow.com/q/28747632
type: Question
answer count: 2
has title: Error ngRoute is not available
tagged with: javascript
has answer: http://stackoverflow.com/a/28761037
score: 0
has body: there is my error in console Error: [$injector:nomod] Module 'ngRoute' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. this is my index.html header : this is my app.js : var app = angular.module('myapp', ['ngRoute']); app.config(function($routeProvider){ $routeProvider .when('/queueManager', { templateUrl: '/templates/page/queueManager.html', controller: 'QCtrl' }); }); app.controller('QCtrl',['$http','$interval','$scope', function($http, $interval,$scope){ this.queues = queue; var store = this; store.queues = []; var queue = []; $http.get('/queue/info').success(function(data) { store.queues = data; }); }); And this is my routes.js : angular.module("myapp", ['ngRoute']) .config(function($routeProvider){ $routeProvider.when('/queueManager', { templateUrl: '/templates/page/queueManager.html' }) }); In dev tools from chrome, files appears as loaded, and it seems that i spelled it right... An I still get the same error as mentioned before. Every time i search on stackoverflow, it's the same answer check if you added it in your html... Have you some solution about my problem ? Edit : Added app.config in app.js and changed routes module name to my app. And added edit Thank you
tagged with: ngroute
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/28747721
has comment: http://stackoverflow.com/comment/45780059
has answer: http://stackoverflow.com/a/28747721
accepted answer: http://stackoverflow.com/a/28761037
has comment: http://stackoverflow.com/comment/45779695
type: AnsweredQuestion

http://stackoverflow.com/comment/45742075
type: AnswerComment
type: Comment
has text: @f484126 here is my two cents. Hope it helps you :) there is an xpath example and a pure CSS example (without javascript). Have fun!
comment on: http://stackoverflow.com/a/28720985
score: 0

http://stackoverflow.com/comment/45670170
has text: @OP m59 answer is awesome but keep in mind the verion you are using :-)
type: AnswerComment
comment on: http://stackoverflow.com/a/28689014
score: 0
type: Comment

http://stackoverflow.com/comment/45500718
comment on: http://stackoverflow.com/q/28596990
score: 0
type: Comment
has text: Sometimes I see it fail to load shader.js which I agree doesn't make sense. But sometimes I see it fail to load other shader-related files which actually 404 on your server. For example, common-vertex.shader, waveform-fragment.shader, sonogram-vertex.shader Try downloading these from the source and adding them to your server.
type: QuestionComment

http://stackoverflow.com/comment/45584776
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28626147
has text: Man, you're awesome. Thak you! Muchas gracias.

http://stackoverflow.com/comment/45642279
type: Comment
type: QuestionComment
has text: @forgivenson This would be considered as "example code", which is off-topic for Code Review. There's no context in this code. Unlike SO, CR does not want the context to be stripped away.
comment on: http://stackoverflow.com/q/28674041
score: 0

http://stackoverflow.com/a/40713157
type: Answer
has body: var a = ["3","", "6"]; var b = [23,54,56]; var result = []; for (var i=0;i&lt;a.length;++i) { if (a[i] != "") { result[i] = b[i]; } } result = result.filter(function( element ) { return element !== undefined; }); console.log(result);
score: 4
upvote count: 4
downvote count: 0
answers question: http://stackoverflow.com/q/28607451

http://stackoverflow.com/comment/45556011
has text: [Dialog Widget | jQuery UI](http://api.jqueryui.com/dialog/)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28627780
score: 1

http://stackoverflow.com/comment/45517492
score: 0
has text: Do you want the item 10 be scrolled up showing nothing above it or be really the first element?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28606655

http://stackoverflow.com/a/28658304
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45613078
has comment: http://stackoverflow.com/comment/45613126
type: Answer
has comment: http://stackoverflow.com/comment/45613036
accepted answer of: http://stackoverflow.com/q/28658235
downvote count: 0
answers question: http://stackoverflow.com/q/28658235
score: 1
has comment: http://stackoverflow.com/comment/45613317
has body: Input type image is used to submit the data of a form. function randomlinks(){ var myrandom=Math.round(Math.random()*9); var links=new Array(); links[0]="http://www.javascriptkit.com"; links[1]="http://www.dynamicdrive.com"; links[2]="http://www.cssdrive.com"; links[3]="http://www.codingforums.com"; links[4]="http://www.news.com"; links[5]="http://www.gamespot.com"; links[6]="http://www.msnbc.com"; links[7]="http://www.cnn.com"; links[8]="http://news.bbc.co.uk"; links[9]="http://www.news.com.au"; window.location=links[myrandom]; } &lt;img style="width:48px" src="http://icons.iconarchive.com/icons/custom-icon-design/pretty-office-8/256/Insert-hyperlink-icon.png" value="random link!" onclick="randomlinks()"&gt; Lose the form and just attach the onclick handler to the image. Also: avoid DynamicDrive (It's the source of all evil in this world, like snowflakes scripts). And make it a habit of closing your lines with a ;
has comment: http://stackoverflow.com/comment/45613325

http://stackoverflow.com/q/28596454
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28596712
has answer: http://stackoverflow.com/a/28596712
has body: I have the following HTML code: And the JS code: $('.overlay > img').on('click', function(event){ var $this = $(this); if($this.hasClass('clicked')){ $this.attr("src","img/1-overlay.jpg").removeClass('clicked'); } else{ $this.attr("src","img/1.jpg").addClass('clicked'); } This is functional for only single image, but i want to do the same for all images in my carousel without repeat the same JS code above. What do you suggest?
answer count: 2
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
tagged with: carousel
favorite count: 0
tagged with: attr
has answer: http://stackoverflow.com/a/28596517
accepted answer: http://stackoverflow.com/a/28596517
has title: Toggle images in a carousel in sequence with jquery
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question

http://stackoverflow.com/comment/45653060
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28653705
has text: @Neograph734 - Nice catch. Enclosing them in the `$(document).ready(function() {` could certainly be submitted as an answer, as this seems to solve the problem as well. =)

http://stackoverflow.com/q/28635943
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28636280
downvote count: 0
tagged with: javascript
tagged with: sparse-array
has title: Sparse arrays and reduce in JavaScript
has body: One would think that in JavaScript: var array = [1,2,undefined,4]; is the same as: var array = [1,2]; array.length = 3; array.push(4); but it's not. This code shows it: var array1 = [1,2]; array1.length = 3; array1.push(4); var array2 = [1,2,undefined,4]; traverseArray(array1); traverseArray(array2); function traverseArray(array) { console.log("trying: " + array); console.log("reduce:"); array.reduce(function(prev, current, index, array) { if(current === undefined) { console.log("Found undefined"); } console.log(index+": " +current); }, undefined); console.log("for loop:") for(var i=0;i &lt; array.length;i++) { var current = array[i]; console.log(i+": " +current); } console.log(); } Output: trying: 1,2,,4 reduce: 0: 1 1: 2 3: 4 for loop: 0: 1 1: 2 2: undefined 3: 4 trying: 1,2,,4 reduce: 0: 1 1: 2 Found undefined 2: undefined 3: 4 for loop: 0: 1 1: 2 2: undefined 3: 4 Why is undefined in array1 not the same as undefined in array2 and why does the for loop act the same but reduce does not?
favorite count: 0
accepted answer: http://stackoverflow.com/a/28636280
upvote count: 2
has comment: http://stackoverflow.com/comment/45571821
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28636268
has comment: http://stackoverflow.com/comment/45571801
has answer: http://stackoverflow.com/a/28636268

http://stackoverflow.com/comment/45640511
score: 3
comment on: http://stackoverflow.com/q/28673636
has text: Show some effort, tell us what you've tried, show us the HTML at least etc.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45534388
comment on: http://stackoverflow.com/q/28615068
has text: @jgillich there's no additional development cost. Minifiers will shorthen them when IIFE is used. Not otherwise.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28598510
tagged with: javascript
answer count: 2
tagged with: turbolinks
downvote count: 0
has answer: http://stackoverflow.com/a/28639298
favorite count: 0
has body: See Update 3 for the latest state. I'm getting the error "Tried to register widget with id==contact-form but that id is already registered" from my dojo script. This issue has come up before here. I believe my situation may be different. I get the error when I go from one page on my site to another. All pages have the same script. If I reload a page, I don't get the error. If I go to another web site and then come back, I don't get the error. My site used to use the Symfony framework. I just converted it to Ruby on Rails. I'm pretty sure I didn't have this problem with Symfony, but I'm not positive. I just changed my name servers to the new version this morning so I can't verify. The site is amcolan.info. If you follow the link, it should work fine on the first page. Hoover over the image to test. It should enlarge. This is the script where the widget is instantiated: require(["dojo/dom", "dojo/request", "dojo/dom-form", "dijit/Dialog", "dijit/form/Form", "dijit/form/TextBox", "dijit/form/ValidationTextBox", "dijit/form/Textarea", "dijit/form/Button", "dojox/validate/web", "dojo/domReady!"], function(dom, request, domForm, Dialog, Form, TextBox, ValidationTextBox, TextArea, Button ){ alertDialog = new Dialog({ title: "Email Result", content: " No Content ", sytle: "width: 50em" }); emailDialog = new Dialog({ title: "Email Form", content: dom.byId("emailFormHTML").textContent, style: "width: 50em" }); emForm = new Form({ },"contact-form"); toText = new TextBox({ name: "addressee", readOnly: "readOnly", value: "Staff" },"to"); nameText = new ValidationTextBox({ name: "name", placeholder: "Your Name", required: "true", missingMessage: "We'd like to know who you are." },"name"); emailText = new ValidationTextBox({ name: "email", placeholder: "Your email", validator: dojox.validate.isEmailAddress, invalidMessage: "This is not a valid email address!" },"email"); messageText = new TextArea({ name: "message", placeholder: "Your message" },"message"); sendBtn = new Button({ …
tagged with: dojo
type: AnsweredQuestion
has title: Javascript Not Executing When Web Page Loaded from Cache
has answer: http://stackoverflow.com/a/28618292
score: 1
accepted answer: http://stackoverflow.com/a/28639298
upvote count: 1
tagged with: ruby-on-rails
type: Question
possible better answer: http://stackoverflow.com/a/28618292

http://stackoverflow.com/comment/45628197
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28666690
type: Comment
has text: Thank you for your response. The event I'm actually listening for in my app is a window resize. Would I use a directive for that, like @Josh Beam recommends?

http://stackoverflow.com/q/28619984
has comment: http://stackoverflow.com/comment/45542566
has comment: http://stackoverflow.com/comment/45542591
type: UnansweredQuestion
type: Question
tagged with: safari
tagged with: forms
has title: .JS form not working on Safari
has body: I have a form in an iframe that submits information to an MLS IDX and shows the properties. The form works great on Chrome and Mozilla, but when using Safari it just reloads the page in a new window instead of showing the results page. I copied the .js and form from the IDX website and do not know anything about .js. The page actually targets a remote .js file and also has .js on the actual page. The page is located at mariaraymer.com/test1.html Any help is appreciated. Thank you! Update 2: Noticed in Safari quickly goes to second page after submit then returns to original URL - Url of page is http://mlssearch.topproduceridx.com/system/safari.asp?url=. Page has this javscript. Page looks to be dedicated to safari as it does not go to a page like this for chrome or firefox. &lt;script language="JavaScript"&gt; window.setTimeout(function() { if (document.cookie.indexOf('test_cookie=1') &lt; 0) { var name = 'test_cookie', div = document.getElementById(name), iframe = document.createElement('iframe'), form = document.createElement('form'); iframe.name = name; iframe.src = 'javascript:false'; div.appendChild(iframe); form.action = location.toString(); form.method = 'POST'; form.target = "_parent"; div.appendChild(form); form.submit(); } else { if (location.search.indexOf('https://') &gt; 0) top.location.href = location.search.replace('?url=https://','http://'); else if (location.search.indexOf('http://') &gt; 0) top.location.href = location.search.replace('?url=http://','http://'); } }, 10); &lt;/script&gt; Update: Error in Chrome Console Uncaught ReferenceError: SwapPriceRange is not defined 3extensions::uncaught_exception_handler:8 Error in event handler for (unknown): TypeError: Cannot read property 'state' of null at CSRecorder.onQueryStateCompleted (chrome-extension://cplklnmnlbnpmjogncfgfijoopmnlemp/content_scripts/recorder.js:43:13) Moved Code around and received this error: extensions::uncaught_exception_handler:8 Error in event handler for (unknown): TypeError: …
score: 0
has answer: http://stackoverflow.com/a/28620149
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/28608250
has body: Shorter way to access : $(document).on('click', '#guardarBtn', function (event) { var content = {}; $('.rowUpdate').each(function (i) { $(this).find('input[type=text]').each(function(){ content[$(this).attr("name")] = $(this).val(); }); }); alert(JSON.stringify(content)); }); Corredor Feed Id Corrdor Nombre Email Empressa Pagina Web Telefono Cellular
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28607669

http://stackoverflow.com/a/51122925
score: 1
upvote count: 1
has body: Try this- https://electronjs.org/ Build cross platform desktop apps with JavaScript, HTML, and CSS. With Electron, creating a desktop application for your company or idea is easy. Initially developed for GitHub's Atom editor, Electron has since been used to create applications by companies like Microsoft, Facebook, Slack, and Docker.
downvote count: 0
answers question: http://stackoverflow.com/q/28675738
type: Answer

http://stackoverflow.com/a/28617791
has comment: http://stackoverflow.com/comment/45538902
score: 4
has body: You could listen to the input event of the contenteditable element and then split the text and output the length of the array: .trim() removes whitespace at the beginning/end of the string. .replace(/\s+/g, ' ') removes consecutive whitespace so that it isn't counted as an additional word. .split(' ') splits the string at the whitespace so that the count can be retrieved. As Andreas points out in the comments, you could also split/match the text using word boundaries (/\b/) so that entities like dashes are excluded. $('#text').on('input', function () { var text = this.textContent, count = text.trim().replace(/\s+/g, ' ').split(' ').length; $('.words').text(count); }); Text Without jQuery: document.getElementById('text').addEventListener('input', function () { var text = this.textContent, count = text.trim().replace(/\s+/g, ' ').split(' ').length; document.querySelector('.words').textContent = count; }); Text
upvote count: 4
accepted answer of: http://stackoverflow.com/q/28617680
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28617680

http://stackoverflow.com/comment/45631174
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28668204
has text: Then You didn't see my question properly. I have already written more code that your answer.

http://stackoverflow.com/comment/45724224
comment on: http://stackoverflow.com/q/28717819
type: Comment
score: 0
type: QuestionComment
has text: I've found [envify](https://www.npmjs.com/package/envify-loader) but I'm having a hard time configuring it.

http://stackoverflow.com/q/28714033
type: Question
has title: Create subtotal and total amount with jquery based on input text qty
tagged with: javascript
has answer: http://stackoverflow.com/a/28714420
answer count: 2
has comment: http://stackoverflow.com/comment/45717224
upvote count: 0
possible better answer: http://stackoverflow.com/a/28714317
tagged with: jquery
has answer: http://stackoverflow.com/a/28714317
favorite count: 0
has comment: http://stackoverflow.com/comment/45716279
has body: actually how to automatically calculate the 'subtotal'and 'Total Amount' based on qty ( input boxes ) that had a spinner, i am new to js with calculate function, so any advice will be appreciated Thanks Fiddle Here &lt;div class="table-responsive" id="bottom-table"&gt; &lt;table class="table table-striped"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;No&lt;/th&gt; &lt;th&gt;Part Number&lt;/th&gt; &lt;th&gt;Desc&lt;/th&gt; &lt;th&gt;Qty / Unit&lt;/th&gt; &lt;th&gt;Qty Needed&lt;/th&gt; &lt;th&gt;Het ( Rp )&lt;/th&gt; &lt;th&gt;Estimation Price&lt;/th&gt; &lt;th&gt;&amp;nbsp;&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;3DCam01&lt;/td&gt; &lt;td&gt;3D Camera&lt;/td&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;&lt;input class="spinner" value="1" readonly="readonly"&gt;&lt;/td&gt; &lt;td&gt;$1500.00&lt;/td&gt; &lt;td&gt;&lt;p class="subtotal"&gt;&lt;/p&gt;Subtotal&lt;/td&gt; &lt;td&gt;&lt;a href="index.php?action=remove&amp;code=3DCam01" class="btnRemoveAction"&gt;Delete&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;2&lt;/td&gt; &lt;td&gt;USB02&lt;/td&gt; &lt;td&gt;External Hard Drive&lt;/td&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;&lt;input class="spinner" value="1" readonly="readonly"&gt;&lt;/td&gt; &lt;td&gt;$800.00&lt;/td&gt; &lt;td&gt;Subtotal&lt;/td&gt; &lt;td&gt;&lt;a href="index.php?action=remove&amp;code=USB02" class="btnRemoveAction"&gt;Delete&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;3&lt;/td&gt; &lt;td&gt;wristWear03&lt;/td&gt; &lt;td&gt;Wrist Watch&lt;/td&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;&lt;input class="spinner" value="1" readonly="readonly"&gt;&lt;/td&gt; &lt;td&gt;$300.00&lt;/td&gt; &lt;td&gt;Subtotal&lt;/td&gt; &lt;td&gt;&lt;a href="index.php?action=remove&amp;code=wristWear03" class="btnRemoveAction"&gt;Delete&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;Total&lt;/td&gt; &lt;td&g…
accepted answer: http://stackoverflow.com/a/28714420
score: -1
type: AnsweredQuestion
downvote count: 1
has comment: http://stackoverflow.com/comment/45716246

http://stackoverflow.com/a/28977729
answers question: http://stackoverflow.com/q/28662624
downvote count: 0
has body: Just a note...as of v0.13. componentDidMount() may not yet have this.refs available. From the changelog: ref resolution order has changed slightly such that a ref to a component is available immediately after its componentDidMount method is called; this change should be observable only if your component calls a parent component's callback within your componentDidMount, which is an anti-pattern and should be avoided regardless
type: Answer
upvote count: 2
score: 2

http://stackoverflow.com/q/28651504
has answer: http://stackoverflow.com/a/28651558
has body: (function(){ function byId(id) { return document.getElementById(id); } byId('submit').onclick = function() { ((more code here.....)) }; })(); when I remove the function that wraps the rest of the code inside, then the script does not work. Could any kind person explain to me what does that anonymous function at the top? Why the script does not work without it?
tagged with: javascript
has title: JavaScript, what does immediately invoked function in this particular case?
possible better answer: http://stackoverflow.com/a/28651554
score: 0
accepted answer: http://stackoverflow.com/a/28651558
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28651554
answer count: 2

http://stackoverflow.com/q/28650017
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: web-audio-api
has answer: http://stackoverflow.com/a/28650703
type: UnansweredQuestion
tagged with: google-chrome
has title: Use the HTML5 web MIDI API
has body: I'm trying to make a simple synth web-app using the web audio API and I want to use it with my MIDI keyboard through the web MIDI API, so I tried these instructions both on Chrome and Chrome Canary but always I get the "navigator.getMIDIAccess is not a function" error, the version is 40 for Chrome and 42 for Chrome Canary, both on Mac OS X (10.10.2) and the experimental flag has been enabled. The code for now is very simple (this is a test): &lt;script type="text/javascript"&gt; try{ //navigator.getMIDIAccess = ( navigator.getMIDIAccess || navigator.webkitGetMIDIAccess || navigator.mozGetMIDIAccess || navigator.msGetMIDIAccess); navigator.getMIDIAccess(_event_success, function(){ alert("ERROR"); }); }catch(ex){ console.log(ex); alert("NOT SUPPORTED"); } function _event_success(){ console.log("OK"); } &lt;/script&gt; Where is the error? If may be helpful I'm using a M-AUDIO Keystation88 keyboard on USB. Is Chrome the only one that suport this feature?
type: Question
tagged with: javascript
score: 0
tagged with: web-midi

http://stackoverflow.com/comment/45774171
score: 1
type: Comment
has text: Then `/^[1-9][0-9]*$/` is the answer.
comment on: http://stackoverflow.com/a/28745715
type: AnswerComment

http://stackoverflow.com/comment/45659780
comment on: http://stackoverflow.com/q/28683361
type: Comment
score: 0
has text: You can use `aVar = Object.keys( window )` to get the list of defined and then filter if the values match
type: QuestionComment

http://stackoverflow.com/a/28746009
upvote count: 4
answers question: http://stackoverflow.com/q/28745862
downvote count: 0
type: Answer
has body: It's because there is no default action to prevent. Prevent default will work on anchor tags, which are used to prevent the default behaviour. What you want to do is to stop the propagation of the click, so it doesn't bubble up from the inner div. That way, if you click on the inner div, only the inner div click fires. Replace your event.preventDefault() with event.stopPropagation().
score: 4

http://stackoverflow.com/q/28715663
type: Question
has answer: http://stackoverflow.com/a/28715842
accepted answer: http://stackoverflow.com/a/28715842
tagged with: javascript
tagged with: jquery
tagged with: asp.net
has comment: http://stackoverflow.com/comment/45718967
score: 0
has body: I have a repeater inside of which I have some controls one of which is a textbox. I am trying to get the textbox with jquery, my code looking like this: $("#&lt;%= ((TextBox)myRpt.FindControl("tbText")).ClientID %&gt;").click(function (event) {}); but I always get a nullReferenceException. Anyone has any idea what could cause this? The repeater looks similar to this: &lt;asp:Repeater ID="myRpt" runat="server" onitemdatabound="myRpt_ItemDataBound"&gt; &lt;HeaderTemplate&gt; &lt;/HeaderTemplate&gt; &lt;ItemTemplate&gt; /*some controls*/ &lt;td id="tdX" runat="server"&gt; &lt;asp:TextBox ID="tbText" runat="server" ClientIDMode = "Static"&gt;&lt;/asp:TextBox&gt; &lt;/td&gt; &lt;/ItemTemplate&gt; &lt;/asp:Repeater&gt;
answer count: 1
type: AnsweredQuestion
has title: ClientId causes NullReferenceException

http://stackoverflow.com/a/28677878
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28676750
has body: So the Answer for my question came from @Donte'Trumble. CSS code: .info_button { width: 220px; height: 300px; position: absolute; overflow: hidden; margin-right: 0; border-radius: 10px; -o-border-radius: 10px; -ms-border-radius: 10px; -webkit-border-radius: 10px; background: url(http://i.imgur.com/DkdX4Ci.jpg); background-repeat: no-repeat; background-position: 0 0; box-shadow: 3px 3px 20px #363024; } .info_button > header { position: absolute; bottom: 0; left: 0; width: 100%; padding: 20px 10px; background: inherit; background-attachment: fixed; overflow: hidden; } .info_button > header1::before { content: ""; position: absolute; top: -20px; left: 0; width: 100%; background: inherit; background-attachment: fixed; -webkit-filter: blur(4px); filter: blur(4px); } .info_button > header::after { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5) } .info_button > header p { margin: 0; color: white; position: relative; z-index: 0; } .info_button:hover{ box-shadow: 1px 1px 5px #363024; -webkit-box-shadow: 1px 1px 5px #363024; -moz-box-shadow: 1px 1px 5px #363024; position:relative; top:7px; margin: 0; } HTML: BoilerPlate of my Mansion Working fiddle: http://jsfiddle.net/veniarya/ygosqouh/ The problem was with my z-index, have to make it a positive interger, so changed it to 100 from 0, thanks again @Donte'Truble.

http://stackoverflow.com/comment/45755426
has text: it is getting the image but its not getting the string !! imageUrl="url(http://www.coolgraphic.org/wp-content/uploads/2011/08/01.gif)"; if i assign this to backgroundImage its working!!
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28734718
type: Comment

http://stackoverflow.com/q/28611520
score: 0
answer count: 1
tagged with: facebook-graph-api
tagged with: facebook
has title: Facebook blank page after login Javascript
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28611724
has body: My code: $(document).ready(function() { $.ajaxSetup({ cache: true }); $.getScript('https://connect.facebook.net/en_UK/all.js', function() { FB.init({ appId: 'xxxxxxxxxxx', status: true, cookie: true, xfbml: true}); FB.getLoginStatus(function (response){ if(response.status==='connected') { load(response); } else { FB.login(function(response) { if (response.authResponse) { $(".load").html('Welcome! Fetching your information.... '); FB.api('/me', function(response) { $(".load").html('Good to see you, ' + response.name + '.'); load(response); }); } else { $(".load").html('User cancelled login or did not fully authorize.'); } }); } }); }); }); The Login dialog popups correctly, but after login it goes to a blank page <a href="https://www.facebook.com/v2.2/dialog/oauth?redirect_uri=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter%2FDU1Ia251o0y.js%3Fversion%3D41%23cb%3Df246e4d89fef184%26domain%3Dlocalhost%26origin%3Dhttp%253A%252F%252Flocalhost%252Ffeb48fe70fe9c%26relation%3Dopener%26frame%3Df1092c4e4c168ce&amp;display=popup&amp;response_type=token%2Csigned_request&amp;domain=localhost&amp;client_id=xxxxxxxxxxx&amp;ret=login&amp;sdk=joey&amp;ext=1424366134&amp;hash=AeaJ_v2XTa9paggktPU" rel="nofollow">https://www.facebook.com/v2.2/dialog/oauth?redirect_uri=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter%2FDU1Ia251o0y.js%3Fversion%3D41%23cb%3Df246e4d89fef184%26domain%3Dlocalhost%26origin%3Dhttp%253A%252F%252Flocalhost%252Ffeb48fe70fe9c%26relation%3Dopener%26frame%3Df1092c4e4c168ce&amp;display=popup&amp;response_type=token%2Csigned_request&amp;domain=localhost&amp;client_id=xxxxxxxxxxx&amp;ret=login&amp;sdk=joey&amp;ext=1424366134&amp;hash=AeaJ_v2XTa9paggktPU It does not close, i am working on a localhost and using Mozilla Firefox. Things i noted: User is logged in. If popup closed then it does call back function
type: Question
has answer: http://stackoverflow.com/a/28611724
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28633500
has comment: http://stackoverflow.com/comment/45566957
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28633609
has body: I have the following HTML and JS List item 1 List item 2 List item 3 The list items are in the a tag so that the entire list item is clickable. Given certain conditions, I'm trying to use jQuery to hide certain list items. It worked fine before I wrapped them all in a tags, but now I can't get them to hide. jQuery(".tab-menu .tabs > li:nth-child(3)").hide(); I've tried every variation I can think of to get the JS to recognize the list item it needs to hide, but I can't find it. Can I get some insight?
possible better answer: http://stackoverflow.com/a/28633536
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28633536
has answer: http://stackoverflow.com/a/28633565
has title: Hiding nth child inside link tag
score: 0
has answer: http://stackoverflow.com/a/28633682
has answer: http://stackoverflow.com/a/28633539
favorite count: 0
has comment: http://stackoverflow.com/comment/45566939
answer count: 5
accepted answer: http://stackoverflow.com/a/28633565
tagged with: css
has comment: http://stackoverflow.com/comment/45567072
type: AnsweredQuestion

http://stackoverflow.com/a/28739746
answers question: http://stackoverflow.com/q/28739198
score: 0
type: Answer
has body: I would suggest you do something like this: var $list = $("&lt;ul id='question-form' class='list'&gt;"); var json = { afwerken:["one","two"], communicatie:["one","two"], }; $.each(json,function(_idx, _value){ var liList = $.map(_value,function(_name){ var li = $("&lt;li&gt;"); li.attr("data-category",_idx); li.text(_name); return li }) //I think this could be done nicer, without building an extra loop? $.each(liList,function(_idx, _li){ $list.append(_li) }); }); console.log($list)

http://stackoverflow.com/comment/45634674
type: AnswerComment
comment on: http://stackoverflow.com/a/28670306
type: Comment
has text: How to re-initiate the draggable function?
score: 0

http://stackoverflow.com/q/28679790
accepted answer: http://stackoverflow.com/a/28680807
tagged with: portlet
answer count: 1
tagged with: jsp
tagged with: javascript
has title: Action mapping triggers wrong method in a controller
tagged with: spring
type: AnsweredQuestion
has body: I have following problem. I'm trying to handle two different action mapping in a controller. One is trigger when a button is pressed and second when a link is being clicked. Unfortunately both action trigger "buttonAction". I don't know how to force link to trigger "linkAction". Here is my code: Jsp: &lt;portlet:actionURL name="buttonAction" var="buttonActionUrl" &gt;&lt;/portlet:actionURL&gt; &lt;portlet:actionURL name="linkAction" var="linkActionUrl"&gt;&lt;/portlet:actionURL&gt; &lt;form:form id="form" modelAttribute="model" method="POST" action="${buttonActionUrl}"&gt; &lt;a id="link" href="#" onclick="linkClick();"&gt;&lt;/a&gt; &lt;button id="button" onclick="buttonClick();" type="submit"&gt;&lt;/button&gt; &lt;/form:form&gt; Javascript: function linkClick() { window.location = '${ linkActionUrl }'; } function buttonClick() { $('#form').submit(); } Java; @ActionMapping("buttonAction") public void buttonAction(@ModelAttribute("model") Model model, BindingResult result, ActionRequest request, ActionResponse response, ModelMap modelMap) { } @ActionMapping("linkAction") public void linkAction(@ModelAttribute("model") Model model, BindingResult result, ActionRequest request, ActionResponse response, ModelMap modelMap) { }
has answer: http://stackoverflow.com/a/28680807
type: Question
tagged with: java
score: 0

ruby-on-rails
tags question: http://stackoverflow.com/q/28711129
tags question: http://stackoverflow.com/q/28681971
type: Tag
tags question: http://stackoverflow.com/q/28647614
tags question: http://stackoverflow.com/q/28630789
tags question: http://stackoverflow.com/q/28602561
tags question: http://stackoverflow.com/q/28653994
tags question: http://stackoverflow.com/q/28657038
tags question: http://stackoverflow.com/q/28640218
tags question: http://stackoverflow.com/q/28644840
tags question: http://stackoverflow.com/q/28646112
tags question: http://stackoverflow.com/q/28609744
tags question: http://stackoverflow.com/q/28636498
tags question: http://stackoverflow.com/q/28725815
tags question: http://stackoverflow.com/q/28666826
tags question: http://stackoverflow.com/q/28635566
tags question: http://stackoverflow.com/q/28660324
tags question: http://stackoverflow.com/q/28658621
tags question: http://stackoverflow.com/q/28712969
tags question: http://stackoverflow.com/q/28598510
tags question: http://stackoverflow.com/q/28617332
tags question: http://stackoverflow.com/q/28701327
tags question: http://stackoverflow.com/q/28632345
tags question: http://stackoverflow.com/q/28687937
tags question: http://stackoverflow.com/q/28605234
tags question: http://stackoverflow.com/q/28726021
tags question: http://stackoverflow.com/q/28704253
tags question: http://stackoverflow.com/q/28722802
tags question: http://stackoverflow.com/q/28696685
tags question: http://stackoverflow.com/q/28617648
tag name: ruby-on-rails
tags question: http://stackoverflow.com/q/28612481
tags question: http://stackoverflow.com/q/28669769
tags question: http://stackoverflow.com/q/28641996
tags question: http://stackoverflow.com/q/28652308
tags question: http://stackoverflow.com/q/28709164
tags question: http://stackoverflow.com/q/28648550
tags question: http://stackoverflow.com/q/28699732
tags question: http://stackoverflow.com/q/28621179
tags question: http://stackoverflow.com/q/28712125
tags question: http://stackoverflow.com/q/28637818
tags question: http://stackoverflow.com/q/28723761
tags question: http://stackoverflow.com/q/28698845
tags question: http://stackoverflow.com/q/28682685
tags question: http://stackoverflow.com/q/28621624
tags question: http://stackoverflow.com/q/28612083
tags question: http://stackoverflow.com/q/28668918
tags question: http://stackoverflow.com/q/28688473
tags question: http://stackoverflow.com/q/28655298
tags question: http://stackoverflow.com/q/28707115
tags question: http://stackoverflow.com/q/28698526
tags question: http://stackoverflow.com/q/28619731
tags question: http://stackoverflow.com/q/28651743
tags question: http://stackoverflow.com/q/28657846
tags question: http://stackoverflow.com/q/28709797
tags question: http://stackoverflow.com/q/28747609
tags question: http://stackoverflow.com/q/28632568

http://stackoverflow.com/q/28612043
score: 0
answer count: 2
tagged with: jquery
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28612227
type: Question
has body: When trying to toggle between a grid and list view for data, our custom directive built to add and remove an .active class to the selected tag will only add to the list element when the list element is clicked twice. The grid element's class add and remove works fine. I can't figure out where the flaw is coming from since grid and list are built the same. Notice, the grid view has active as default, but I've played around with removing it or setting the list as active by default, and neither affects the issue. toggle.html: custom directive: 'use strict'; angular.module('appApp') .directive('viewToggle', function (analysisFactory) { return { templateUrl: 'views/directives/toggle.html', restrict: 'EA', scope:{}, link: function (scope, element, attrs) { scope.gotoGrid = function(){ angular.element( element[0].querySelector('.goto-grid') ).addClass('active'); angular.element( element[0].querySelector('.goto-list') ).removeClass('active'); }; scope.gotoList = function(){ angular.element( element[0].querySelector('.goto-grid') ).removeClass('active'); angular.element( element[0].querySelector('.goto-list') ).addClass('active'); }; } }; });
tagged with: javascript
has title: Element must be clicked twice to addClass (custom directive)
has answer: http://stackoverflow.com/a/28612230

http://stackoverflow.com/a/28603893
accepted answer of: http://stackoverflow.com/q/28603765
answers question: http://stackoverflow.com/q/28603765
score: 0
type: AcceptedAnswer
has body: You need to do item[0] because item is also an array of length 1. for(var i = 0; i &lt; data.length; i++) { data[i].infoType.forEach(function(item) { console.log(item[0]); }) } Working Fiddle
type: Answer

http://stackoverflow.com/a/28628352
upvote count: 1
has comment: http://stackoverflow.com/comment/45557069
accepted answer of: http://stackoverflow.com/q/28628191
answers question: http://stackoverflow.com/q/28628191
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45557390
type: Answer
has comment: http://stackoverflow.com/comment/45669380
has body: I think you should place var filteritems= $filter('applySfotwareFilter')($scope.sitesInfo); inside your success function; What happens is the filtering starts before your data is ready.
score: 1

http://stackoverflow.com/q/28704093
tagged with: javascript
type: UnansweredQuestion
has title: How can I keep a d3 mouseover open while my mouse is over the tooltip?
score: 3
downvote count: 0
favorite count: 0
has body: I have a d3 scatterplot. I have a tooltip which shows when I mouseover a point. I want to do two things. 1) I want the mouseover to stay open as long as my mouse is either over the point or the tooltip. 2) I want to put a clickable link in the tooltip. I believe that #1 is required in order to make this work. How can I do this? Here is my code: https://github.com/laran/eisenhower/blob/master/components/plot/scatterplot.js
type: Question
tagged with: d3.js
answer count: 2
has answer: http://stackoverflow.com/a/28705838
upvote count: 3
has answer: http://stackoverflow.com/a/28705388

http://stackoverflow.com/q/28626961
has title: Escape special chars with their entities
tagged with: datatable
type: UnansweredQuestion
has body: I have small requirement for escaping the special chars with respective entities, but I'm stuck with apostrophe and backslash symbols, showing error like incorrect syntax. and I'm using Datatables version 1.9. { "fnRender": function ( o, val ) { return String(val) .replace(/&amp;/g, '&amp;amp;') .replace(/"/g, '&amp;quot;') .replace(/'/g, '&amp;#39;') .replace(/&lt;/g, '&amp;lt;') .replace(/&gt;/g, '&amp;gt;') .replace(/'/g, '&amp;apos;') .replace(/\/g, '&amp;bsol'); }, Could any one help me? Thanks.
has answer: http://stackoverflow.com/a/28627560
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28627287
score: 0

http://stackoverflow.com/a/28629876
type: Answer
answers question: http://stackoverflow.com/q/28629758
score: 2
has comment: http://stackoverflow.com/comment/45560476
has body: I would hazard a guess that you aren't including {{ form.media }} in the &lt;head&gt; of your template. Django-Tinymce requires very little overhead to get working, so add the above and it should work fine.
downvote count: 0
upvote count: 2

http://stackoverflow.com/q/28646418
type: Question
linked to: http://stackoverflow.com/q/28514539
tagged with: c#
has comment: http://stackoverflow.com/comment/45590968
has comment: http://stackoverflow.com/comment/45590688
tagged with: asp.net-mvc
tagged with: javascript
upvote count: 2
has comment: http://stackoverflow.com/comment/45590825
accepted answer: http://stackoverflow.com/a/28647582
has body: I am doing Ajax requests to server in following way: App Setup: var appRoot = angular.module('demoApp', ['ngRoute', 'ngResource']); appRoot.config(['$routeProvider', function($routeProvider) { $routeProvider .when('/', { templateUrl: '/ngPartials/_Login.html', controller: 'LoginCtrl' }) .otherwise({ redirectTo: '/ngPartials/_Login.html', controller: 'LoginCtrl' }); } ]); Factory: appRoot.factory('LoginResource', function ($http) { var loginResource = { response:{}, get: function (param) { $http.get('/Login/Login', param). success(function (data, status, headers, config) { this.response = data; }). error(function (data, status, headers, config) { alert('error'); }); } } return loginResource; }); Controller: appRoot.controller('LoginCtrl', function ($scope, LoginResource) { //Make a get request on login resource $scope.User = LoginResource.get( { Role: val, Email_Id: $scope.Email, Pwd: $scope.Password }, function (response) { //do someting in callback function }); }); But I don't know what wrong I am doing in above code, the parameters (Role,Email_Id,Pwd) are not being binded to my server Action method when I do get request to it. The method is hit properly but the model values are not being binded. server side model: public class LoginModel { public string Role { get; set; } public string Email_Id { get; set; } public string Pwd { get; set; } public bool IsEmailValidation { get; set; } } Action method: [HttpGet, ActionName("Login")] public JsonResult Login(LoginModel oLogin) { ... } When I call above action method from angular, the method is being hit, but all the properties in the object oLogin are null. What going wrong with my above code? EDIT: Previously instead of $http, I was using $resource as follows and everything was working exactly fine. appRoot.factory('LoginResource', function ($resource) { return $resource('/Login/Login'); });
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45590570
favorite count: 0
tagged with: ajax
tagged with: angularjs
has answer: http://stackoverflow.com/a/28647582
has title: Unable to send parameters to server action method using angularjs $http request
has comment: http://stackoverflow.com/comment/45592485
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/45592334

http://stackoverflow.com/comment/45521625
comment on: http://stackoverflow.com/a/28597264
has text: is there anything I can do without using those plugins? isn't there something simple I can add to have that implementation?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28692237
type: Question
accepted answer: http://stackoverflow.com/a/28692447
answer count: 1
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Moving a div on the left, other on right of one div
favorite count: 0
has answer: http://stackoverflow.com/a/28692447
upvote count: 1
type: AnsweredQuestion
has body: I am working on this scrollable tabs using jquery. It's working fine but the only problem i am facing is the position of the two arrow divs. They both are float:left but somehow coming stacked together on the right of the main tab container. Both of these divs are being created on run time. My desired positions of these two arrow divs is: left arrow div on the start (before tabs) and the right arrow div on the end (after tabs). Any help or suggestion will be welcomed. JQuery code is below but to see it working, go here: JSFiddle (function ($) { var settings = { barheight: 38 } $.fn.scrollabletab = function (options) { var ops = $.extend(settings, options); var ul = this.children('ul').first(); var ulHtmlOld = ul.html(); var tabBarWidth = $(this).width() - 60; ul.wrapInner('&lt;div class="fixedContainer" style="height: ' + ops.barheight + 'px; width: ' + tabBarWidth + 'px; overflow: hidden; float: left;"&gt;&lt;div class="moveableContainer" style="height: ' + ops.barheight + 'px; width: 5000px; position: relative; left: 0px;"&gt;&lt;/div&gt;&lt;/div&gt;'); ul.append('&lt;div style="width: 20px; float: left; height: ' + (ops.barheight - 2) + 'px; margin-left: 5px; margin-right: 0;"&gt;&lt;/div&gt;'); var leftArrow = ul.children().last(); leftArrow.button({ icons: { secondary: "ui-icon ui-icon-carat-1-w" } }); leftArrow.children('.ui-icon-carat-1-w').first().css('left', '2px'); ul.append('&lt;div style="width: 20px; float: left; height: ' + (ops.barheight - 2) + 'px; margin-left: 1px; margin-right: 0;"&gt;&lt;/div&gt;'); var rightArrow = ul.children().last(); rightArrow.button({ icons: { secondary: "ui-icon ui-icon-carat-1-e" } }); rightArrow.children('.ui-icon-carat-1-e').first().css('left', '2px'); var moveable = ul.find('.moveableContainer').first(); leftArrow.click(function () { var offset = tabBarWidth / 6; var currentPosition = moveable.css('left').replace('px', '') / 1; if (currentPosition + offset &gt;= 0) { moveable.stop().animate({ left: '0' }, 'slow'); } els…

http://stackoverflow.com/q/28698593
has answer: http://stackoverflow.com/a/28698998
has title: Creating a Profit Calculator
tagged with: calculator
has comment: http://stackoverflow.com/comment/45687924
has answer: http://stackoverflow.com/a/28698747
has body: I'm trying to create a basic profit calculator but I am struggling with one issue. I've written some basic javascript and the formula almost works. However my issue is that the decimal point doesn't seem to want to work properly. For example: What is the case cost: 2.80 How may units per case: 2 What is the sell price: 3.15 Total Profit = 1.75 Profit should of course be, 0.175 I'm a complete newbie to JavaScript so your help would be much appreciated. What is the case cost? How many packs / units per case? What is the sell price? Total profit £: document.getElementById('profitCalculator').onclick = function () { var casecost = this.elements['casecost'].value || 0; var packs = this.elements['packs'].value || 0; var sell_price = this.elements['sell_price'].value || 0; var profit = sell_price - casecost / packs; this.elements['profit'].value = profit.toFixed(2); } Thanks
linked to: http://stackoverflow.com/q/588004
has answer: http://stackoverflow.com/a/28698839
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45759769
has answer: http://stackoverflow.com/a/28699109
possible better answer: http://stackoverflow.com/a/28698839
type: Question
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28698747

http://stackoverflow.com/comment/45655262
has text: @AliAdravi - you will end up being limited by available memory on devices like phones. The theoretical limit is probably related to the amount of virtual memory the underlying OS can handle, but the practical limit is real and will be related to how much RAM is available per page on the smallest device you want to run on.
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28681168

http://stackoverflow.com/q/28608548
tagged with: jquery
has title: Krajee file-input widget 'upload' method throws exception
has body: I am using fileinput widget form krajee: http://plugins.krajee.com/file-input What I am doing wrong using 'upload' method ? When I upload files by pressing upload button everything works great. But when try to use upload method like this: $( '#projectFiles' ).fileinput( 'upload' ); I get an error: Uncaught TypeError: Cannot read property 'undefined' of undefined in line 989. I checked this is this line: formdata.append(self.uploadFileAttr, files[i]); and files are undefined there. So what am I doing wrong? My code: [js] $( "#projectFiles" ).fileinput( { browseClass: 'btn btn-default', showPreview: true, showUpload: true, multiple: "multiple", uploadAsync: true, uploadUrl: "/home/UploadFiles" } ); function submitForm( e ) { $( '#projectFiles' ).fileinput( 'upload' ); // atach to event 'filebatchuploadsuccess' then submit rest of form } [ASP MVC view] @using( Html.BeginForm( "RequestPost", "Home", FormMethod.Post, new { id = "frmRequest", @class = "", enctype = "multipart/form-data" } ) ) { @* THE REST OF THE FORM *@ SUBMIT } thanks in advance
favorite count: 0
has answer: http://stackoverflow.com/a/41812968
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28609251
score: 1
has answer: http://stackoverflow.com/a/28947538
accepted answer: http://stackoverflow.com/a/28947538
upvote count: 1
type: Question
tagged with: asp.net-mvc
tagged with: javascript
answer count: 3
possible better answer: http://stackoverflow.com/a/28609251
downvote count: 0

http://stackoverflow.com/a/28641890
answers question: http://stackoverflow.com/q/28639649
has body: Change event of an input widget is triggered only by user action. DOM elements work in the same way. If you need to trigger an event manually use the trigger method. $("#dateFromFilter").data("kendoDatePicker").trigger("change"); Demo: http://jsfiddle.net/q5xoyhx9/24/ This is not a bug this is by design Input Widgets do not raise change event when API is used http://docs.telerik.com/kendo-ui/troubleshooting
type: AcceptedAnswer
downvote count: 0
score: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/28639649
upvote count: 2

http://stackoverflow.com/comment/45596572
comment on: http://stackoverflow.com/q/28648766
has text: dobdye, the json data is taken from here:http://pastebin.com/raw.php?i=7X956uB3
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45658006
comment on: http://stackoverflow.com/q/28681691
score: 0
type: Comment
type: QuestionComment
has text: @SpencerWieczorek Please add your solution as a formal answer so it can be upvoted and (hopefully) selected as the accepted answer.

http://stackoverflow.com/a/28645765
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28631053
has comment: http://stackoverflow.com/comment/45590850
has comment: http://stackoverflow.com/comment/45676433
has comment: http://stackoverflow.com/comment/45634225
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28631053
has body: It can be done. The logic behind your script however is totally wrong. Let me explain: What gonna happen if someone attempt to remove the main instance (#preacq) that has to be cloned? What if someone want o clone the instance where the "clone" button is attached to (otherwise why to place "clone" button inside each instance but copy the main)? Dealing with id's is overkill for that purposes. The main instance include elements with their own id attributes (like: select id="glListName0"). Therefore number of elements with the same id is increased each time you clone the main instance. Keep in mind that the id of each DOM element must be unique Since each instance has "clone" and "remove" buttons, the clone instance should be attached right after the instance that has been cloned, not at the end of the list (otherwise - once again - why to place "clone" button inside each instance?). Clicking "delete" button in main instance, you're reducing cloneCount but not deleting any elements, since it has no number attached to its id attribute but has active "delete" button. The answer provided by @imsheth is somehow correct. You should definitely avoid dealing with id's when comes to .clone() and use scenario where you could operate on classes and use "parental" style selectors. Otherwise, you have to care about each element id inside cloned instance. Why your script does not remove the instance you want? Each time you press "clone" button, the cloneCount value gets increased by 1.: function addMore() { $("#preacq").clone().attr('id', 'preacq'+ cloneCount++).appendTo("#addMoreDiv"); // say, you cloned instance 5 times, so the "cloneCount" value is now 5 } When comes to delete, you're actually checking the latest value of cloneCount (which actually represents also the latest created element): function removeMI(){ // because you've created 5 elements, the current "cloneCount" value is 5: $("#preacq" + cloneCount).remove(); // the above will delete "#preacq5" element, which is th…
has comment: http://stackoverflow.com/comment/45668804

http://stackoverflow.com/comment/45552151
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28625344
type: QuestionComment
has text: script is wrong be clear with your requirements

http://stackoverflow.com/q/28687526
tagged with: javascript
has answer: http://stackoverflow.com/a/28691154
tagged with: google-maps-api-3
has comment: http://stackoverflow.com/comment/45668317
has title: Detecting waypoints in google maps
score: 0
has body: I just want to ask if this is possible in google map v3.I created a marker serve as my waypoints in directions and save those coordinates in my database. my concern for this is. Is it possible to detect one of my vehicle which I set for his waypoints and will know if he passes or not in that waypoints that I created ? just like this example created @geocodezip,with mulitple waypoints Multiple waypoints I want to detect the vehicle if he passes or not in that waypoints. Thank you in advance.
tagged with: google-maps
answer count: 1
has comment: http://stackoverflow.com/comment/45670415
favorite count: 0
has comment: http://stackoverflow.com/comment/45667482
accepted answer: http://stackoverflow.com/a/28691154
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45669797
type: AnsweredQuestion

http://stackoverflow.com/q/28700609
has title: (Bootstrap) Responsive image over button on hover?
type: Question
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: css
has answer: http://stackoverflow.com/a/28700828
has body: I am trying to have an image show up over a button while hovering. I know that for Bootstrap, I can add the .img-responsive class while declaring the image in the HTML, but I cant seem to get it working properly with how I was trying to load the images. The buttons themselves are already responsive. I was using a couple blocks of CSS and preloading the images through the CSS. Whats the best way to go about this? Also, is there a way to add some sort of animation to show the image? Like have the image scroll up from the bottom of the button?
tagged with: twitter-bootstrap-3
has comment: http://stackoverflow.com/comment/45691536

http://stackoverflow.com/comment/45642717
type: QuestionComment
has text: so you set `type : 'POST'`in your ajax code? putting you code in a completed state make easier to help you
type: Comment
comment on: http://stackoverflow.com/q/28674628
score: 0

http://stackoverflow.com/comment/45567683
has text: #1: depends on how you intend to use them. #2: custom filters are an option if the base filter isn't enough. #3 nope.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28633760

http://stackoverflow.com/a/31059035
has body: Use the new npm module x-ray, with a pluggable web driver x-ray-phantom. Examples in the pages above, but here's how to do dynamic scraping: var phantom = require('x-ray-phantom'); var Xray = require('x-ray'); var x = Xray() .driver(phantom()); x('http://google.com', 'title')(function(err, str) { if (err) return done(err); assert.equal('Google', str); done(); })
has comment: http://stackoverflow.com/comment/102808152
score: 12
upvote count: 12
downvote count: 0
answers question: http://stackoverflow.com/q/28739098
has comment: http://stackoverflow.com/comment/131794556
has comment: http://stackoverflow.com/comment/69006322
has comment: http://stackoverflow.com/comment/58816085
type: Answer
has comment: http://stackoverflow.com/comment/58674375
has comment: http://stackoverflow.com/comment/89931181

http://stackoverflow.com/q/28662854
tagged with: arrays
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45620824
has comment: http://stackoverflow.com/comment/45620790
score: 1
has title: Building a Phonebook
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/45620888
has answer: http://stackoverflow.com/a/28662989
upvote count: 2
has comment: http://stackoverflow.com/comment/45620915
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45620842
has body: var search = function(lastName) { var contactsLength = contacts.length; for(var i=0; i&lt;contactsLength; i++) { if(contacts[i].lastName === lastName) { printPerson(contacts[i]); } } }; the function is set up to take a lastName from the search function and match it to the objects in a contacts array. if(contacts[i].lastName === lastName) { printPerson(contacts[i]); } this parcel is what's giving me problems. it will printPerson correctly, aka print each item of the contacts array, but it won't match the lastName from search() to the lastName in the array. this is a lesson from codeacademy . com, building a phonebook.

http://stackoverflow.com/comment/45736920
type: QuestionComment
comment on: http://stackoverflow.com/q/28686509
score: 0
has text: I didn't, though! Maybe I should have clarified that, besides `this`, the other objects available at the scope of the function call were not desirable to store a reference to the `autocomplete` instance.
type: Comment

http://stackoverflow.com/a/28603563
answers question: http://stackoverflow.com/q/28603539
has comment: http://stackoverflow.com/comment/45557678
type: Answer
has comment: http://stackoverflow.com/comment/45531020
has comment: http://stackoverflow.com/comment/45523963
has body: You can use stop() to clear the active item on the queue of an element. Stop() documentation
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28603539
has comment: http://stackoverflow.com/comment/45523915
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45531858

http://stackoverflow.com/a/28705405
has body: Doing this on the client side via Javascript has the drawback that users can hack into the code and change and make it load even though, perhaps one solution would be to treat that single line in a server side generated HTML and send it back with or without that line, for example if you are using Java and JSP you can calulcate the condition in java and store it on a configuration object like: &lt;c:if test="{myappConfig.isLiveChatEnabled eq true} //... include JS file &lt;/c:if&gt; but if you want to do it via JS you can take a look at Determine if a date is a Saturday or a Sunday using JavaScript it would help to build the conditional statement.
has comment: http://stackoverflow.com/comment/45703149
type: Answer
answers question: http://stackoverflow.com/q/28705276
has comment: http://stackoverflow.com/comment/45706444
score: 0

http://stackoverflow.com/q/28726613
accepted answer: http://stackoverflow.com/a/28737674
answer count: 1
tagged with: css
favorite count: 0
has comment: http://stackoverflow.com/comment/45759342
upvote count: 2
has title: Why is my chosen.js loupe icon in the wrong place on Retina screens?
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45739753
score: 1
tagged with: jquery-chosen
has body: I'm using chosen.js on several drop downs on the same page. Turns out, on Retina monitors the loupe sprite in the search field is misplaced (a bunch of X'es and arrows all the way to the left of the input field). The other sprites in the same drop down look OK. If I open the web inspector in Chrome and try to fiddle with the background I can't seem to move it. Nothing works. For example: Pick me! Pick me! Pick me! Pick me! Pick me! Pick me! Pick me! Pick me! .bar input { background: #fff !important; } Notice how the icon in the search field in the first select is screwed up. Here's a fiddle that demonstrates the problem. Any input is greatly appreciated.
type: Question
has answer: http://stackoverflow.com/a/28737674
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45789223
has text: I ended up using `mock-fs`. When using multiple functions from the `fs` module, I found myself mocking more and more of the `fs` module and getting to know more and more of its internals in the process. Using the library just makes more sense, here.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28733227
type: Comment

http://stackoverflow.com/q/28651032
type: Question
has title: Displaying Yesterday's Date
tagged with: javascript
score: -1
accepted answer: http://stackoverflow.com/a/28651071
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45599575
linked to: http://stackoverflow.com/q/10931288
favorite count: 0
has body: How can the following code be modified to display yesterday's date instead of today's date? For example, "Sunday, February 1, 2015", should become "Saturday, January 31, 2015". &lt;script type="text/javascript"&gt; &lt;!-- // Array of day names var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); // Array of month Names var monthNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December"); var now = new Date(); document.write(dayNames[now.getDay()] + ", " + monthNames[now.getMonth()] + " " + now.getDate() + ", " + now.getFullYear()); // --&gt; &lt;/script&gt;
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45599673
has answer: http://stackoverflow.com/a/28651071
downvote count: 1

http://stackoverflow.com/q/28676431
upvote count: 9
linked to: http://stackoverflow.com/q/1713771
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I was wondering if there's a way to detect the page zoom level which is supported by all modern browsers. I've already tried this: how-to-detect-page-zoom-level-in-all-modern-browsers but unfortunately it is not fully compatible with all the browser I tried. Is there a more general method, or a jquery library to achieve that?
tagged with: zooming
has answer: http://stackoverflow.com/a/31445818
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: css
favorite count: 0
has comment: http://stackoverflow.com/comment/136624683
has title: Detect zoom level on all modern browsers
score: 9
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/50856242
type: Question
has comment: http://stackoverflow.com/comment/92714151

http://stackoverflow.com/comment/45520037
score: 0
type: Comment
type: QuestionComment
has text: For such thing you may want to actually manually focus the div. If you can do such by following something like this: http://stackoverflow.com/questions/635706/how-to-scroll-to-an-element-inside-a-div . Once the div hiding is triggered, force the dom to scroll to the position desired. In any case, regardless how fast you are scrolling, the script will be executed and will bring you to where you want to go. The idea, to me, is: 1) triggering the div hide. 2) Disable scroll. 3) Bring the view to the hidden div position or wherever you want it to go. In this way you should be 100% sure.
comment on: http://stackoverflow.com/q/28605092

http://stackoverflow.com/comment/45632520
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28668850
has text: How about having Cordova as native app in Win 8?
type: AnswerComment

ecmascript-harmony
tag name: ecmascript-harmony
type: Tag
tags question: http://stackoverflow.com/q/28692051
tags question: http://stackoverflow.com/q/28739745

http://stackoverflow.com/q/28688311
tagged with: javascript
has body: Sometimes am getting the following error When i am running the test in Jenkins. But test is passing in local VM without this error. ERROR MESSAGE : Element being found repeatedly went stale, is it being repeatedly modified by javascript, or is it in a list of elements (see the package-info.java in WebDriverWrapper for more details)? But finding element by id is different for all the elements. But still am getting this error. Can you please anyone explain why this error occurs and what is the solution for this?
favorite count: 0
answer count: 0
tagged with: jenkins
type: UnansweredQuestion
upvote count: 1
has title: Selenium WebDriver - Element being found repeatedly went stale
score: 1
tagged with: java
tagged with: selenium
type: Question
downvote count: 0

http://stackoverflow.com/a/28723037
score: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28722737
answers question: http://stackoverflow.com/q/28722737
type: AcceptedAnswer
upvote count: 3
type: Answer
has comment: http://stackoverflow.com/comment/45734731
has body: The issue is that Socket.io does not live inside the angular lifecycle, and thus Angular doesn't know new data has come in. You're right that you need to inject $scope into your controller, and the perform a $scope.$apply() inside your socket.io callback, as the last action. $scope.$apply() lets angular know that data has updated, and to refresh what needs to be refreshed. app.controller('StoryController', ['$http', '$scope', function($http, $scope){ var story = this; socket.on('new storyPoint', function(msg){ //console.log('new storyPoint!', msg); $scope.$apply(function(){ story.points.push(msg); $('.story').scrollTop($('.story')[0].scrollHeight); console.log('last story point:', story.points[story.points.length - 1]); }); }); }]);

http://stackoverflow.com/a/28734617
downvote count: 0
has comment: http://stackoverflow.com/comment/70192371
has comment: http://stackoverflow.com/comment/70204582
has body: Docs: https://github.com/angular-ui/bootstrap/tree/master/src/modal << Contains code examples. Markup and Javascript. Start here. http://www.nganimate.org/ << This can help create an intro transition effect similar to Medium's login thing. Here's a start (Fill in the blanks, write your modal html + controller): index.html: Log in / Sign up main-controller.js: ( var myModule = angular.module('myModule', ['ui.bootstrap']); myModule.controller('MainCtrl as main', function($modal){ var controller = this; controller.openLoginModal = function(){ var modalInstance = $modal.open({ templateUrl: 'login-template.html', controller: 'LoginController as login' }; modalInstance.result.then(function () { // Redirect to the logged-in area of your site }, function () { // optional function. Do something if the user cancels. }); }); })(); login-template.html:
answers question: http://stackoverflow.com/q/28733762
score: 1
has comment: http://stackoverflow.com/comment/70206054
accepted answer of: http://stackoverflow.com/q/28733762
has comment: http://stackoverflow.com/comment/70176993
type: AcceptedAnswer
upvote count: 1
type: Answer

http://stackoverflow.com/q/28746711
has body: I imagine this will be quite easy for some. In order to avoid repeating code across different pages, I want to be able to add chunks of html code without writing out all of the elements. Kind of like a page controller for functions.
type: Question
linked to: http://stackoverflow.com/q/9466265
answer count: 2
tagged with: repeat
duplicate of: http://stackoverflow.com/q/9466265
has answer: http://stackoverflow.com/a/28746910
downvote count: 3
has title: Avoid repeating html code- not using PHP
has answer: http://stackoverflow.com/a/28747489
has comment: http://stackoverflow.com/comment/45775951
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45775652
score: -3
has comment: http://stackoverflow.com/comment/45775754
upvote count: 0
tagged with: code-size
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45775813
favorite count: 0

http://stackoverflow.com/comment/45563872
type: Comment
has text: because its option for `datepicker ` that we are providing option in json like `{ format: 'dd/mm/yyyy' }` look at this then only it will bind to that element . https://bootstrap-datepicker.readthedocs.org/en/release/
comment on: http://stackoverflow.com/a/28630968
score: 1
type: AnswerComment

http://stackoverflow.com/comment/45630085
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28667705
has text: slider div left side
score: 0

http://stackoverflow.com/a/28726161
type: Answer
has body: To trigger button event, you have to add this line of code in javascript. document.getElementById("btn_newpl").click(); Your button must have runat="server" and OnServerClick="btn_newpl_Click" attributes. If your problem is that the input element is in javascript string, than you can extract the string value of input and concatenate to your string on client side. &lt;input type="button" id="btn_newpl" value="submit" OnServerClick="btn_newpl_Click" runat="server" /&gt; &lt;script&gt; var tmp = document.createElement("div"); tmp.appendChild(document.getElementById('btn_newpl')); google.maps.event.addListener(marker, "click", function (e) { var infoWindow = new google.maps.InfoWindow({ content: '&lt;div&gt;&lt;input type="text" id="txt_newpl" value="place name"/&gt;' + '&lt;/br&gt;'+tmp.innerHTML+'&lt;/div&gt;' }) }); &lt;/script&gt; Please note that you don't actually call a C# function, you just trigger the click event on webforms and a postback to sever will be done. The server will figure out which event has been triggered and will execute the C# function. Source: How to call a code behinds button click event using javascript
has comment: http://stackoverflow.com/comment/45811912
accepted answer of: http://stackoverflow.com/q/28725992
answers question: http://stackoverflow.com/q/28725992
has comment: http://stackoverflow.com/comment/45739973
has comment: http://stackoverflow.com/comment/45859415
has comment: http://stackoverflow.com/comment/45764659
has comment: http://stackoverflow.com/comment/45858889
has comment: http://stackoverflow.com/comment/45858449
has comment: http://stackoverflow.com/comment/45799683
has comment: http://stackoverflow.com/comment/45754551
has comment: http://stackoverflow.com/comment/45846921
score: 0
has comment: http://stackoverflow.com/comment/45781251
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45741475

google-maps
tags question: http://stackoverflow.com/q/28619445
tags question: http://stackoverflow.com/q/28709975
tag name: google-maps
tags question: http://stackoverflow.com/q/28600503
tags question: http://stackoverflow.com/q/28696910
tags question: http://stackoverflow.com/q/28641137
tags question: http://stackoverflow.com/q/28741923
tags question: http://stackoverflow.com/q/28687526
tags question: http://stackoverflow.com/q/28627831
tags question: http://stackoverflow.com/q/28738816
tags question: http://stackoverflow.com/q/28742264
tags question: http://stackoverflow.com/q/28654349
tags question: http://stackoverflow.com/q/28617648
tags question: http://stackoverflow.com/q/28716476
tags question: http://stackoverflow.com/q/28662810
tags question: http://stackoverflow.com/q/28658958
tags question: http://stackoverflow.com/q/28617036
tags question: http://stackoverflow.com/q/28637416
tags question: http://stackoverflow.com/q/28604353
tags question: http://stackoverflow.com/q/28625512
tags question: http://stackoverflow.com/q/28726244
tags question: http://stackoverflow.com/q/28695819
tags question: http://stackoverflow.com/q/28702077
tags question: http://stackoverflow.com/q/28673321
tags question: http://stackoverflow.com/q/28636906
tags question: http://stackoverflow.com/q/28706541
tags question: http://stackoverflow.com/q/28652115
tags question: http://stackoverflow.com/q/28606149
tags question: http://stackoverflow.com/q/28600639
tags question: http://stackoverflow.com/q/28649025
tags question: http://stackoverflow.com/q/28684428
tags question: http://stackoverflow.com/q/28635493
tags question: http://stackoverflow.com/q/28610417
tags question: http://stackoverflow.com/q/28619526
tags question: http://stackoverflow.com/q/28669612
tags question: http://stackoverflow.com/q/28729801
tags question: http://stackoverflow.com/q/28627882
tags question: http://stackoverflow.com/q/28666651
tags question: http://stackoverflow.com/q/28716921
tags question: http://stackoverflow.com/q/28687094
tags question: http://stackoverflow.com/q/28709797
tags question: http://stackoverflow.com/q/28601409
tags question: http://stackoverflow.com/q/28742136
tags question: http://stackoverflow.com/q/28722868
tags question: http://stackoverflow.com/q/28733277
tags question: http://stackoverflow.com/q/28654688
tags question: http://stackoverflow.com/q/28609623
tags question: http://stackoverflow.com/q/28692758
tags question: http://stackoverflow.com/q/28636723
tags question: http://stackoverflow.com/q/28627522
tags question: http://stackoverflow.com/q/28700385
tags question: http://stackoverflow.com/q/28595208
type: Tag
tags question: http://stackoverflow.com/q/28693252
tags question: http://stackoverflow.com/q/28688675
tags question: http://stackoverflow.com/q/28691129
tags question: http://stackoverflow.com/q/28693256
tags question: http://stackoverflow.com/q/28595909
tags question: http://stackoverflow.com/q/28704994
tags question: http://stackoverflow.com/q/28659816
tags question: http://stackoverflow.com/q/28615689
tags question: http://stackoverflow.com/q/28637312
tags question: http://stackoverflow.com/q/28724013
tags question: http://stackoverflow.com/q/28596313
tags question: http://stackoverflow.com/q/28612058
tags question: http://stackoverflow.com/q/28608158
tags question: http://stackoverflow.com/q/28702492
tags question: http://stackoverflow.com/q/28674279
tags question: http://stackoverflow.com/q/28648766
tags question: http://stackoverflow.com/q/28595263
tags question: http://stackoverflow.com/q/28683411
tags question: http://stackoverflow.com/q/28634184
tags question: http://stackoverflow.com/q/28750179

http://stackoverflow.com/q/28638669
tagged with: prototype
has answer: http://stackoverflow.com/a/28638810
answer count: 3
has comment: http://stackoverflow.com/comment/45576964
tagged with: arrays
tagged with: jquery
has title: Javascript - Custom arrays not working
has comment: http://stackoverflow.com/comment/45576948
favorite count: 0
has comment: http://stackoverflow.com/comment/45576895
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28638734
has comment: http://stackoverflow.com/comment/45577117
has comment: http://stackoverflow.com/comment/45577112
has comment: http://stackoverflow.com/comment/45576996
has body: Please check the code below - custom_array.push(...) is working but custom_array[i] = "n" is not working. There are a couple more things which i am not sure why it is not working. Please note the comments with "?" which is not working. Please refer fiddle - http://jsfiddle.net/vc0bbm3d/
has answer: http://stackoverflow.com/a/28639166
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/45577013
type: Question
has comment: http://stackoverflow.com/comment/45577073
tagged with: javascript
score: -1

http://stackoverflow.com/q/28700712
has title: Hide Other Divs when clicking new Div with the same class
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28700807
has answer: http://stackoverflow.com/a/28700894
accepted answer: http://stackoverflow.com/a/28700894
has comment: http://stackoverflow.com/comment/45691744
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28700807
type: Question
has body: I cannot figure out how to add in the functionality of closing other divs when I click a div new div with the same class. I know it should be simple, but just can't get it to work. Here is the fiddle - http://jsfiddle.net/dnym5p1s/ added correct link &lt;div class="option-heading"&gt; &lt;div class="arrow-up"&gt;&amp;#9650;&lt;/div&gt; &lt;div class="arrow-down"&gt;&amp;#9660;&lt;/div&gt; &lt;h1&gt;Year1&lt;/h1&gt; &lt;/div&gt; &lt;div class="option-content"&gt; Content &lt;/div&gt; &lt;div class="option-heading"&gt; &lt;div class="arrow-up"&gt;&amp;#9650;&lt;/div&gt; &lt;div class="arrow-down"&gt;&amp;#9660;&lt;/div&gt; &lt;h1&gt;Year2&lt;/h1&gt; &lt;/div&gt; &lt;div class="option-content"&gt; Content &lt;/div&gt; $(".option-content").hide(); $(".arrow-up").hide(); $(".option-heading").click(function(){ $(this).next(".option-content").slideToggle(150); $(this).find(".arrow-up, .arrow-down").toggle(); });
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45691506

http://stackoverflow.com/comment/45681462
type: AnswerComment
score: 0
type: Comment
has text: `checkAnswer` is not initialized with empty string `value` is. Also only the value needs to be moved. The `querySelectory` is valid before and more efficient.
comment on: http://stackoverflow.com/a/28695430

http://stackoverflow.com/a/28652492
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45602321
has comment: http://stackoverflow.com/comment/45602249
answers question: http://stackoverflow.com/q/28652367
has body: If you want to fire event only once, you want to use .one(): $('#student').one('click', student); jQuery .one(): Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
downvote count: 0
has comment: http://stackoverflow.com/comment/45602122

http://stackoverflow.com/comment/45529676
type: AnswerComment
has text: the final `()` calls the result of the assignment, which is foo
type: Comment
comment on: http://stackoverflow.com/a/28609266
score: 0

http://stackoverflow.com/comment/45565307
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28631047
has text: So the *only* time the checkbox should change the value is when the option `Four` is chosen? If someone selects the option `Two` (and checks the checkbox) the value should stay as `2`?

http://stackoverflow.com/comment/133444259
has text: The most short way to say most short is shortest. It's also the readablest way.
comment on: http://stackoverflow.com/a/64549407
type: AnswerComment
score: 2
type: Comment

http://stackoverflow.com/comment/45566393
has text: Thanks y'all. So I should delve into the forEach() method when iterating through objects? Is there any way you could go ahead and write out the categories along with the products like in my example to fully grasp how this all works? Is there a way to write out category, product, product, category, product, product with a single forEach() method?
type: Comment
comment on: http://stackoverflow.com/a/28620646
score: 0
type: AnswerComment

http://stackoverflow.com/q/28744654
type: Question
has comment: http://stackoverflow.com/comment/45780593
tagged with: javascript
has title: HandlebarsTemplates is not defined
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/39669451
tagged with: backbone.js
type: UnansweredQuestion
has body: After following the instructions on handlebars_assets, i still can't get it to work. My steps were: 1) Added gem 'handlebars_assets' on Gemfile 2) run bundle install 3) Made sure application.js has //= require vendor/handlebars-v2.0.0 4) Added //= require_tree ./handlebars_templates to the application.js too 5) handlebars_templates directory is under app/assets/javascripts 6) Added test.hbs to the handlebars_templates directory 7) test.hbs contains test hbs 8) In a backbone.js view I've written template: HandlebarsTemplates['handlebars_template/new_map/infoWindow'](context), The error I received when loading the browser was: Uncaught ReferenceError: HandlebarsTemplates is not defined What am I missing ?
tagged with: handlebars.js
score: 1
has comment: http://stackoverflow.com/comment/45837591
upvote count: 1

http://stackoverflow.com/q/28600801
score: 3
has answer: http://stackoverflow.com/a/28612252
tagged with: javascript
tagged with: raphael
answer count: 2
downvote count: 0
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
type: UnansweredQuestion
has title: SVG to Canvas with canvg not respecting css
has body: I'm attempting to convert my SVG to canvas to get a png. everything is working great except for the css positioning. please see this jsfiddle you can see the top section which is the SVG. I am using canvg to render the svg on the canvas element. the 2 svgs overlap each other, one is 100% size, the other 80%. I am rendering these with Raphael. I have tried to insert inline styles as suggested in various place like: &lt;style type='text/css'&gt;![CDATA[svg{ margin: 0 auto; }]]&gt;&lt;/style&gt; however canvg only returns: Cannot read property 'split' of undefined I need the canvas to be identical to the SVG. *note changing both to 100% size and changin radius of circles is not an option, this is a very simplified version as illustration.
upvote count: 3
tagged with: canvg
has answer: http://stackoverflow.com/a/41997851
type: Question

http://stackoverflow.com/q/28688352
has answer: http://stackoverflow.com/a/28688960
has answer: http://stackoverflow.com/a/29478273
type: Question
has body: I am working on Facebook application (JS sdk), In this app user can post like/comment on a photo. For this activity, It is showing a like button at bottom of photo. But if user already liked particular photo then we don't show like button there. For this we need to know weather user already liked the photo or not. It is possible to know this using FQL SELECT object_id,like_info,comment_info FROM photo WHERE object_id=343907262480651 And it returns a boolean flag data["like_info"]["user_likes"] I am migrating my code from graph api v1.0 to v2.2. So FQL will is longer available. I want solution in graph API 2.2 similar to user_likes flag. I searched a lot for this, but not getting what exactly i want. Is there any alternative way to achieve this? Thanks.
tagged with: facebook-graph-api-v2.2
answer count: 2
tagged with: javascript
tagged with: facebook-like
upvote count: 1
has title: Determine weather user liked a photo or not. Facebook Graph API v2.2
favorite count: 0
type: UnansweredQuestion
downvote count: 0
score: 1
tagged with: facebook-fql

http://stackoverflow.com/comment/45764483
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28739487
has text: You, my friend, are a hero. You even find mistakes in code I didn't post. My apologies for that. It was exactly what you said.. I used simplified injection on the $modal, thinking it was not needed at that point.. Meet my lazy brain..

http://stackoverflow.com/comment/45756550
comment on: http://stackoverflow.com/q/28735859
score: 0
type: Comment
type: QuestionComment
has text: @AnatoliyArkhipov I tried and it's not work. As `$` is from jquery which is loaded by requirejs. So this code wont work as when it's loaded directly in the page, jquery is still on the way. isn't it?

http://stackoverflow.com/q/28730084
has comment: http://stackoverflow.com/comment/45746576
has body: Right now I have an input field: In the JS I assign the distance to a value: $scope.distance = 0; I want this value to change when the user enters in a value and clicks a button. I have the button setup with my controller... But every time the button is clicked, it displays the value as 0. Function when button is clicked: //convert button function for when button is clicked $scope.convert = function(myUnit, myUnit2, distance){ alert(distance); } The button: Convert
tagged with: javascript
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28730224
upvote count: 1
has answer: http://stackoverflow.com/a/28730228
downvote count: 1
accepted answer: http://stackoverflow.com/a/28730228
has title: change input number by user input not working
favorite count: 0
has comment: http://stackoverflow.com/comment/45746606
tagged with: angularjs
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28730224
tagged with: angularjs-scope
type: Question
tagged with: angularjs-directive

http://stackoverflow.com/comment/45778456
comment on: http://stackoverflow.com/q/28747746
type: Comment
type: QuestionComment
has text: @Paulie_D, I need to animate the sun around the dashed path.
score: 0

http://stackoverflow.com/a/60993995
has comment: http://stackoverflow.com/comment/107912096
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28662893
has body: pure javascript //end pure javascript

amazon-elastic-beanstalk
tag name: amazon-elastic-beanstalk
type: Tag
tags question: http://stackoverflow.com/q/28654062

http://stackoverflow.com/comment/45529047
type: Comment
type: QuestionComment
has text: Finally It's works! Thank you all. Now I know where I was making mistake. It was a valuable lesson for the future. I'm going back to my HUGE code :D
score: 0
comment on: http://stackoverflow.com/q/28611241

http://stackoverflow.com/comment/45601881
score: 0
has text: @shershen I tried to check hashPrefix, but when I inject $locationProvider other than in the config I get an injector error?
type: Comment
comment on: http://stackoverflow.com/q/28650364
type: QuestionComment

http://stackoverflow.com/q/28599739
type: Question
tagged with: javascript
has body: The problem is that the included error is showing in the console. Can someone help me understand why this is happening? I started learning jQuery a while back, but am still very new. Please help point me in the right direction. "Dimensions: jQuery collection is empty" (function($) { var height = $.fn.height, width = $.fn.width; $.fn.extend({ height: function() { if (!this[0]) error(); if (this[0] == window) if (($.browser.mozilla || $.browser.opera) &amp;&amp; $(document).width() &gt; self.innerWidth) return self.innerHeight - getScrollbarWidth(); else return self.innerHeight || $.boxModel &amp;&amp; document.documentElement.clientHeight || document.body.clientHeight; if (this[0] == document) return Math.max(document.body.scrollHeight, document.body.offsetHeight); return height.apply(this, arguments); }, width: function() { if (!this[0]) error(); if (this[0] == window) if (($.browser.mozilla || $.browser.opera) &amp;&amp; $(document).height() &gt; self.innerHeight) return self.innerWidth - getScrollbarWidth(); else return self.innerWidth || $.boxModel &amp;&amp; document.documentElement.clientWidth || document.body.clientWidth; if (this[0] == document) if ($.browser.mozilla) { var scrollLeft = self.pageXOffset; self.scrollTo(99999999, self.pageYOffset); var scrollWidth = self.pageXOffset; self.scrollTo(scrollLeft, self.pageYOffset); return document.body.offsetWidth + scrollWidth; } else return Math.max(document.body.scrollWidth, document.body.offsetWidth); return width.apply(this, arguments); }, innerHeight: function() { if (!this[0]) error(); return this[0] == window || this[0] == document ? this.height() : this.is(':visible') ? this[0].offsetHeight - num(this, 'borderTopWidth') - num(this, 'borderBottomWidth') : this.height() + num(this, 'paddingTop') + num(this, 'paddingBottom'); }, innerWidth: function() { if (!this[0]) error(); return this[0] == window || this[0] == document ? this.width() : this.is(':visible') ? this[0].offsetWidth - num(this, 'borderLeftWidth…
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/28599844
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28600414
type: UnansweredQuestion
has title: What is causing this JS console error?
score: 1
upvote count: 1

http://stackoverflow.com/q/28604668
has comment: http://stackoverflow.com/comment/45514116
has title: How to load js file on load of HTML?
favorite count: 0
has body: <Title>My Test This is for test Above mentioned is my HTML code. When I right click my page & hit "view source" I can see exact same code. But what my requirement is, instead of I want actual javascript code from test.js should be displayed when I am hitting "view source". I tried to put it in iframe, but it didn't worked.
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45514276
score: -1
has answer: http://stackoverflow.com/a/28604737
downvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28604946
answer count: 2
upvote count: 0

http://stackoverflow.com/comment/45759570
has text: jQuery is a utility library written in JavaScript. Your question has nothing to do with jQuery, it is a plain javascript question. And it is not a JavaScript _Array_ but an _Object_.
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/28737680

http://stackoverflow.com/comment/45581026
score: 0
comment on: http://stackoverflow.com/q/28640656
has text: It's not `var currentDate = new Date();`, that works fine. The function is fine too. It's almost certainly this `var reminderDate = sheet.getRange(i, 13).getValue();`. Do `console.log(typeof(reminderDate));` and see what you get.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45748905
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28731210
has text: Read it through, but not directly seeing which module can help?
score: 0

http://stackoverflow.com/q/28616075
tagged with: highcharts
tagged with: javascript
has body: I have problems with this radar chart, I'm trying that the items how are the same color (financial e.g.) linkd to the another one, for instance, financial model and sponsor/development should be linked, but no. In excel works fine, this is the code: $(function () { $('#container').highcharts({ chart: { polar: true, type: 'line' }, title: { text: 'Budget vs spending', x: -80 }, pane: { size: '80%' }, xAxis: { categories: ['Sponsor/Developer', 'SPA', 'SPV', 'Legal DD','Legal contracts', 'Environmental license', 'Grid connection license', 'Construction License', 'Generation License', 'Mining rights', 'Suite Studies/License', 'Property/terrain', 'Technical studies', 'EPC', 'Financial model'], tickmarkPlacement: 'on', lineWidth: 0 }, yAxis: { gridLineInterpolation: 'polygon', lineWidth: 0, min: 0 }, tooltip: { shared: true, pointFormat: '{series.name}: ${point.y:,.0f} ' }, legend: { align: 'right', verticalAlign: 'top', y: 70, layout: 'vertical' }, series: [{ name: 'Legal', data: [4, 4, 4, 4, 4, 4,null,null,null,null,null,null,null,null,null], pointPlacement: 'on', color: "#206ef0", }, { name: 'Development', data: [null, null, null, null, null, 4,4,4,4,4,4,null,null,null,null], pointPlacement: 'on', color: "#f07820" }, { name: 'Technical', data: [null, null, null, null, null, null, null, null, null, null, null,4,4,4,4], pointPlacement: 'on', color : "#37ce4c" }, { name: 'Financial', data: [4, null, null, null, null, null, null, null, null, null, null, null, null, null, 4], pointPlacement: 'on', color: "#dfdd19" } ] }); }); I think there must be one property but I can't find it. I hope you can help me, thanks.
score: 0
has comment: http://stackoverflow.com/comment/45578750
has comment: http://stackoverflow.com/comment/45579207
has comment: http://stackoverflow.com/comment/45553995
answer count: 0
type: UnansweredQuestion
type: Question
tagged with: radar-chart
has title: Highcharts, radar chart issue

http://stackoverflow.com/q/28661575
type: UnansweredQuestion
tagged with: node.js
has answer: http://stackoverflow.com/a/28661665
type: Question
has title: create bitpay client in node
tagged with: javascript
has body: If I try to create a bitpay client in node after npm install bitpay and feeding it my on bitpay.com generated api key. var client = BitPay.createClient('apikey'); I get: assert.js:92 throw new assert.AssertionError({ AssertionError: Not enough entropy. Minimum is: 192 bits at new HmacDRBG (/home/enigma/WebstormProjects/expensereports/node_modules/bitpay/node_modules/bitauth/node_modules/elliptic/lib/elliptic/hmac-drbg.js:24:3) at EC.sign (/home/enigma/WebstormProjects/expensereports/node_modules/bitpay/node_modules/bitauth/node_modules/elliptic/lib/elliptic/ec/index.js:94:14) at Object.BitAuth.sign (/home/enigma/WebstormProjects/expensereports/node_modules/bitpay/node_modules/bitauth/lib/bitauth.js:101:25) at RESTClient._sendRequest (/home/enigma/WebstormProjects/expensereports/node_modules/bitpay/lib/rest-client.js:156:46) at RESTClient.get (/home/enigma/WebstormProjects/expensereports/node_modules/bitpay/lib/rest-client.js:282:28) at RESTClient._getAccessTokens (/home/enigma/WebstormProjects/expensereports/node_modules/bitpay/lib/rest-client.js:81:19) at new RESTClient (/home/enigma/WebstormProjects/expensereports/node_modules/bitpay/lib/rest-client.js:51:17) at Object.module.exports.createClient (/home/enigma/WebstormProjects/expensereports/node_modules/bitpay/index.js:10:12) at Object.&lt;anonymous&gt; (/home/enigma/WebstormProjects/expensereports/server/api/btc/btc.controller.js:6:21) at Module._compile (module.js:456:26) if I try the website provided way: $ npm install bitpay var BitPay = require('bitpay'); var client = new BitPay('apikey'); client.on('ready', function() { client.post('invoices', { price: 10.00, currency: 'USD' }); }); it complains var client = new BitPay('apikey' TypeError: object is not a function at Object.&lt;anonymous&gt; (/home/enigma/WebstormProjects/expensereports/server/api/btc/btc.controller.js:6:14) 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…
score: 0
answer count: 1

http://stackoverflow.com/a/31658450
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28635522
has body: from http://trac.opensubtitles.org/projects/opensubtitles/wiki/HashSourceCodes: Hash code is based on ​Media Player Classic. In natural language it calculates: size + 64bit chksum of the first and last 64k (even if they overlap because the file is smaller than 128k). This means that unless you have downloaded the first and last 64kb of the file, you will most probably not get the correct opensubtitles hash.
downvote count: 0
type: Answer

http://stackoverflow.com/a/29864227
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28633421
upvote count: 1
has body: It's possibly because the "loadVideoById" is not yet available. You must construct your YT.Player Object with an events object, and include an "onReady" Event callback. Then in your "onReady" callback function you bind your Button click event. function onPlayerReady() { $('.yt-play').click(function(ev){ ev.preventDefault(); var videoid = $(this).data('yt'); // player.loadVideoByID is now available as a function player.loadVideoById(videoid); $('#yt-player').modal('show'); player.playVideo(); }); } player = new YT.Player('player', { videoId: '5ulO97zuVF0', //- just a temporary id, events:{ “onReady”: onPlayerReady } }); See the events section in the docs for more: https://developers.google.com/youtube/iframe_api_reference#Events

http://stackoverflow.com/q/28621328
type: UnansweredQuestion
score: 0
type: Question
tagged with: fittextjs
has body: How do I trigger the below fittext.js function $.fn.fitText = function( kompressor, options ) { var compressor = kompressor || 1, settings = $.extend({ 'minFontSize' : Number.NEGATIVE_INFINITY, 'maxFontSize' : Number.POSITIVE_INFINITY }, options); return this.each(function(){ // Store the object var $this = $(this); // Resizer() resizes items based on the object width divided by the compressor * 10 var resizer = function () { $this.css('font-size', Math.max(Math.min($this.width() / (compressor*10), parseFloat(settings.maxFontSize)), parseFloat(settings.minFontSize))); }; )}; using the change() Method? $('#drop').change(function(){ $('#tf').css('width', $(this).val()); //resizer(); // does not work //$('#tf').fitText(1.2, { minFontSize: '20px', maxFontSize: '40px' });// does not work });
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Using FitText with the change() method
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28621358

http://stackoverflow.com/a/28718843
score: 0
has body: This is probably because the first property of so.options is the .length property, which is numeric and not an object. To iterate an HTMLOptionsCollection, you need to do it like this: for (var i = 0; i &lt; so.options.length; ++i) { if (so.options.item(i).value == 'X') { } } Most browsers will probably provide a convenience accessor, though, so so.options[i].value should work as well.
has comment: http://stackoverflow.com/comment/45724840
has comment: http://stackoverflow.com/comment/45724994
answers question: http://stackoverflow.com/q/28718655
has comment: http://stackoverflow.com/comment/45724550
type: Answer

http://stackoverflow.com/comment/46066530
comment on: http://stackoverflow.com/q/28633223
has text: You should take a look at http://stackoverflow.com/questions/20077487/chrome-extension-message-passing-response-not-sent
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28717036
has comment: http://stackoverflow.com/comment/45722043
has body: you are getting 10000 results, have you considered requesting the data in smaller 'chunks' using a limit/offset and implementing either pagination or infinite scroll? pseudocode - function updateTable(data) { //use data to update table } function getData(offset, limit, order, orderBy, filter) { $.ajax({ url: ... ... data: { limit: limit, start_from: offset, order: order, orderBy: orderBy, filter: filter }, success: function (data) { updateTable(data) } }); } $(function () { getData(0, 20, 'ASC', 'ID', null); $table.on('scroll', function () { //infinite scroll bits //if should load more data call getData(offset, limit) }); $search.on('blur', function () { getData(0, 20, 'ASC', 'ID', $(this).val()); }); $orderBy.on('change', function () { var order; if (orderBy === $(this).val()) { order = 'DESC' } else { order = 'ASC' } getData(0, 20, order, this.val(), null); }); });
has comment: http://stackoverflow.com/comment/45721695
has comment: http://stackoverflow.com/comment/45721965
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/45721784
has comment: http://stackoverflow.com/comment/45721639
score: 2
has comment: http://stackoverflow.com/comment/45721901
answers question: http://stackoverflow.com/q/28716943
has comment: http://stackoverflow.com/comment/45723640
downvote count: 0

http://stackoverflow.com/comment/82511945
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28656982
has text: Note that as far as the browser is concerned, "navigating to another page" includes another page within your own application.
score: 0

http://stackoverflow.com/q/28745322
score: 0
upvote count: 1
downvote count: 1
accepted answer: http://stackoverflow.com/a/28745990
type: AnsweredQuestion
has body: Now i have a scrolling function, that i let scroll everytime on textArea and i have a lot lines where i trigger the textArea so automaticly i call the function scroll. Current code; var textArea = $('textArea'); if(a) { textArea.append(msg.a); scroll(); } if(b) { textArea.append(msg.b); scroll(); } So i have alot scroll() Is it possible to make the call inside te variable so everytime textArea is called automaticly do the scroll, so I don't need to put it inside every function.
has comment: http://stackoverflow.com/comment/45773512
has comment: http://stackoverflow.com/comment/45773399
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Whenever selector is triggered trigger function
has answer: http://stackoverflow.com/a/28745990
has comment: http://stackoverflow.com/comment/45773230

http://stackoverflow.com/comment/45618848
type: AnswerComment
type: Comment
has text: All the TestUtils,Simulate.{event} methods allow you to pass your own mock-event as the second parameter, so I think you could theoretically do something like: TestUtils.Simulate.submit(addForm, { target: [{value: 'name'}, {value: 'rating'}] })
comment on: http://stackoverflow.com/a/28660600
score: 0

http://stackoverflow.com/comment/45603699
type: QuestionComment
score: 1
has text: *"how would I use pop() to remove both negative numbers in this array"* You wouldn't.
comment on: http://stackoverflow.com/q/28653192
type: Comment

http://stackoverflow.com/q/28712319
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28727750
has title: HTML5 camera stretches the picture
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/70506405
downvote count: 0
has body: I'm using the HTML5 camera for taking picture. I have noticed that after the picture is captured, the final image width and height are stretched though I'm applying the same width and height for both video as well as canvas. Please refer this JSFIDDLE var video = document.querySelector("#videoElement"); navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia; if (navigator.getUserMedia) { navigator.getUserMedia({video: true}, handleVideo, videoError); } function handleVideo(stream) { video.src = window.URL.createObjectURL(stream); } function videoError(e) { // do something } var v,canvas,context,w,h; var imgtag = document.getElementById('imgtag'); var sel = document.getElementById('fileselect'); //document.addEventListener('DOMContentLoaded', function(){ v = document.getElementById('videoElement'); canvas = document.getElementById('canvas'); context = canvas.getContext('2d'); w = canvas.width; h = canvas.height; //},false); function draw(v,c,w,h) { if(v.paused || v.ended) return false; context.drawImage(v,0,0,w,h); var uri = canvas.toDataURL("image/png"); imgtag.src = uri; } document.getElementById('save').addEventListener('click',function(e){ draw(v,context,w,h); }); var fr; sel.addEventListener('change',function(e){ var f = sel.files[0]; fr = new FileReader(); fr.onload = receivedText; fr.readAsDataURL(f); }) function receivedText() { imgtag.src = fr.result; }
has answer: http://stackoverflow.com/a/70506405
type: AnsweredQuestion
score: 1
tagged with: html5-video
type: Question
accepted answer: http://stackoverflow.com/a/28727750
answer count: 2
upvote count: 1
tagged with: html5-canvas

http://stackoverflow.com/q/28651572
accepted answer: http://stackoverflow.com/a/28651747
answer count: 1
downvote count: 0
has body: I'm trying to display the first list item and then when the first input file has a file selected i want to display the next list item and so on, I've been having issues with this. How should I approach this?
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28651747
upvote count: 1
type: Question
tagged with: javascript
has title: Show next file input after current file input has a file

http://stackoverflow.com/comment/45595015
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28648599
has text: Thank you A. Wolff, That solved my problem. If you wouldn't mind post that as an Answer so i can mark it as the answer, that would be wonderful!
score: 0

http://stackoverflow.com/a/28971938
answers question: http://stackoverflow.com/q/28683940
type: Answer
accepted answer of: http://stackoverflow.com/q/28683940
has body: As it turns out the problem was the way I was handling the AlertHub connections. I am using Enterprise Library Caching to store connections backing the AlertHub, and I was expiring the cache entries 20 minutes after they were created. Ergo, when the server called the client method, no errors where reported because there were no client(s) to send the message(s) to. I have since increased the cache expiration to a reasonable value, which solved the problem.
score: 0
has comment: http://stackoverflow.com/comment/47315907
type: AcceptedAnswer

http://stackoverflow.com/comment/45730124
has text: ^^ you are not using it as a variable. But you could, if you would... ;)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28721703

http://stackoverflow.com/q/28731523
has answer: http://stackoverflow.com/a/28732976
accepted answer: http://stackoverflow.com/a/28732976
favorite count: 0
has body: I have some divs like these: jsFiddle I need to get using jQuery the divs that have data-effect-in AND data-effect-out and these attributes have values not empty. Added requirement I need too get the divs that have data-effect-out with value not empty and NOT have data-effect-in. The id's is GUID (I don't know the id, is generated from database) Thanks!!
type: AnsweredQuestion
tagged with: custom-data-attribute
score: 1
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
has title: Get a div by two data attributes and by exclude data attributtes
has comment: http://stackoverflow.com/comment/45749291
upvote count: 2
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/q/28741337
answer count: 0
has comment: http://stackoverflow.com/comment/52600105
tagged with: unit-testing
type: Question
tagged with: testing
tagged with: javascript
has body: For testing web applications, many sources suggest keeping your business logic as free from the web framework as possible to make it possible to test without needing to use the web framework. How can this be done? If I have a registration page, I need to validate the HTTP POST data (e.g. making sure date of birth is a date and required fields are given), then I'd need to persist the validated data to the database. I'm not sure how I can separate the parts related to the web framework from the business logic, as it's quite a simple piece of functionality. Same applies to login pages, account deletion pages, etc. I imagine the web framework wouldn't be doing much other than passing the HTTP data to the business logic function, which would then do everything (validation, persistence) that the web framework function was doing before this refactoring. So I don't see what I'm gaining. For example it would become businessLogicRegister( request.data['email'], request.data['birthday'], request.data['username'] ); Could someone give some examples of what such basic functions like registration/login might look like in a basic Node JS framework like Express or Koa and a good way to separate business logic from the web framework? And how that would help to make the code more unit-testable?
downvote count: 0
tagged with: web
favorite count: 0
has title: How to separate business logic from web framework for testing?
upvote count: 2
type: UnansweredQuestion
tagged with: node.js
score: 2

http://stackoverflow.com/comment/45776914
has text: jQuery is fine, I have jQuery implemented for a slider I am using anyway. SteamDev, you don't think this is a good idea?
comment on: http://stackoverflow.com/a/28747230
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45788648
has text: Yeah I can see how this would work, but the idea is to get inside the Angular controller logic to handle the authentication and this would pull that out. I know it would be workable, but I want to store the session information in an Angular factory.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28738479

http://stackoverflow.com/comment/45547098
comment on: http://stackoverflow.com/q/28622623
score: 0
type: QuestionComment
type: Comment
has text: you can better use this plugin for tabs http://jqueryui.com/tabs/

http://stackoverflow.com/a/28723041
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45733500
has body: Yes, all browsers will initiate requests in the order your code initiates requests. That doesn't mean that the network will prioritize them, or that they will finish faster than requests initiated later, but it's the most you can do.
type: Answer
has comment: http://stackoverflow.com/comment/45733011
has comment: http://stackoverflow.com/comment/45732929
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28722906
score: 1
answers question: http://stackoverflow.com/q/28722906
has comment: http://stackoverflow.com/comment/45732867

http://stackoverflow.com/a/28639524
upvote count: 17
has comment: http://stackoverflow.com/comment/136795989
downvote count: 0
has comment: http://stackoverflow.com/comment/45578542
has body: @JonathanCrowe's answer is correct for regex, but is that the right choice here? Particularly if you have many items, you'd be much better off modifying the parsed object, rather than running it through JSON.stringify for a regex solution: data.forEach(function(record) { if (record.parent === null) { record.parent = "#"; } }); In addition to being faster, this won't accidentally replace other nulls you want to keep, or mess up a record like { text: "Denullification Program"}.
type: Answer
answers question: http://stackoverflow.com/q/28639345
score: 17

http://stackoverflow.com/a/28609174
accepted answer of: http://stackoverflow.com/q/28608981
score: 0
has comment: http://stackoverflow.com/comment/45522433
answers question: http://stackoverflow.com/q/28608981
type: AcceptedAnswer
has body: The problem is that function is being called at a later point in time – after for loop is finished. The variable contained in the body has already been updated in the last iteration of for loop. That's what you are seeing. The fix is to somehow push the variable to the function inside. function makeListSaver(index) { /* return a brand new function that has captured the index when this function was invoked */ return function() { saveList(index); } } and then do, document.getElementById("myButton" + listIdx).addEventListener("click", makeListSaver(listIdx)) Or simply, document.getElementById("myButton" + listIdx).addEventListener("click", (function(index){ return function() { saveList(index); } })(listIdx)); You'll have to read up a little bit on closures and how they work.
type: Answer
has comment: http://stackoverflow.com/comment/45522566
has comment: http://stackoverflow.com/comment/45523534
has comment: http://stackoverflow.com/comment/45522449
has comment: http://stackoverflow.com/comment/45522691

http://stackoverflow.com/a/63490897
has comment: http://stackoverflow.com/comment/118060435
type: Answer
has comment: http://stackoverflow.com/comment/118055484
score: 0
has body: In case it helps anyone, Inspect Element can be disabled for an individual element by adding the style pointer-events: none; to it. This is very useful if you have any elements that are purely for the purpose of aligning child elements that necessarily overlap a large area of more useful elements; it lets you prevent the aligner elements from responding to the Inspect Element command.
has comment: http://stackoverflow.com/comment/118022723
answers question: http://stackoverflow.com/q/28690564

http://stackoverflow.com/a/28637128
has comment: http://stackoverflow.com/comment/45650607
upvote count: 2
has comment: http://stackoverflow.com/comment/45651132
has comment: http://stackoverflow.com/comment/45643390
has comment: http://stackoverflow.com/comment/45687453
has comment: http://stackoverflow.com/comment/45654221
has comment: http://stackoverflow.com/comment/45693640
has comment: http://stackoverflow.com/comment/45575366
has comment: http://stackoverflow.com/comment/45643723
has body: It seems that you made the tests on IE in different versions. IE10-IE11 should have no problems with the usage of ts.firstElementChild.innerHTML, but old versions of IE don't support firstElementChild property. You should follow the answer or this one. You can download the fixed version of jqGrid 4.7 from here or to download new beta version of new free jqGrid version from my fork here. I plan to publish new version of jqGrid very soon.
has comment: http://stackoverflow.com/comment/45576800
downvote count: 0
answers question: http://stackoverflow.com/q/28633096
has comment: http://stackoverflow.com/comment/45686979
has comment: http://stackoverflow.com/comment/45654662
has comment: http://stackoverflow.com/comment/45646613
has comment: http://stackoverflow.com/comment/45691913
has comment: http://stackoverflow.com/comment/45575708
type: Answer
has comment: http://stackoverflow.com/comment/45651541
has comment: http://stackoverflow.com/comment/45693868
has comment: http://stackoverflow.com/comment/45692485
has comment: http://stackoverflow.com/comment/45654059
score: 2

http://stackoverflow.com/comment/45504700
has text: use `required` attribute for `input` tag..Check this http://www.w3schools.com/tags/att_input_required.asp
comment on: http://stackoverflow.com/q/28599279
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/28607519
accepted answer of: http://stackoverflow.com/q/28607164
type: Answer
score: 2
upvote count: 2
has body: Here you might find the answers: Getting Final HTML with Javascript rendered Java as String this looks a bit similiar to your question, maybe HtmlUnit can help you as well.
answers question: http://stackoverflow.com/q/28607164
has comment: http://stackoverflow.com/comment/45519208
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45684033
score: 1
has text: Isn't airbnb some kind of rental/booking site? When did they become a trusted expert on JavaScript best practices?
comment on: http://stackoverflow.com/q/28696744
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28673107
score: 0
type: Answer
has body: Found the issue. Superfish was adding the code, but the 'jump' came from my megamenu list items being set as display:inline-block and not display: block elements. Once I put them to block, the jump was gone.
answers question: http://stackoverflow.com/q/28670087

http://stackoverflow.com/comment/45638173
comment on: http://stackoverflow.com/a/28668854
score: 0
type: Comment
has text: thank you very much.. i will try and work on it.. many thanks
type: AnswerComment

http://stackoverflow.com/comment/45545794
has text: Yes, here it is: http://jsfiddle.net/stevereece/kfhsv3mf/
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28621492
score: 0

http://stackoverflow.com/a/28682215
upvote count: 0
score: -1
has body: You can use img.alt See this question at stackoverflow: Get an attributes value of the ALT attribute of a hyperlink
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45657763
type: Answer
answers question: http://stackoverflow.com/q/28681788
has comment: http://stackoverflow.com/comment/45657579
accepted answer of: http://stackoverflow.com/q/28681788
downvote count: 1

http://stackoverflow.com/q/28732612
has body: Alright, so I have an image I'm moving around the canvas with keypresses (WASD.) The problem is that if you check out the animation (you can check it out on my website at maddogathecanadianunicorn.batcave.net/project5.html if you want to see it), it moves too fast. It's not the animation itself, but the movement being too fast. Is there a way I can lower how much it moves per second or something? Maybe it has something to do with the FPS? My Code is Below. function initCanvas(){ var canvas = document.getElementById('my_canvas') var ctx = canvas.getContext('2d'); //Variables var cw = canvas.width; var ch = canvas.height; var x = 20; var y = 20; var width = 40; var height = 40; var srcx = 0; var srcy = 0; //---------------- //Char (Spritesheet soon) //---------------- var char = new Image(); char.src = "spritesheet.png"; // draw(); //Executes the Draw Function // //------------- //WASD Controls //------------- document.addEventListener("keydown", move, false); function move(event){ //--- //W //--- if(event.keyCode == 87){ //w //ANIMATOR srcy = 0; srcx+=33; if(srcx === 66){ srcx = 0; } //CHAR MOVER if(y &gt;= 20){ y-=20; } /* This loops it back around. else if(y &lt; 20){ y = 460; } */ } //--- //A //--- if(event.keyCode == 65){ //a //Animator srcy = 66; srcx+=33; if(srcx === 66){ srcx = 0; } //CHAR MOVER if(x &gt;= 20){ x-=20; } /*Loops it back around else if(x &lt; 20){ x = 460; } */ } //--- //S //--- if(event.keyCode == 83){ //s //Animator srcy = 33; srcx+=33; if(srcx === 66){ srcx = 0; } //CHAR MOVER if(y+height &lt;= 490){ y+=20; } /*Loops Char back... else if(y+height &gt; 460){ y = 0; } */ } //--- //D //--- if(event.keyCode == 68){ //d //Animator srcy = 100; srcx+=33; if(srcx === 66){ srcx = 0; } //Mover if(x+width &lt;= 490){ x+=20; } /*Loops Char Back else if(x+width &gt; 490){ x = 0; } */ } draw(); //Idea for sprite: If press right it goes right and loads a gif while going right... //And when "keyup" or keyrelease or whatever, it stops the animation //Or loads…
tagged with: canvas
downvote count: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28732894
favorite count: 0
has comment: http://stackoverflow.com/comment/45751220
has comment: http://stackoverflow.com/comment/45751145
accepted answer: http://stackoverflow.com/a/28732894
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45787285
tagged with: animation
upvote count: 1
type: AnsweredQuestion
score: 1
has title: HTML CANVAS Slow down Movement
has comment: http://stackoverflow.com/comment/45751354
type: Question

http://stackoverflow.com/comment/45610455
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28656665
has text: @pankajparkar Sometimes you have to. For example, take AngularUI modal services.
type: AnswerComment

http://stackoverflow.com/a/31276075
has body: I had the exact same issue where iOS Safari would return "" even for a static valid JSON file... so I looked for anything similar between our code and since we're both using "GET", I decided to try POST, because why not... and sure enough, POST always return my json through ajax where GET didn't... It's definitely something in iOS safari not handling it correctly, but switching to POST worked for me... just in case someone else is running into the same issues out there.
answers question: http://stackoverflow.com/q/28717151
type: Answer
score: 0

http://stackoverflow.com/comment/45677126
comment on: http://stackoverflow.com/q/28673506
score: 1
has text: well if auto-complete is not working if you keep inside a foreach that say's `$(".form-control").select2` is not recognized because the elements under foreach are created after DOM creation . best alternative is use jqAuto plugin which works like a charm else you should try using delegates(register events) . cheers
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45522843
type: QuestionComment
type: Comment
has text: @Muthu.. Thanks for commenting. No I did not. I will try it and then let you know.
comment on: http://stackoverflow.com/q/28609389
score: 0

http://stackoverflow.com/q/28749859
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/45781765
has comment: http://stackoverflow.com/comment/45781685
possible better answer: http://stackoverflow.com/a/28750569
downvote count: 1
type: Question
has title: Button Linking in ajax table
tagged with: javascript
tagged with: jquery
score: -1
tagged with: ajax
answer count: 2
has comment: http://stackoverflow.com/comment/45783277
has answer: http://stackoverflow.com/a/28749995
has answer: http://stackoverflow.com/a/28750569
accepted answer: http://stackoverflow.com/a/28749995
favorite count: 0
has comment: http://stackoverflow.com/comment/45781659
has body: Please look at the ajax code below, As you can see, i have managed to make a button display in each table row, which is great, the issue is each button will only link ti the dataurl, I'm really needing to make it so that each button will link off to a different place, But only is the event is still available. E.g. if a row disappears i need the button to disappear? So the Increment feature wouldn't work. Thanks Sam Heres the ajax code $.ajax({ type: 'GET', crossDomain: true, dataType: 'json', url: 'api link for seatwave', success: function(json) { //var json = $.parseJSON(data); for (var i = 0; i < json.results.TicketGroups.length; i++) { var section = json.results.TicketGroups[i].TicketTypeName; var no = json.results.TicketGroups[i].Qty; var price = json.results.TicketGroups[i]. Price; var button = " Click Here "; $("#tableid").append(" seatwave " + section + " N/A N/A " + no + " £"+price + " " + button + " "); $("#tableid").find(".btn.btn-info").click(function() { location.href = $(this).attr("data-url"); }); } sortTable(); }, error: function(error) { console.log(error); } });

http://stackoverflow.com/q/28695536
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28696333
has comment: http://stackoverflow.com/comment/45682101
score: 0
type: Question
accepted answer: http://stackoverflow.com/a/28696134
has body: i have a JSON response like below { "Parent": "skystar", "Children": [ {"Name":"MW"}, {"Name":"PR"}, {"Name":"PV"}, {"Name":"ST"} ] }, { "Parent": "RR", "Children": [ {"Name":"RC"}, {"Name":"RP"} ] } Now i need to bind this to the table. i tried to call AJAX like below $.ajax({ url: 'echo/sample.json/', success: function (response) { var trHTML = ''; $.each(response, function (i, item) { trHTML += '&lt;tr&gt;&lt;td&gt;' + item.Children + '&lt;/td&gt;'; }); $('#records_table').append(trHTML); } }); But i am not able to bind the table what i am doing wrong?? JSFIDDLE one more thing every children has hypher link how to add it How to do that in Jquery or javascript?? Any help??
has title: Update html table according to ajax json response
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28696103
has comment: http://stackoverflow.com/comment/45681950
possible better answer: http://stackoverflow.com/a/28696103
has comment: http://stackoverflow.com/comment/45681826
has comment: http://stackoverflow.com/comment/45682578
has answer: http://stackoverflow.com/a/28697615
has answer: http://stackoverflow.com/a/28696134
has comment: http://stackoverflow.com/comment/45681704
has comment: http://stackoverflow.com/comment/45685425
answer count: 4

http://stackoverflow.com/comment/45763512
type: AnswerComment
comment on: http://stackoverflow.com/a/28739541
type: Comment
has text: @ρяσѕρєяK if the word is at start of sentence ,there wont be a space behind it.For that case i have added `^|`
score: 1

http://stackoverflow.com/q/28664645
type: UnansweredQuestion
has body: Following on from a solution posted here: Velocity.js/Blast.js starting opacity at 0 I am using Velocity.js and Blast.js to create a simple load in each word as an animation... one of the basic setups. I am also using this alongside Cycle2. I am also using fullpage.js, so sometimes a text slide might be the first slide, so is it possible to do the same thing on sliding down? If the text slide, with the animation, is also the first slide, to trigger the animation from opacity:0 just as it does if you navigate prev/next. I have set up a JSFiddle, adding the fullpage.js, so if you scroll down I've made the second section start with text but it doesn't animate or show. I've also added in onLeave and afterLoad callbacks for you to use if that helps? jsfiddle.net/h3vo8LL1/4/ // if ($('.home-section-container').length &gt; 0) { $('.home-section-container').fullpage({ sectionSelector: '.each-section', scrollingSpeed: 1000, resize: false, onLeave: function () { // }, afterLoad: function () { // } }); } // function featuredProjectTextAnimation(incomingSlideEl) { var $animated = $(incomingSlideEl).find('.text-container.animated'); $animated.blast({ delimiter: 'word' }) .velocity('transition.fadeIn', { display: null, duration: 0, stagger: 100, delay: 400, begin: function () { $animated.css('opacity', 1); }, complete: function () { // } }); } // if ($('.home-slider-container').length &gt; 0) { $('.home-slider-container .home-slider').each(function () { var $this = $(this); var slideCount = $this.find('.each-slide').length; if (slideCount &lt;= 1) { $this.next('.home-slider-pager').remove(); $this.prev('.home-slider-navigation').remove(); } $this.cycle({ fx: 'fade', slides: '&gt; .each-slide', caption: $this.next('.home-slider-pager'), captionTemplate: '{{slideNum}}/{{slideCount}}', sync: true, timeout: 0, random: false, pagerActiveClass: 'active', next: $this.prev('.home-slider-navigation').find('.next'), prev: $this.prev('.home-slider-navigation').find('.prev'), loader: true, a…
score: 2
has comment: http://stackoverflow.com/comment/46069230
downvote count: 0
type: Question
upvote count: 2
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/28614890
has title: Velocity.js/Blast.js triggering using fullpage.js
answer count: 1
tagged with: fullpage.js
tagged with: velocity.js
favorite count: 0
has answer: http://stackoverflow.com/a/28685796

http://stackoverflow.com/a/28637277
score: 2
downvote count: 0
has body: What you can do is using ajax for your $_POST or $_GET request. PHP myserver.php: if (isset($_POST['acceptbut'])) { // i do something here... // you could either echo back text or JSON echo "Blah Blah Blah"; } Javascript: $.post("myserver.php", function(data){ // I do something here with the data I received window.alert(data); // it should says Blah Blah Blah });
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28636364
answers question: http://stackoverflow.com/q/28636364
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/45608624
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28655932
type: Comment
has text: Thats typo problem sorry...new Date(2015,01,22).getTime(); --> this is wat i need , this always prints same time stamp...but when i run ur code it always print different timestamp..

http://stackoverflow.com/a/37669208
type: Answer
has body: Refs as strings are considered legacy and may be deprecated. But it seems as if react-bootstrap components won't work with callback refs. I was working on this today to handle a search input. class SearchBox extends Component { constructor(props, context) { super(props, context); this.handleChange = this.handleChange.bind(this); } handleChange() { this.props.updateQuery(this._query.value); } render() { // ... &lt;FormControl onChange={this.handleChange} ref={(c) =&gt; this._query = c} // should work but doesn't value={this.props.query} type="text" placeholder="Search" /&gt; // ... } } I wound up grabbing the change event and getting the value from it. This doesn't feel the "React way" or very current, but it works. class SearchBox extends Component { constructor(props, context) { super(props, context); this.handleChange = this.handleChange.bind(this); } handleChange(e) { this.props.updateQuery(e.target.value); } render() { // ... &lt;FormControl onChange={this.handleChange} value={this.props.query} type="text" placeholder="Search" /&gt; // ... } }
answers question: http://stackoverflow.com/q/28678466
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/a/28731789
has comment: http://stackoverflow.com/comment/45749915
has comment: http://stackoverflow.com/comment/45840501
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28731423
answers question: http://stackoverflow.com/q/28731423
has body: This is due to rounding errors during blending and composition when sub-pixeling is used - different browsers gain different result based on their approach (IE and FireFox gives the same result, webkit browsers a different result). It's not much we can do with the inner working, but we can adjust for sub-pixeling so it won't happen by simply translating the canvas half pixel. Add this line to the top of the gradient function: _gradientContext.setTransform(1,0,0,1, 0.5,0.5); // offset 0.5 pixel and it should work The reason being that pixels are initially rendered from the pixel's center, meaning 0.5 of the pixel is interpolated both ways. Translating 0.5 pixel will match the center to the pixel grid. Update (from comments): Another approach using coordinates to calculate color value (HSL) instead of picking a pixel (this approach will also allow you to set a point in the picker based on input values):
type: Answer
has comment: http://stackoverflow.com/comment/45749692
has comment: http://stackoverflow.com/comment/45860428
has comment: http://stackoverflow.com/comment/45860350
has comment: http://stackoverflow.com/comment/45750031
score: 1
has comment: http://stackoverflow.com/comment/45749750
has comment: http://stackoverflow.com/comment/45910498
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45861474

http://stackoverflow.com/comment/45589736
type: AnswerComment
has text: Yes, looks perfect, but where's the actual text (the address in your example) coming from? How do I edit it?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28645952

http://stackoverflow.com/comment/45765487
type: Comment
has text: @designeng `null === null` is true, so the test should be fine
type: AnswerComment
comment on: http://stackoverflow.com/a/28740857
score: 0

http://stackoverflow.com/q/28665814
favorite count: 0
upvote count: 2
tagged with: twitter-bootstrap
tagged with: razor
tagged with: css
has comment: http://stackoverflow.com/comment/45627952
has answer: http://stackoverflow.com/a/30560495
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45627961
has title: Trying to get 2 form fields next to each other (inline) using bootstrap 3 in MVC5 razor
has body: I am trying to get WorkPhone and WorkPhone Extension side by side and aligned perfectly under the above field which spans the entire width of the column. This somewhat works but the extension field extends too far out to the right. The ideal scenario would be for it to look like this: Work Phone [textbox] ext [textbox] Here is what I have: &lt;div class="form-group"&gt; &lt;div class="row"&gt; &lt;div class="col-md-8"&gt; @Html.LabelFor(model =&gt; model.WorkPhone, htmlAttributes: new { @class = "control-label" }) @Html.EditorFor(model =&gt; model.WorkPhone, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model =&gt; model.WorkPhone, "", new { @class = "text-danger" }) &lt;/div&gt; &lt;div class="col-md-4"&gt; @Html.LabelFor(model =&gt; model.WorkPhoneExt, htmlAttributes: new { @class = "control-label" }) @Html.EditorFor(model =&gt; model.WorkPhoneExt, new { htmlAttributes = new { @class = "form-control" } }) &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;
type: Question
score: 2
tagged with: asp.net-mvc
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/30560495
has comment: http://stackoverflow.com/comment/45627408
has comment: http://stackoverflow.com/comment/45627914
answer count: 1

http://stackoverflow.com/a/28675833
upvote count: 2
has body: Use an overlay that is faded out when the page is fully loaded. HTML &lt;div id="loadingOverlay"&gt; &lt;img src="pageload.gif" alt="The page is loading" /&gt; Please Wait &lt;/div&gt; Script $(window).load(function(){ $('#loadingOverlay').fadeOut(); });
answers question: http://stackoverflow.com/q/28675496
downvote count: 1
has comment: http://stackoverflow.com/comment/45646593
score: 1
has comment: http://stackoverflow.com/comment/45705282
has comment: http://stackoverflow.com/comment/45754029
type: Answer

http://stackoverflow.com/a/28668722
score: 0
answers question: http://stackoverflow.com/q/28668690
type: Answer
has body: You can use .select event to do this. $(document).ready(function(){ $("#target").select(function(){ console.log($(this).val()); }); }); And i hope that you have included jQuery file EDIT ..... // At the end of the body because JS loads Synchronously $(document).ready(function(){ $("#target").select(function(){ console.log($(this).val()); }); });
has comment: http://stackoverflow.com/comment/45631671

http://stackoverflow.com/comment/45523047
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28608996
has text: @NaeemShaikh , no, it doesn't work - http://jsfiddle.net/28abyns7/2/

http://stackoverflow.com/q/28626410
tagged with: javascript
has answer: http://stackoverflow.com/a/29288697
answer count: 3
has title: Creating a numbered list for Meteor data
has comment: http://stackoverflow.com/comment/45554001
downvote count: 0
has comment: http://stackoverflow.com/comment/45553551
tagged with: meteor
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28626545
linked to: http://stackoverflow.com/q/24225071
score: 1
has answer: http://stackoverflow.com/a/28627148
upvote count: 1
has body: Is there a way to get "the number" for a numbered list of the items I have in a Meteor collection. I know I can do it in html, but I feel like it would be much easier to style if I could just drop something in the {{spacebars}}. If there's better terminology I could be using, please let me know. Something like this. List of top 20 movies: {{#each movie}} Movie #{{number}} {{movie_name}} {{review_score}} {{/each}}
type: Question
tagged with: mongodb

http://stackoverflow.com/a/56740264
downvote count: 0
score: 1
has body: Another option would be to mutate your column to shorten any strings with more than 30 characters. library(dplyr) library(stringr) tbl &lt;- tbl %&gt;% mutate(column_name = as.character(column_name)) %&gt;% rowwise() %&gt;% mutate(column_name = case_when(nchar(column_name) &gt; 30 ~ paste(str_sub(column_name, 1, 30), "..."), nchar(column_name) &lt;= 30 ~ column_name)) This will shorten all strings to 30 characters and add a ... at the end.
answers question: http://stackoverflow.com/q/28693738
upvote count: 1
type: Answer

http://stackoverflow.com/q/28635477
has comment: http://stackoverflow.com/comment/45570895
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45570909
has title: javascript - Get largest value(s) in multi-dimensional array
has answer: http://stackoverflow.com/a/28635565
linked to: http://stackoverflow.com/q/11149843
answer count: 3
has answer: http://stackoverflow.com/a/28635571
has body: I am using this tutorial to get the largest 'first' [0] value of a multidimensional array. array = [[1, 5], [4, 7], [3, 8], [2, 3], [12, 4], [6, 6], [4, 1], [3, 2], [8, 14]] array.reduce(function(max, arr) { return max &gt;= arr[0] ? max : arr[0]; }, -Infinity); but how can i get other associated values? In other words since [12, 4] 12 is the highest value but how can i get '4'? *note after sorting the arrays from the first val, i would need access to all the values.
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28635565
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28635678
has answer: http://stackoverflow.com/a/28635678
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45570966

http://stackoverflow.com/a/28715561
downvote count: 0
score: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28714239
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28714239
has body: Setting height to 100% will yield a height of the current browser window's size. Div's will size to content by default. Remove all your height: 100% constraints, and you should be fine.

http://stackoverflow.com/a/28655098
score: 0
answers question: http://stackoverflow.com/q/28654815
type: Answer
has body: This my html page <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" ScriptMode="Release" /> <UsersHeaderTP:UsersHeaderTN runat="server" ID="UserHeaderTN1" /> 1 Step 1 2 Step 2 <%-- 3 Step 3 --%> Step 1 Contacts: + + <footertp:footertn runat="server" id="HeaderTN1" />

jquery-mobile
tags question: http://stackoverflow.com/q/28728968
tags question: http://stackoverflow.com/q/28703000
tags question: http://stackoverflow.com/q/28691101
type: Tag
tags question: http://stackoverflow.com/q/28697281
tags question: http://stackoverflow.com/q/28642510
tags question: http://stackoverflow.com/q/28746395
tags question: http://stackoverflow.com/q/28657595
tags question: http://stackoverflow.com/q/28626513
tags question: http://stackoverflow.com/q/28684339
tags question: http://stackoverflow.com/q/28658927
tags question: http://stackoverflow.com/q/28709053
tags question: http://stackoverflow.com/q/28665277
tags question: http://stackoverflow.com/q/28693913
tags question: http://stackoverflow.com/q/28609212
tags question: http://stackoverflow.com/q/28675097
tags question: http://stackoverflow.com/q/28663932
tags question: http://stackoverflow.com/q/28703484
tags question: http://stackoverflow.com/q/28697966
tags question: http://stackoverflow.com/q/28713315
tags question: http://stackoverflow.com/q/28694621
tags question: http://stackoverflow.com/q/28675496
tag name: jquery-mobile
tags question: http://stackoverflow.com/q/28631325
tags question: http://stackoverflow.com/q/28623434

http://stackoverflow.com/comment/45682659
score: 0
type: AnswerComment
has text: Can you show an example of how to use your expression? as I have done: `PageName.split(pageRegex).join(" ")` where `pageRegex` is your expression. Is this correct for your example?
type: Comment
comment on: http://stackoverflow.com/a/28695729

http://stackoverflow.com/comment/45551881
has text: So you actually meant to update the content inside the panel? Not updating the visibility (hiding/showing). That is not supported via a the javascript api of widgets. I'll add that to my answer, so it becomes 'acceptable' ;-). I've never seen this requirement, so maybe you've fallen in the [XY trap](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem)
comment on: http://stackoverflow.com/a/28611002
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45621410
comment on: http://stackoverflow.com/a/28652356
type: Comment
has text: Thanks for the feedback. It would be great if you accepted this as the correct answer, then. And keep the questions coming.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28729831
tagged with: javascript
has comment: http://stackoverflow.com/comment/45745891
has comment: http://stackoverflow.com/comment/98959493
has title: Transpile TypeScript In Memory With Node
answer count: 3
favorite count: 0
has comment: http://stackoverflow.com/comment/45746410
has answer: http://stackoverflow.com/a/28731918
tagged with: code-translation
has answer: http://stackoverflow.com/a/78135774
tagged with: node.js
has body: Is there a way to transpile TypeScript in memory with Node? I would like to be able to get the generated JavaScript in memory.
has answer: http://stackoverflow.com/a/35368621
tagged with: typescript
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/35368621
type: Question
score: 12
upvote count: 12
accepted answer: http://stackoverflow.com/a/28731918
downvote count: 0

http://stackoverflow.com/comment/45684621
has text: Have you set logs in the hub on the server side to see whether your client is disconnecting prior to the stopped activities?
score: 1
comment on: http://stackoverflow.com/q/28683940
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45579439
comment on: http://stackoverflow.com/q/28639545
type: QuestionComment
type: Comment
score: 0
has text: oh wow.. I never noticed that and that indeed was the problem.. I guess because my contact form always worked i didn't think to check that.. you have saved me hours of trying to solve it. thank you.

http://stackoverflow.com/comment/45782926
type: AnswerComment
score: 0
has text: Keep in mind that jsFiddle is automatically using an internal DOM ready event handler.
type: Comment
comment on: http://stackoverflow.com/a/28750441

http://stackoverflow.com/a/28698881
has body: You can't index arrays with dot-notation. Your line of code should probably read: user.location = data.results[0].address_components[3].long_name;
type: Answer
answers question: http://stackoverflow.com/q/28698813
upvote count: 4
downvote count: 0
score: 4

http://stackoverflow.com/comment/45777517
score: 0
type: Comment
type: QuestionComment
has text: You have to post example of the source data and the result.
comment on: http://stackoverflow.com/q/28747576

http://stackoverflow.com/q/28600667
has comment: http://stackoverflow.com/comment/45507788
has body: I am working out some code for some application. I want to limit the messages in the chat this.limitM = -10; $scope.msgsCount = //contains the number of messages -main.limitM" ng-click="main.limitM=-10+main.limitM">Load More This is not limiting the messages, all the messages appear. Can anyone help ?
has answer: http://stackoverflow.com/a/28601400
score: 4
type: AnsweredQuestion
has title: limitTo not working in ng-repeat in AngularJs
possible better answer: http://stackoverflow.com/a/28600946
has answer: http://stackoverflow.com/a/28600956
has answer: http://stackoverflow.com/a/28600946
type: Question
linked to: http://stackoverflow.com/q/19601028
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28601400
upvote count: 4
answer count: 3
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45507319
tagged with: angularjs

http://stackoverflow.com/comment/45515481
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28605393
has text: http://stackoverflow.com/questions/20706418/are-there-file-size-limitations-when-using-javascript-filereader-api

http://stackoverflow.com/comment/128307671
has text: Nice to suggest great helps = table.$('tr#'+id).removeClass('selected');
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28662154
type: AnswerComment

http://stackoverflow.com/q/28707907
type: UnansweredQuestion
score: 1
type: Question
has body: I'm running a game.js file in a Perlenspiel engine. I have a global variable called var hasKey; In the PS.keyDown = function I'm running this var hasKey; if(dataAtScout == "key"){ hasKey = true; PS.audioPlay("fx_jump8"); PS.debug("Scout has picked up an odd key") } if(dataAtScout == "exit"){ Scout.x = oldSX; Scout.y = oldSY; PS.debug("\nTheres a computer at the door.") if(hasKey == true){ PS.debug("\nThe door creaks open as Scout runs into a cornfield.") } else{ PS.debug("\nError... Error... Error... Error") } } I'm wanting to check if the key has been picked up while the player is at the exit. However, I am not able to do so. I've tried many, many things and this is the last hurdle that is stumping me. I want to change hasKey = true globally so that when dataAtScout = "exit" it will confirm that the variable has changed to true. So, in my dataAtScout = "key", how can I changed the hasKey variable to true, globally, to be confirmed later by another if statement? I saw another post with a similar question and the conclusion was that a reset(); needed to be called. I tried that but it didn't work. Any and all help is greatly appreciated!
tagged with: javascript
upvote count: 1
answer count: 1
downvote count: 0
tagged with: global
tagged with: variables
has title: How to change a global var in an if statement and then reuse that change in another if statement?
favorite count: 0
has comment: http://stackoverflow.com/comment/45705512
has answer: http://stackoverflow.com/a/28708001

http://stackoverflow.com/a/28625831
answers question: http://stackoverflow.com/q/28618771
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: It turns out that Adblock Pro blocks ads primarily, if not only by matching against the URL. If you are getting this error I would try to rename the file that is blocked to something else and see if the error persists. In this case it seems that the filename 'prevent_doubleclick.js' was block based on the string 'doubleclick'.
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/45552575
has comment: http://stackoverflow.com/comment/45552718
accepted answer of: http://stackoverflow.com/q/28618771

http://stackoverflow.com/q/28637348
tagged with: javascript
score: 0
has body: I have a number of 3D objects inside the canvas and am looking to implement the requestAnimFrame() function on only one of these (a cube). The other items must not be affected and should remain static. The render function looks like this: function render() { gl.clear( gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); theta[axis] += 2.0; gl.uniform3fv(thetaLoc, theta); // Render cube gl.drawArrays( gl.TRIANGLES, 0, NumVertices ); requestAnimFrame( render ); } If I added the other objects to this function, e.g. // Render sphere gl.drawArrays( gl.TRIANGLES, 0, points.length ); they will rotate together with the cube. Question: do I create a separate render function for the static objects? I assme I can exclude a second call to gl.clear( gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); because the buffers don't need a second clearing? Or am I missing something and is there another way from preventing the other objects from moving?
has answer: http://stackoverflow.com/a/28637811
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45575414
linked to: http://stackoverflow.com/q/19053223
has title: WebGL requestAnimFrame()
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45575235
tagged with: webgl
type: Question
answer count: 1

http://stackoverflow.com/q/28662430
score: 1
accepted answer: http://stackoverflow.com/a/28662541
favorite count: 0
has comment: http://stackoverflow.com/comment/45620131
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45620182
has comment: http://stackoverflow.com/comment/45619951
has comment: http://stackoverflow.com/comment/45620340
type: AnsweredQuestion
has title: Why isn't my function returning a Float Number
upvote count: 1
has comment: http://stackoverflow.com/comment/45620343
type: Question
has answer: http://stackoverflow.com/a/28662541
has comment: http://stackoverflow.com/comment/45620046
has comment: http://stackoverflow.com/comment/45620313
tagged with: javascript
has body: Why isn't this simple code returning the floating point (declared constants) dollar value? I've tried the parseFloat and it would not work. There is most likely a better way of doing this, however I'm a beginner but picking up the concept quick. Thanks in advance! &lt;!doctype html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;!--link to CSS Style sheet--&gt; &lt;link href="style.css" rel="stylesheet" type="text/css"&gt; &lt;title&gt;Allen Ricardo's Dance Studio&lt;/title&gt; &lt;!--JS Script and function here--&gt; &lt;!--Prompt user to enter an age create variable to hold age create variables to hold constant ticket prices use relational operators and if/else statements to check condition of age output the cost of the ticket.--&gt; &lt;script&gt; function verifyAge() { &lt;!--constant variables for ticket prices--&gt; var TICKET_PRICE_1 = 3.00; var TICKET_PRICE_2 = 7.00; var TICKET_PRICE_3 = 9.00; var age=prompt("Enter Customer's Age: ", ""); if(age &lt; 4 &amp;&amp; age &gt; 0) document.getElementById("tickPrice").innerHTML="$" + TICKET_PRICE_1; else if(age &gt;= 4 &amp;&amp; age &lt;= 16) document.getElementById("tickPrice").innerHTML="$" + TICKET_PRICE_2; else if(age &gt; 16) document.getElementById("tickPrice").innerHTML="$" + TICKET_PRICE_3; } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;!--add image from previous assignment question here--&gt; &lt;header&gt; &lt;img src="danc_logo.png" width="200" height="200" alt="Studio Logo"&gt; &lt;h1&gt;Allen Ricardo's Dance Ticket Prices&lt;/h1&gt;&lt;/header&gt; &lt;!--container 1--&gt; &lt;div id="buttonPrompt"&gt; &lt;h2&gt;Click on the button below to enter customer's age&lt;/h2&gt;&lt;/div&gt; &lt;!--container 2--&gt; &lt;div id="defaultDisplay"&gt; &lt;p&gt;Under Age 4 (age &amp;lt; 4) cost is: &lt;strong&gt;$3.00&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Between ages 4 and 16 (4 ≥ age ≤ 16) cost is: &lt;strong&gt;$7.00&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Older than 16 (age &gt; 16) cost is: &lt;strong&g…
has comment: http://stackoverflow.com/comment/45619912
answer count: 1
downvote count: 0

http://stackoverflow.com/a/28686716
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/45665917
has comment: http://stackoverflow.com/comment/45666257
downvote count: 1
answers question: http://stackoverflow.com/q/28686328
score: 1
has comment: http://stackoverflow.com/comment/45668494
has body: I would probably do this with SVG, which is widely supported. You could also achieve the angled effect with CSS transformations. I'm afraid your question is not specific enough to invite a more detailed answer, but hopefully those links will help you get started.

http://stackoverflow.com/comment/45614276
comment on: http://stackoverflow.com/q/28659272
score: 0
type: Comment
type: QuestionComment
has text: Yes that's EXACTLY the case!

http://stackoverflow.com/comment/45671728
type: Comment
has text: Thank you all for replying. I used the second set of JQuery code and it worked great! As I mentioned, I am completely new to coding and I just didn't know where to go with it. Sorry for sounding ignorant, but can you tell me what the advantages are for using either Javascript or JQuery? Is there a particular one that is better than the other? Thank you, again!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28664238

http://stackoverflow.com/a/28699682
score: 4
type: Answer
upvote count: 4
answers question: http://stackoverflow.com/q/28607892
accepted answer of: http://stackoverflow.com/q/28607892
has body: You can move your variable into a script block in the html page. &lt;#import "../masterPage.html" as layout&gt; &lt;@layout.masterPageLay bread1="my bread1" bread2="my bread2"&gt; &lt;#assign titulo="value 1"&gt; &lt;#assign subtitulo="value 2"&gt; &lt;script src="../resources/js/scripts/myPageScript.js"&gt;&lt;/script&gt; &lt;script&gt; // This variable can be accessed from myPageScript.js var variableFreeMarker = "${freeMarkValue}"; &lt;/script&gt; &lt;form name="myform"&gt; Name in view: &lt;input type="text" id="name" name="name"&gt; &lt;br&gt; Last Name in view: &lt;input type="text" id="lastName" name="lastName"&gt; &lt;br&gt; Show modify name in view: &lt;input type="text" id="modifyname" name="modifyname"&gt; &lt;br&gt; &lt;input type="button" value="Add Users" onclick="doAjaxPost()"&gt; &lt;/form&gt; Or add it as a value of a hidden input etc.. &lt;input type="hidden" id="myVal" value="${freeMarkValue}"&gt; Your JS (in a seperate script) would then need to read the value for example using jQuery. var aValue = $("#myVal").val(); I use the first method for common stuff such as adding a date format string that is specific to the user on to every page. They will have global scope so be careful with naming.
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45521253
has text: how is `clearStorage()` getting called?
type: Comment
score: 2
comment on: http://stackoverflow.com/q/28608659
type: QuestionComment

http://stackoverflow.com/comment/45516428
comment on: http://stackoverflow.com/a/28605612
type: Comment
has text: Only thing that gets the facebook and twitter images to show is `jQuery('body').trigger( 'post-load');` any idea why the google plus and pinterest buttons aren't showing?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45516637
score: 0
type: Comment
has text: Lodash find will return the element found - https://lodash.com/docs#find. The only way it would return an array is if the element found is an array
type: AnswerComment
comment on: http://stackoverflow.com/a/28604950

http://stackoverflow.com/comment/45633455
score: 0
has text: `/^(\d+\/)*\d+$/.test('2/4/6')`
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28669676

fractions
type: Tag
tags question: http://stackoverflow.com/q/28705304
tag name: fractions

http://stackoverflow.com/a/28647235
answers question: http://stackoverflow.com/q/28638913
downvote count: 0
has body: If you want to start a download this is the way to go: If you have more than one file to save: Pack it into a zip file. I wrote a dart based zip library (available at https://github.com/roberthartung/zip.dart). They key point is to use the zip file format for archiving data and not for compression (because this is really slow). If you have only one file (zip or any other format) you can load it into a blob and let the user download the blob like this: Code Blob blob = new Blob(...); AnchorElement a = new AnchorElement(); a.style.display = 'none'; document.body.append(a); String url = Url.createObjectUrlFromBlob(blob); a.href = url; a.download = "file.name"; a.click(); Url.revokeObjectUrl(url); For chrome only there is the deprecated FileSystem API, which you could use to save persistent data, but I guess you want a download.
type: AcceptedAnswer
type: Answer
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/45620437
accepted answer of: http://stackoverflow.com/q/28638913

http://stackoverflow.com/q/28730163
has answer: http://stackoverflow.com/a/28730276
has comment: http://stackoverflow.com/comment/45746551
upvote count: 0
type: UnansweredQuestion
score: -3
has body: I have I file named dump.json of the form: [{"key": "XYZ", "values": [[1424642400000, 28], [1424728800000, 80], [1424815200000, 92]]}] and, what I would like to do is loading it somehow in JavaScript under the variable name histcatexplong: var histcatexplong = [{"key": "XYZ", "values": [[1424642400000, 28], [1424728800000, 80], [1424815200000, 92]]}]; How can I do that?
type: Question
linked to: http://stackoverflow.com/q/7346563
downvote count: 3
has comment: http://stackoverflow.com/comment/45746835
has comment: http://stackoverflow.com/comment/45746599
has comment: http://stackoverflow.com/comment/45746629
answer count: 2
has comment: http://stackoverflow.com/comment/45746603
linked to: http://stackoverflow.com/q/8567114
tagged with: javascript
favorite count: 0
has title: How to load a local file in Javascript
has answer: http://stackoverflow.com/a/28730259

http://stackoverflow.com/q/28679591
score: 0
tagged with: canvas
has answer: http://stackoverflow.com/a/28680144
answer count: 1
tagged with: jquery
type: UnansweredQuestion
has title: Error drawing arrow in canvas
has comment: http://stackoverflow.com/comment/45652861
type: Question
has body: I write code but it's not run. I have 2 tag canvas. When i change properties height of canvas < 100 then arrow hidden. And if i didn't write tag div before tag canvas its run normal. Thank you for support!!!! Source code: LOL Brower of you doesn't not support Canvas Yolooooooooooo Brower of you doesn't not support Canvas function canvas_arrow(context, fromx, fromy, tox, toy){ var headlen = 20; // length of head in pixels var dx = tox-fromx; var dy = toy-fromy; var angle = Math.atan2(dy,dx); context.moveTo(fromx, fromy); context.lineTo(tox, toy); context.lineWidth=2; context.moveTo(tox, toy); context.lineTo(tox-headlen*Math.cos(angle+Math.PI/6),toy-headlen*Math.sin(angle+Math.PI/6)); context.moveTo(tox, toy); context.lineTo(tox-headlen*Math.cos(angle-Math.PI/6),toy-headlen*Math.sin(angle-Math.PI/6)); } $('document').ready(function(){ var count= parseInt($("canvas").length); for(var i=0; i< count; i++){ var ctx= $("canvas")[i].getContext('2d'); ctx.beginPath(); //var x= $('#c').offset().left-15; //var y= $('#c').offset().top-15; var x= $('#'+$("canvas")[i].id).offset().left; var y= $('#'+$("canvas")[i].id).offset().top+15; var x1= x+100; canvas_arrow(ctx,x,y,x1,y); ctx.stroke(); } });
tagged with: javascript

http://stackoverflow.com/a/28603671
has body: This is another way which is some kind comfortable and beautiful for you will keep overview, syntax highlighting and don't have to fight with the quotes: &lt;?php ob_start(); // start output buffering ?&gt; &lt;!-- mark that there is no more php following, but HTML --&gt; &lt;!-- copy your js here (without the very first quotes) --&gt; &lt;script type="text/javascript"&gt; function outf(text) { var mypre = document.getElementById("output"); mypre.innerHTML = mypre.innerHTML + text; } // ............ &lt;/script&gt; &lt;?php $script = ob_get_contents(); ob_end_clean(); fwrite($fh, $script); this will write your js to the file
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/28603505
score: 0
type: Answer

http://stackoverflow.com/a/71488166
has body: I am also new to firebase, faced the same issue as yours. Found out that this is expected if you used ServerValue.TIMESTAMP. when you write a server-side timestamp, the client gets two events. The first event that fires is a local estimate of the server timestamp, based on the local time, and the detected latency between the client and server. The second event is the actual value as the server determined it. If you're writing the timestamp to a new node, the first of these events will typically be a child_added, while the second will be a child_changed. https://github.com/firebase/firebase-js-sdk/issues/2461 https://firebase.google.com/docs/reference/js/v8/firebase.database.ThenableReference#on
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28616541
type: Answer
downvote count: 0

http://stackoverflow.com/comment/45540743
type: Comment
has text: The `input[name="text"]` means when you write a new value then this value is posting from database. And then the new value showing in `.chnged`but your code is only showing New text.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28618860

http://stackoverflow.com/comment/45709181
has text: Why do you want to know if someone clicks? And no it is not possible
comment on: http://stackoverflow.com/q/28710127
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45609856
has text: @LucasTrzesniewski I've tried to point out X problem.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28652546

http://stackoverflow.com/q/28621599
accepted answer: http://stackoverflow.com/a/28621682
has comment: http://stackoverflow.com/comment/45562203
has comment: http://stackoverflow.com/comment/45545574
type: AnsweredQuestion
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/99110923
tagged with: function
tagged with: palindrome
tagged with: javascript
has body: I was completing javascript exercises and got stuck on creating a function which checks if a string is a palindrome. For your reference, this was the given solution. I understand what slice() does as a method, and I followed the function here until the point where it checks to see if the first letter matches the last. if (cstr[x] != cstr.slice(-1-x)[0]) What is going on with the parameter values of the slice method? I was expecting the parameters to slice the last letter and I presume it does but I would appreciate some help in pointing out how!
tagged with: slice
has answer: http://stackoverflow.com/a/28621682
has comment: http://stackoverflow.com/comment/45545435
possible better answer: http://stackoverflow.com/a/28621695
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28621695
favorite count: 0
has title: I need an explanation on slice()

http://stackoverflow.com/comment/45716872
comment on: http://stackoverflow.com/q/28714544
has text: Welcome to Stack Overflow! Please reproduce your problem in the snippet you've provided.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/28601997
has body: Add the language code as a url parameter $stateProvider .state('home', { url: '/:langcode/home', templateUrl: baseTemplateUrl + "home.html", controller: 'homeController' }); And in your controller, get langcode value using $stateParams $scope.language = $stateParams.langcode;
answers question: http://stackoverflow.com/q/28601801
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45510335
type: AcceptedAnswer
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28601801
type: Answer

http://stackoverflow.com/a/28715096
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45717836
answers question: http://stackoverflow.com/q/28714788
has body: The function works as inteded assuming that there is exactly one reference to the object in the array. If the object isn't in the array (or you are calling it with a clone of an object in the array), the index will be -1 and the splice call will remove the last item in the array instead. As this is not a reasonable behaviour, there should really be a check for that (which I see that you added). The indexOf method works reliably for object references, but it natually has to be looking for the same object. Looking for an object with a specific propery value would also work, but it goes with the same assumptions; the value has to occur exactly once in the array to work as intended.

http://stackoverflow.com/q/28716371
score: 0
has comment: http://stackoverflow.com/comment/45720830
has title: SyntaxError in CasperJS when edited through WinSCP
tagged with: casperjs
has comment: http://stackoverflow.com/comment/45720505
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28717122
tagged with: winscp
type: Question
tagged with: syntax-error
has comment: http://stackoverflow.com/comment/45720980
answer count: 1
has body: I have a problem with a casperjs script : var casper = require('casper').create(); console.log("casper create OK"); casper.start("https://my-ip/login_page.html", function() { console.log("Connexion URL OK"); // set a wait condition to make sure the page is loaded (particularly iframe in my case) this.wait(5000,function(){ console.log("Attente 5 sec OK"); //fill out the form this.fillSelectors("form[name='lf']",{ 'input#user' : "my_login", 'input#pass' : "my_password" }); console.log("Renseignement login et pass OK"); // click the login button this.click("input[name='loginsub']"); console.log("Passage bouton login OK"); // switch to iframe (won't be necessary for most) this.page.switchToChildFrame('mainframe'); console.log("Switch iframe OK"); // Test d'une zone sur la page pour valider la connexion casper.waitForSelector('.area-status', function() { console.log("Validation element sur la page OK"); }); }); }); // Check etat de l'alarme général // Check status des zones de l'alarme casper.run(); When I launch my script, I have this error : [root@srv-linux bin]# casperjs script.js SyntaxError: Parse error When I check my script on http://esprima.org/demo/validate.html I say all is OK (no error syntax). This error happens when I change the script through WinSCP. Can you help me?
tagged with: javascript
has comment: http://stackoverflow.com/comment/45721145

http://stackoverflow.com/a/73492898
score: 0
answers question: http://stackoverflow.com/q/28603765
has body: this can be also helpful... to print values... data.map( a =&gt; a.infoType.map( b =&gt; b[0] ) ).flat()
type: Answer

http://stackoverflow.com/comment/45545896
type: Comment
has text: No problem, welcome to stackoverflow. See this updated [plunker](http://plnkr.co/edit/MwmJxzMXGHRsS8HwMJDi?p=preview) - it is inside `ng-repeat` where you can pass a second value to the filter using another `:` like this: `tempo:'Temp':filter.value`. Also note the function taking a 3rd parameter: `function(items, field, value)`.
score: 0
comment on: http://stackoverflow.com/a/28621763
type: AnswerComment

http://stackoverflow.com/q/28628326
has title: Chaining Angular Filters in Javascript (not HTML)
score: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: filter
tagged with: chaining
has body: New to Angular, and I've found a lot of examples for using multiple Angular filters in HTML (with an ng-repeat) -- e.g. -- but I can't find a good example for how to achieve that same filter chaining in Javascript. I am currently achieving this with an overarching single function that cycles through filters -- e.g. (in Coffee Script) $filter('filter')( places, placeFilters ) placeFilters: (place) -&gt; result = place result = functionA(result) result = functionB(result) etc... I am curious if there is a better (cleaner and more efficient) path?
favorite count: 0
tagged with: angularjs
answer count: 0
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/q/28714357
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28851300
tagged with: requirejs
has title: JavaFX + Javascript : How to inject a Java object to an AMD module
type: AnsweredQuestion
tagged with: java
tagged with: javafx
tagged with: amd
has body: While experimenting JavaFX + HTML5/JS, and I've come across AMD modules (RequireJS). I know how to inject Java objects and use them within the "old-fashioned" Javascript (everything in the global scope), but I'm now wondering how I to inject a Java object in a RequireJS module. Any advice? Update 1 As I feel that I didn't make myself clear enough, let me be more specific. My goal is to display my Javascript logs both on the browser console and the Java console because I don't want to include firebug-lite.j. To do that (in a simplified way): Java:: create a DummyLogger class . public class DummyLogger { void log(String msg) { System.out.println("LOG (JS) : " + msg); } } Java:: add a DummyLogger instance to the Javascript window object . WebView webView = new WebView() webView.getEngine().load("index.html"); // Inject our Java logger interface to JS final JSObject jsWnd = (JSObject) webView.getEngine().executeScript("window"); jsWnd.setMember("javaLogger", logger); Javascript:: In my module "module/logger.js", expose a log function that uses both the JS console and the javaLogger if it is defined . define(function() { return { log: function(message) { console.log(message); // Forward to the injected Java logger only if it is defined if(typeof javaLogger !== 'undefined') { javaLogger.log(message); } } } } Now, I'm wondering whether or not it is possible to inject the javaLogger object to the logger module without polluting the window namespace (which is kindda the point of AMD...). My idea was to do something like: add a function setJavaLogger(logger) on the JS logger module. use that setter to inject the javaLogger directly to the logger module . WebView webView = new WebView() WebEngine engine = webView.getEngine(); engine.getLoadWorker().stateProperty().addListener( (observable, oldState, newState) -> { if (newState == Worker.State.SUCCEEDED) { final JSObject retVal = (JSObject) engine.executeScript( "require(['module/logger'], function(logger) { return logger; });"…
has comment: http://stackoverflow.com/comment/45804905
type: Question
has answer: http://stackoverflow.com/a/28851300
answer count: 1

http://stackoverflow.com/comment/45701309
has text: It just seems like there should be a way of checking if client side validation was called and if passed then don't run server side validation.
type: AnswerComment
comment on: http://stackoverflow.com/a/28705294
score: 0
type: Comment

http://stackoverflow.com/a/29085788
answers question: http://stackoverflow.com/q/28600967
has body: I am (pretty) sure this is not possible. Not even the Chrome-debugger keeps track of your scope all the time, but only when it hits a breakpoint. Keeping track of the scope chain for all the time would cost way too much memory (depending on the complexity of your closures and contexts). See this feature request for further information: https://groups.google.com/forum/#!topic/google-chrome-developer-tools/wKEMpKjXR7s ECMA 262 (10.3.1) describes how Identifier Resolution has to be done, the most important part of this is to call GetIdentifierReference (lex, name, strict) which is described in ECMA 262 (10.2.1). As far as I know there is no command in any implementation of ECMAScript to call this function at runtime. However this question (or to be precise it's answer) might be interesting as it comes at least closer to what you asked for.
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28600967
score: 9
upvote count: 9

http://stackoverflow.com/q/28689263
favorite count: 0
upvote count: 5
type: AnsweredQuestion
downvote count: 0
type: Question
has body: Currently, for detecting touchscreen devices I use this in my javascript: if ('createTouch' in document) { // do touchscreen-specific stuff } I see that many developers use ontouchstart, like this: if ('ontouchstart' in document) { // do touchscreen-specific stuff } What is the difference between createTouch and ontouchstart? Which one is the safest to use? Are there some other simple, reliable alternatives to these two?
score: 5
accepted answer: http://stackoverflow.com/a/28754832
tagged with: javascript
has title: createTouch vs ontouchstart - best way to detect touchscreen devices?
tagged with: touch
possible better answer: http://stackoverflow.com/a/28737039
answer count: 2
has answer: http://stackoverflow.com/a/28754832
has answer: http://stackoverflow.com/a/28737039
tagged with: jquery

http://stackoverflow.com/comment/45661987
has text: @Dalek But adeneo's code shows that you don't NEED to save `i` in your closures. Use a named function, and it can access the image element using `this`.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28684350
type: QuestionComment

http://stackoverflow.com/q/28664217
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/45623603
has comment: http://stackoverflow.com/comment/45623755
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28665648
accepted answer: http://stackoverflow.com/a/28665648
type: Question
has comment: http://stackoverflow.com/comment/45623663
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/45623388
answer count: 1
has body: I have this situation: my website, which I am creating, has a left sidebar, which must be set to height 100%, while scrolling the webpage, and the content inside it is definitely over 1000px height. because of the height of the content, I get vertical scroll on this sidebar element, and when my content has enough content, I get another scroll for this section. What I have to do is to, somehow, transfer, scroll from the "fixed" element to the main page scroll... I hope that you can understand me... I hope that this screenshot, can also help you to understand what I ask: link Thank you in advance for you answers.
has title: Position fixed, but scroll on

http://stackoverflow.com/comment/45642819
has text: you have to send the public key in the data property as a json
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28674628
type: Comment

http://stackoverflow.com/q/28737155
type: AnsweredQuestion
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28737174
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
favorite count: 0
has title: unrecognized expression: jQuery syntax issue
has answer: http://stackoverflow.com/a/28737174
has comment: http://stackoverflow.com/comment/45758397
upvote count: 1
has body: $("#divItemName input:[type='text']").val(itemName); i have the above jQuery line of code. It works properly in jQuery 1.7.2 but in jquery-2.1.3, it throws the error below. Error: Syntax error, unrecognized expression: #divItemName input:[type='text'] What is the correct syntax for this in jquery-2.1.3?

http://stackoverflow.com/a/47766790
type: Answer
downvote count: 0
has body: Use 'drawCallback' to solve this problem. 1.On the webpage, use developer tool to inspect the 'previous' button, then you will find a div element that wraps both the 'previous' and 'next' buttons. DataTables automatically assigned an id to this div based on your html table element's id. For example, I have a table with id 'Atable'. In this table, DataTables automatically created a div element with id called 'Atable_paginate' to wrap the previous and next buttons. 2.For drawCallback, we write a function which checks if there is less than 1 page, if so, we hide element by utilising id. For example, you have set there are 20 records on one page by pageLength: 20, which means if there are less then 20 records, we don't need to display 'previous' and 'next' buttons. So we write like below, drawCallback: function(settings){ if($(this).find('tbody tr').length &lt;= 20){ $('#Atable_paginate').hide(); } } 3.The initialization of Atable should be like below var table = $('#Atable').DataTable({ pageLength: 20, lengthChange: false, drawCallback: function(settings){ if($(this).find('tbody tr').length &lt;= 20){ $('#Atable_paginate').hide(); } } }); 4.If there are more than one table on the webpage, apply this method on each table.
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/28593854

http://stackoverflow.com/q/28615546
tagged with: javascript
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28616549
tagged with: http://stackoverflow.com/tag/html
has body: I need to reload image on page. I trying this: $("#ill2d").attr("src", decision.Illustration + "#" + new Date().getTime()); But, image toggle on alt text. If I press F5, it work, and image is reloaded. UPDATE I tried to do as advised: $("#ill2d").attr("src", decision.Illustration + "?time=" + new Date().getTime()); But it still does not work, image toggle on alt text.
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28615794
type: Question
has title: How to reload image on page, with same URL?
has answer: http://stackoverflow.com/a/28615602

http://stackoverflow.com/comment/45545292
type: Comment
comment on: http://stackoverflow.com/a/28621254
type: AnswerComment
has text: Thanx for the reply, I try this code. but it returns the http://whatismyipaddress.com/. I like to return the ip address of machines. For example when i used my machine my ip is 192.168.1.x.
score: 0

http://stackoverflow.com/comment/45541712
type: QuestionComment
score: 1
has text: Ask them just to click run in `R-Fiddle`.
comment on: http://stackoverflow.com/q/28617928
type: Comment

http://stackoverflow.com/q/28650364
type: Question
tagged with: infinite-loop
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45601881
has comment: http://stackoverflow.com/comment/45600096
has comment: http://stackoverflow.com/comment/45599830
tagged with: angularjs
type: UnansweredQuestion
has title: AngularJS infinite loop with # at end of url
answer count: 0
has body: I have: $routeProvider.when('/here/:id',{ templateUrl: '/this' , controller: 'that' }) and I am using: $locationProvider.html5Mode(true); With AngularJS 1.2.27 If I browse to: /here/1234# angular goes into an infinite loop. How do I prevent this? I don't need the # at the end, but I do need to prevent the infinite loop. Thanks! [edit] It seems this happens with other angularjs apps as well, I tried a random example here (see the console): http://hike.io/discover#

http://stackoverflow.com/comment/45680086
has text: sorry - my bad, edited :)
comment on: http://stackoverflow.com/a/28694618
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28665648
has body: Your question got me interested, so I gave it a try. You could have your sidebar set up like so: #sidebar{ position:fixed; min-height:100%; top:0; left:0; /* ... */ } Now, to make it scroll, we can play with its margin-top css property: If we scroll down, we decrement it unless we scrolled past its height. If we scroll up, we increment it unless it's above zero. I created a ScrollingSidebar class with 2 functions in order to deal with that: // ScrollingSidebar class // Define some variables and bind events function ScrollingSidebar(el){ this.sidebar = el; var that = this; that.updateVariables(); document.addEventListener('scroll',function(){that.scrollSidebar();}); window.addEventListener('resize',function(){that.updateVariables();}); } // Updates variables used for calculation ScrollingSidebar.prototype.updateVariables = function(){ this.height = parseInt( getComputedStyle(this.sidebar).height ); document.body.style.minHeight = this.height + 'px'; this.winHeight = parseInt( window.innerHeight ); this.previousScrollPos = Math.floor( document.body.scrollTop || document.documentElement.scrollTop || document.body.parentNode.scrollTop ); this.scrollSidebar(); }; // Updates the sidebar's margin-top ScrollingSidebar.prototype.scrollSidebar = function(){ var curScrollPos = Math.floor( document.body.scrollTop || document.documentElement.scrollTop || document.body.parentNode.scrollTop ); if(this.previousScrollPos &lt; curScrollPos){ this.sidebar.style.marginTop = - Math.min(-parseInt( getComputedStyle(this.sidebar).marginTop ) + (curScrollPos - this.previousScrollPos), this.height-this.winHeight) + 'px'; } else { this.sidebar.style.marginTop = Math.min(0,parseInt( getComputedStyle(this.sidebar).marginTop ) + this.previousScrollPos-curScrollPos) + 'px'; } this.previousScrollPos = curScrollPos; }; You can use it like so: // Create an instance of ScrollingSidebar var sidebar = document.getElementById('sidebar'); var x = new ScrollingSidebar(sidebar); JS Fiddle Demo (with a smal…
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28664217
answers question: http://stackoverflow.com/q/28664217
has comment: http://stackoverflow.com/comment/46147370

http://stackoverflow.com/comment/62396322
has text: I had to add `parseInt` to make this work properly. I'm pretty sure it's because my sort array was > 10 items and the sortObj was a collection of strings. So: `return parseInt(sortObj[x[0].Id]), 10)`
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28673833

http://stackoverflow.com/comment/45708686
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28709843
has text: Ah duh... I just figured it out by your response.

http://stackoverflow.com/a/28596634
has comment: http://stackoverflow.com/comment/45499769
accepted answer of: http://stackoverflow.com/q/28596211
type: Answer
has body: If you want to continue on the path of regular expressions, this seems to work: var $mathKeywords = ["E", "LN2", "LN10", "LOG2E", "LOG10E", "PI", "SQRT1_2", "SQRT2", "abs", "acos", "asin", "asinh", "atan", "atan2", "atanh", "cbrt", "ceil", "clz32", "cos", "exp", "expm1", "floor", "fround", "hypot", "imul", "log1p", "log10", "log2", "max", "min", "pow", "random", "round", "sin", "sinh", "sqrt", "tan", "tanh", "trunc"]; var $resultVal = "acosh(1)+cos(PI/3)".toLowerCase(); try { //Iterate over each Math object/method $.each($mathKeywords, function (i, val) { //Convert val within array to a lower case form var $lowerKey = val.toLowerCase(); var pattern = new RegExp("\\b" + $lowerKey + "\\b", "g"); //See if pattern gives a match within $resultVal var $location = $resultVal.match(pattern); //Math keyword is found if ($location != null) { //replace the lowercase version of the math keyword with its properly cased version prepended //with Math. i.e. cos becomes Math.cos and pi becomes Math.PI $resultVal = $resultVal.replace(pattern, "Math." + val); } }); //Set the result element's value to an evaluation of $resultVal //A better implementation of the eval exists within the calc program console.log($resultVal); console.log(eval($resultVal)); } catch (err) { alert("Error: Cannot process expression due to " + err + "."); } Output: acosh(1)+Math.cos(Math.PI/3) (actually its Error: Cannot process expression due to ReferenceError: acosh is not defined. but you get the point) Changes: Use \b as a word boundary Use pattern (with word boundary) in replacement Use g flag to replace all occurrences.
has comment: http://stackoverflow.com/comment/45499786
score: 5
upvote count: 5
has comment: http://stackoverflow.com/comment/45499848
has comment: http://stackoverflow.com/comment/45499760
has comment: http://stackoverflow.com/comment/97555035
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28596211

http://stackoverflow.com/a/28630466
has body: You're inserting a new object into that array -> newObj For example, if you run this in Chrome console, works fine : function aHandler (){ var a = [{1:1},{1:2},{1:3},{1:4},{1:5}]; a.splice(3,0,{1:20}); console.log(a); }; aHandler(); Even if you insert null or undefined console.log should show you the right object. So, maybe you modify the object somewhere between splice and console.log
accepted answer of: http://stackoverflow.com/q/28630275
has comment: http://stackoverflow.com/comment/45562224
score: 0
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/28630275

http://stackoverflow.com/comment/45590306
has text: combine them and use content function to return data based on element type
comment on: http://stackoverflow.com/q/28645242
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28691492
has comment: http://stackoverflow.com/comment/45674663
type: UnansweredQuestion
has title: Regex Conversion From Javascript to Java
linked to: http://stackoverflow.com/q/2959316
has comment: http://stackoverflow.com/comment/45674413
tagged with: javascript
type: Question
tagged with: regex
score: 0
answer count: 1
has body: I am working on client-server application in java, (converting some code from java-script). I am struck. In java i am sending values to server by embedding in namevaluepairs. But after putting values i am getting empty json in java, which is working in javascript (values sending via GET using web forms ). Here it javascript form statement: &lt;input type="text" name="criteria" value= 'Email=="wei.wang_zh@pcstars.com"'&gt; and here is java namevaluepair statement in which i am getting issue: nameValuePairs.add(new BasicNameValuePair("criteria", "'Email==\"wei.wang_zh@pcstars.com\"'")); I have tried to put string in a String data type, which is also not working. Here it is String val="wei.wang_zh@pcstars.com"; nameValuePairs.add(new BasicNameValuePair("criteria", "'Email==\""+val+"\"'")); Please let me know what mistake i'm doing in both cases. Thanks
has answer: http://stackoverflow.com/a/28691869
tagged with: java

http://stackoverflow.com/comment/45683501
has text: `$("#submit")` what is it? an input button or a customized anchor?
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/28696540

http://stackoverflow.com/a/28722382
answers question: http://stackoverflow.com/q/28722307
score: 0
type: Answer
has body: Just spitballing here, but I'd start by capturing frames that are close together at various points throughout the video. You would take the frames from each section and compare them to each other for variations in composition, dunno how to best go about that.. I'd probably start with like colour detection in various spots? anyway, start building a "difference score" once you've gone through the frames for each section you sampled, you'll have a "difference score" and you can then start trying to figure out what the cut off point is for detecting a shakey video. you probably couldn't do this anywhere close to realtime, so be prepared to have a bit of a wait period while the video processes.

http://stackoverflow.com/comment/45729076
type: Comment
comment on: http://stackoverflow.com/a/28714576
has text: Thanks, I will try it with my SSO token instead of the API console ;)
type: AnswerComment
score: 0

http://stackoverflow.com/q/28696960
upvote count: 7
downvote count: 1
answer count: 1
accepted answer: http://stackoverflow.com/a/28697046
has comment: http://stackoverflow.com/comment/45684156
has body: Web development and Angular are completely new to me. I have created module , factory and controller in a same file (app.js). Below is the sample code //Main Module var ipCharts = angular.module('ipCharts', []); //Factory ipCharts.factory('securityFactory', function ($http) { var securities = {}; $http.get('api/Securities'). success(function (data, status, headers, config) { securities = data; }). error(function (data, status, headers, config) { // log error }); var factory = {}; factory.getSecurities = function () { return securities; } return factory; }); //Controller ipCharts.controller('securityController', function ($scope,securityFactory) { $scope.securities = securityFactory.getSecurities(); }); I am wondering how module, factory and controller can be placed in separate files. I can place the controller in a separate file when the controller is not making any reference to the factory. I cant get it working when controller using the factory and the factory is in a separate file. Thanks
type: AnsweredQuestion
tagged with: javascript
score: 6
favorite count: 0
type: Question
has title: Angular JS controller and Factory in separate files
tagged with: angularjs
has answer: http://stackoverflow.com/a/28697046

http://stackoverflow.com/comment/45698090
type: Comment
type: QuestionComment
has text: Thanks. I was searching all over stack overflow and couldn't find an answer. I think I was probably wording my search incorrectly since I am still new to this.
score: 0
comment on: http://stackoverflow.com/q/28687550

http://stackoverflow.com/q/28733123
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28733318
tagged with: javascript
has body: I'm trying to create spans and append split string as characters within each span. So, given the message below, it'd be something like th etc... For some reason, I'm getting this error when I append to document body. Why? Uncaught TypeError: Cannot read property 'appendChild' of null I've also tried document.getElementById("body").appendChild(letter); with the same error. Stack trace: Uncaught TypeError: Cannot read property 'appendChild' of null myFunc (anonymous function)
has title: create span and append text
accepted answer: http://stackoverflow.com/a/28733298
linked to: http://stackoverflow.com/q/799981
has comment: http://stackoverflow.com/comment/45751933
has comment: http://stackoverflow.com/comment/45751925
has comment: http://stackoverflow.com/comment/45752131
has comment: http://stackoverflow.com/comment/45751969
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28733298
possible better answer: http://stackoverflow.com/a/28733318
type: Question
has comment: http://stackoverflow.com/comment/45752107

http://stackoverflow.com/q/28736522
answer count: 2
has body: Want to create a web application (using html/css + javascript) that logs in to a linux based storage device, Process some logs of the storage device (using perl) and return the result to the web application. What/How to use as a connector between them? And which one would be the simplest to do so?
tagged with: frontend
has answer: http://stackoverflow.com/a/28739791
has title: Front-end : html/css+javascript, Backend : perl
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28739791
score: 0
tagged with: backend
type: Question
possible better answer: http://stackoverflow.com/a/28736731
has comment: http://stackoverflow.com/comment/45758592
tagged with: perl
has answer: http://stackoverflow.com/a/28736731
tagged with: javascript

http://stackoverflow.com/comment/45587492
type: Comment
score: 1
has text: Yes it's a global variable. Replace the line with `var $elem = $(this)`. jQuery isn't doing anything here, it's the way JavaScript as a language is designed.
comment on: http://stackoverflow.com/q/28644730
type: QuestionComment

http://stackoverflow.com/a/28679303
has body: &lt;?php $sql = mysql_query("INSERT INTO `personalinfo` (`lname`) VALUES ('". $lname ."')"); $sql2 = mysql_query("INSERT INTO `pep` (`agency`) VALUES ('". $agency ."')") $sql3 = mysql_query("INSERT INTO `training` (`trorganizer`) VALUES ('". $trorganizer ."')"); ?&gt;
upvote count: 0
has comment: http://stackoverflow.com/comment/45651637
has comment: http://stackoverflow.com/comment/45651570
has comment: http://stackoverflow.com/comment/45651759
downvote count: 2
has comment: http://stackoverflow.com/comment/45651572
score: -2
has comment: http://stackoverflow.com/comment/45651798
type: Answer
answers question: http://stackoverflow.com/q/28679164

http://stackoverflow.com/q/28638627
tagged with: kineticjs
has answer: http://stackoverflow.com/a/28639225
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28639225
has comment: http://stackoverflow.com/comment/45577075
has body: I want to draw a line on a canvas with context.globalCompositeOperation = 'destination-out'; context.globalAlpha = 0.118; The result looks like this: The background if the image is a yellow rectangle. I use a circle to drag and drop it over the image and it will paint the line. As you can see my drawn line is not so smooth. You can see the circles and you do not have a compound line. I created a JSFiddle here: console.clear(); var history = new Array(); var imageObj = new Image(); var img = null; stage = new Konva.Stage({ container: 'container', width: 600, height: 400 }); layer = new Konva.Layer(); stage.add(layer); var rect = new Konva.Rect({ x: 30, y: 30, width: 438, height: 300, fill: 'yellow' }); layer.add(rect); var canvas = document.createElement('canvas'); var context = canvas.getContext('2d'); var circle = new Konva.Circle({ x: 0, y: 0, radius: 40, opacity: 0.7, fill: '#ff5e0a', stroke: '#d95009', strokeWidth: 1, draggable: true }); layer.add(circle); circle.on('dragmove touchmove', function (e) { erase(e.evt.clientX, e.evt.clientY, circle.radius(), img.x(), img.y()); }); imageObj.onload = function () { canvas.width = imageObj.width; canvas.height = imageObj.height; context.drawImage(imageObj, 0, 0, imageObj.width, imageObj.height); img = new Konva.Image({ x: 30, y: 30, image: canvas }); layer.add(img); circle.moveToTop(); layer.draw(); }; imageObj.crossOrigin = "anonymous"; imageObj.src = "https://dl.dropboxusercontent.com/u/47067729/darth-vader.jpg"; function erase(absX, absY, radius, imgX, imgY) { var x = 0; var y = 0; // set pointer circle.x(absX); circle.y(absY); x= absX - imgX; y= absY - imgY; context.globalCompositeOperation = 'destination-out'; context.globalAlpha = 0.118; context.beginPath(); context.arc(x, y, radius, 0, 2 * Math.PI); context.fill(); layer.draw(); } How can I draw more smooth and compound lines where you cannot see each small chunk of the circles?
has answer: http://stackoverflow.com/a/77457700
has title: Draw smooth Lines on a Canvas
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/77457700
has comment: http://stackoverflow.com/comment/45577459
has comment: http://stackoverflow.com/comment/45579885
has comment: http://stackoverflow.com/comment/45577542
type: Question
tagged with: konvajs
answer count: 2
has comment: http://stackoverflow.com/comment/45577046
tagged with: javascript
has comment: http://stackoverflow.com/comment/45979336
score: 0

http://stackoverflow.com/comment/45732180
type: QuestionComment
has text: Try using a webworker to do all your computations instead of running it in the main thread. maybe that will help the fps issues a bit. also if your target is android, please... make an app, it will work much smoother. Then you can give users an option, install app or play in browser, but the app will be faster.
type: Comment
comment on: http://stackoverflow.com/q/28716353
score: 0

http://stackoverflow.com/q/28596427
has comment: http://stackoverflow.com/comment/45499477
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28596595
has title: Button resizing changing all design
type: Question
has comment: http://stackoverflow.com/comment/45499565
has body: Hi I a creating a button using three divs and all divs have background images. This is how it looks like. Button Demo The button is fine but how can i resize it ?? I am doing like .btncontainer{ position:absolute; top:120px; left:120px; cursor:pointer; display:inline-block; width:120px; height:20px; } But it is changing the button design. What can i do to resize it dynamically with the text? i want to look like this if the size is changed for example this image has different sizes. So when i changing the .btncontainer then it should change the width and height of the elements inside it but this is not happening
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/45499554
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/45499452
has answer: http://stackoverflow.com/a/28596595
tagged with: css

http://stackoverflow.com/comment/45671577
comment on: http://stackoverflow.com/q/28689918
has text: Go for `addEventListener` in case of browsers other than IE..`document.querySelector('input[type="button"]').addEventListener('click', function() { alert(1); }); `
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28648201
accepted answer of: http://stackoverflow.com/q/28648052
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28648052
type: Answer
has body: You just need to finsih your code and use the correct config & xtype. I have copied your code and created a grid in this fiddle without any issues, code is also below in case the link breaks. Ext.application({ name: 'MyApp', launch: function() { Ext.create('Ext.data.Store', { storeId: 'simpsonsStore', fields: ['name', 'email', 'phone'], data: { 'items': [{ 'name': 'Lisa', "email": "lisa@simpsons.com", "phone": "555-111-1224" }, { 'name': 'Bart', "email": "bart@simpsons.com", "phone": "555-222-1234" }, { 'name': 'Homer', "email": "homer@simpsons.com", "phone": "555-222-1244" }, { 'name': 'Marge', "email": "marge@simpsons.com" , "phone": "555-222-1254" }] }, proxy: { type: 'memory', reader: { type: 'json', rootProperty: 'items' } } }); Ext.create('Ext.container.Viewport', { layout: 'border', items: [{ region: 'north', html: ' Page Title ', border: false, margin: '0 0 5 0' }, { region: 'west', title: 'Navigation', width: 250, collapsible: false, items: { // I want to add it just there xtype: 'grid', title: 'Simpsons', store: Ext.data.StoreManager.lookup('simpsonsStore'), columns: [{ text: 'Name', dataIndex: 'name' }, { text: 'Email', dataIndex: 'email', flex: 1 }, { text: 'Phone', dataIndex: 'phone' }], listeners: { rowdblclick: function(grid, record, tr, rowIndex, e, eOpts) { alert(record.get("name")); } }, height: 200, width: 400, } }, { region: 'south', title: 'South Panel', collapsible: true, html: 'test test', split: true, height: 100, minHeight: 100 }, { region: 'east', title: 'East Panel', collapsible: true, split: true, width: 150 }, { region: 'center', xtype: 'tabpanel', activeTab: 0, items: { title: 'test Tab', html: '' } }] }); } });

http://stackoverflow.com/q/28658951
tagged with: geocomplete
answer count: 3
downvote count: 0
has answer: http://stackoverflow.com/a/36364231
favorite count: 0
has answer: http://stackoverflow.com/a/28781947
possible better answer: http://stackoverflow.com/a/29813708
has comment: http://stackoverflow.com/comment/47754091
has answer: http://stackoverflow.com/a/29813708
type: AnsweredQuestion
upvote count: 3
has comment: http://stackoverflow.com/comment/45837253
type: Question
has title: Submitting geocomplete form on suggestion select
accepted answer: http://stackoverflow.com/a/28781947
score: 3
has comment: http://stackoverflow.com/comment/45613793
has body: I'm fairly new to JS so I'm a bit confused as in why this is not working. Basically I'm using the geocomplete jQuery plugin to populate a form with the coordinates and address. Then, once a user selects the destination, I want to sumbit the form. &lt;form action="search.php" method="post" id="searchForm"&gt; &lt;input id="geocomplete" type="text" placeholder="Where are you going to?" size="35" /&gt; &lt;input name="lat" type="hidden" value=""&gt; &lt;input name="lng" type="hidden" value=""&gt; &lt;input name="formatted_address" type="hidden" value="" id="address"&gt; &lt;/form&gt; and this would be the scripts I call to initiate the form plugin (which works), and the script to submit the form once the value of the address has been changed by the plugin: &lt;script type="text/javascript"&gt; window.onload= function () { if(window.addEventListener) { document.getElementById('address').addEventListener('change', doIt, false); } else if (window.attachEvent){ document.getElementById('address').attachEvent("onchange", doIt); } function doIt(){ document.getElementById("searchForm").submit(); } } $("input").geocomplete({ details: "form" }); &lt;/script&gt; I don't see why this won't work since the value does get changed. Many thanks!
tagged with: javascript

http://stackoverflow.com/a/28651071
type: Answer
score: 1
upvote count: 1
has body: Just put a line now.setDate(now.getDate()-1); it will set the Date to yesterday's date. var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); var monthNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December"); var now = new Date(); now.setDate(now.getDate()-1); document.write(dayNames[now.getDay()] + ", " + monthNames[now.getMonth()] + " " + now.getDate() + ", " + now.getFullYear());
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28651032
answers question: http://stackoverflow.com/q/28651032

onclicklistener
tag name: onclicklistener
tags question: http://stackoverflow.com/q/28627606
tags question: http://stackoverflow.com/q/28614544
type: Tag

http://stackoverflow.com/a/28678645
type: Answer
has comment: http://stackoverflow.com/comment/45651986
accepted answer of: http://stackoverflow.com/q/28678467
answers question: http://stackoverflow.com/q/28678467
downvote count: 1
has comment: http://stackoverflow.com/comment/45651480
has body: You could put the message in the ViewBag and then display it that way on the client side. You dont need a partial view for this, just check server side if the bag has your message and then if so call the JS function to show a div that has you message in it. the answer here may help, you would just use something like ViewBag.NoDataMessage = "some message"; //in the controller then take the approach in the answer i linked to. Something like this @if (!string.IsNullOrWhiteSpace(ViewBag.NoDataMessage)) { &lt;script type="text/javascript"&gt; $('#MessageDiv').attr("innerHtml",'@ViewBag.NoDataMessage'); //show your div //start timer to hide the div &lt;/script&gt; }
score: 1
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/comment/45627629
type: Comment
comment on: http://stackoverflow.com/q/28666434
score: 0
type: QuestionComment
has text: what exactly do u mean by "if you're going for more than one section" ?

http://stackoverflow.com/q/28654228
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45608002
has comment: http://stackoverflow.com/comment/45605412
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28655781
has answer: http://stackoverflow.com/a/28655781
type: Question
has comment: http://stackoverflow.com/comment/45605655
has comment: http://stackoverflow.com/comment/45607574
has body: I want to make a download link. Here is my HTML: When I click tag, I want to perform an http request, and the tag really does that. But it also jumps to the new page. I do not want that to happen. I searched and found some solutions such as setting tag's href="#something", or use ajax. However, those solutions are not what I want. I am wondering there is a better solution for doing this? PS: I really do not want to use ajax to realize these in here.
has comment: http://stackoverflow.com/comment/45605676
accepted answer: http://stackoverflow.com/a/28654287
score: 0
has comment: http://stackoverflow.com/comment/45605621
answer count: 2
has comment: http://stackoverflow.com/comment/45610104
has title: How to realize that clicking tag leads to http request and do not jump to the new page?
tagged with: javascript
has answer: http://stackoverflow.com/a/28654287
linked to: http://stackoverflow.com/q/2793751

http://stackoverflow.com/a/28619411
accepted answer of: http://stackoverflow.com/q/28619230
has body: Since they are already aligned vertically, I am guessing you want them aligned horizontally. .postsocialshare ulss liss{ display:block; width:100%; } Edit: http://codepen.io/anon/pen/XJEPGY
score: 0
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/28619230
has comment: http://stackoverflow.com/comment/45541932
has comment: http://stackoverflow.com/comment/45542538
has comment: http://stackoverflow.com/comment/45542215
has comment: http://stackoverflow.com/comment/45541627

http://stackoverflow.com/comment/45581276
score: 0
has text: @mcj I'm on Version 5.1.10
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28640781

http://stackoverflow.com/a/28657283
has comment: http://stackoverflow.com/comment/45612905
type: Answer
answers question: http://stackoverflow.com/q/28657038
has comment: http://stackoverflow.com/comment/45715777
upvote count: 1
score: 1
has body: There are 2 ways to solve the problem. 1. The easier way Event delegation, you can read about it here http://learn.jquery.com/events/event-delegation/ $('.existing_div').on('click', '. APPENDED', function(){ // do something }); 2. Before append do this var elem = '&lt;div class="APPENDED"&gt;#{obj.attr}&lt;/div&gt;'; elem = $(elem); elem.on('click', function(){ // do something }); $('.existing_div').append(elem);
downvote count: 0

http://stackoverflow.com/q/28651549
has comment: http://stackoverflow.com/comment/45601356
downvote count: 0
tagged with: javascript
has body: I have a Python web application and I'd like to send a 3D array of integers to the client in an efficient way. These arrays will be fairly large, around 500x500x20 or so. The integers are all between -2000 and 2000, so can fit into a signed 12 bits. They originally represent a 3D image, so can almost certainly be compressed. I'd like to know the most efficient way to access these raw values in my JavaScript client. I'm mostly concerned about bandwidth. Is there a way to compress these losslessly as a movie or 3D image and reconstruct the original array on the client?
favorite count: 0
tagged with: image-compression
answer count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: python
score: 1
has title: Efficiently sending 3d array of ints to client
type: Question

http://stackoverflow.com/q/28741359
has comment: http://stackoverflow.com/comment/45766357
has answer: http://stackoverflow.com/a/28741811
has title: How to merge complex JS objects
has body: How can I merge two (or more) JS objects like this? The result should contain all functions (like showUser and showOtherData) and events and requests-arrays should be merged as well. var object1 = { events: { 'app.activated': 'showUser' }, requests: { }, showUser: function() { console.log("es jhsod") }, }; var object2 = { events: { 'app.destroyed': 'hideUser' }, requests: { main: { url: 'http://example/api/main', data: { format: 'json' } } }, showOtherData: function() { console.log("foobar") }, };
answer count: 2
has comment: http://stackoverflow.com/comment/45766348
downvote count: 1
possible better answer: http://stackoverflow.com/a/28741628
score: 4
has answer: http://stackoverflow.com/a/28741628
linked to: http://stackoverflow.com/q/17242927
upvote count: 5
accepted answer: http://stackoverflow.com/a/28741811
type: AnsweredQuestion
tagged with: javascript
favorite count: 0
type: Question
linked to: http://stackoverflow.com/q/171251

http://stackoverflow.com/comment/45502986
has text: because you pass it in as an argument and you name it as a parameter, it is localized to the function (e.g., `function begin(firstName)`); if you name that *firstName* something else, or refer to it as `window.firstName` inside the function, you'll be using the global
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28598303
type: QuestionComment

http://stackoverflow.com/a/28696134
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28695536
answers question: http://stackoverflow.com/q/28695536
type: Answer
upvote count: 1
score: 1
has body: Demo: http://jsfiddle.net/tqyn3/336/ var jsonData = '[{"Parent":"skystar","Children":[{"Name":"MW"},{"Name":"PR"},{"Name":"PV"},{"Name":"ST"}]},{"Parent":"RR","Children":[{"Name":"RV"},{"Name":"RP"}]}]'; $.ajax({ url: '/echo/json/', type: 'POST', data: { json: jsonData }, dataType:'json', success: function (response) { var trHTML = ''; $.each(response, function (i, item) { //alert(item.children); $.each(item.Children, function(j, child) { trHTML += '&lt;tr&gt;&lt;td&gt;' + child.Name + '&lt;/td&gt;'; }); }); $('#records_table').append(trHTML); } });

http://stackoverflow.com/comment/45668587
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28688171
has text: http://fent.github.io/randexp.js/

http://stackoverflow.com/comment/45596820
comment on: http://stackoverflow.com/a/28649537
has text: This is an overly complicated way to do it, and relies on defining 113 instances of what is essentially the same callback method. It would be much easier and more efficient to assign an id property to each XHR object and read it in the callback.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28702390
downvote count: 0
tagged with: ember-cli
favorite count: 0
has body: It appears the Qunit test methods aren't available even though I'm pretty sure I am importing them correctly. I get the following errors: unit/models/friend-test.js: line 11, col 3, 'ok' is not defined. unit/models/friend-test.js: line 17, col 3, 'equal' is not defined. unit/models/friend-test.js: line 23, col 3, 'equal' is not defined. unit/models/friend-test.js: line 31, col 3, 'equal' is not defined. unit/models/friend-test.js: line 32, col 3, 'equal' is not defined. I have this test file unit/models/friend-test: import Ember from 'ember'; import { moduleForModel, test } from 'ember-qunit'; moduleForModel('friend', 'Friend', { needs: ['model:article'] }); test('it exists', function() { var model = this.subject(); ok(model); }); test('fullName concats first and last name', function() { var model = this.subject({firstName: 'Syd', lastName: 'Barrett'}); equal(model.get('fullName'), 'Syd Barrett'); Ember.run(function() { model.set('firstName', 'Geddy'); }); equal(model.get('fullName'), 'Geddy Barrett', 'Updates fullName'); }); test('articles relationship', function() { var klass = this.subject({}).constructor; var relationship = Ember.get(klass, 'relationshipsByName').get('articles'); equal(relationship.key, 'articles'); equal(relationship.kind, 'hasMany'); }); I'm working through "Ember CLI 101"
has title: 'equal' is not defined : Ember-qunit does not seem to be importing
tagged with: ember.js
accepted answer: http://stackoverflow.com/a/28706104
tagged with: qunit
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45695779
has answer: http://stackoverflow.com/a/28703211
type: Question
tagged with: testing
score: 5
has comment: http://stackoverflow.com/comment/45694947
possible better answer: http://stackoverflow.com/a/28703211
upvote count: 5
tagged with: javascript
has answer: http://stackoverflow.com/a/28706104
has comment: http://stackoverflow.com/comment/45694728
has comment: http://stackoverflow.com/comment/45695584
answer count: 2
has comment: http://stackoverflow.com/comment/45695187

http://stackoverflow.com/a/28746479
accepted answer of: http://stackoverflow.com/q/28746216
answers question: http://stackoverflow.com/q/28746216
type: Answer
has comment: http://stackoverflow.com/comment/45775124
score: 4
has body: Very intersting question. According to W3C specification on border-color property: If an element's border color is not specified with a border property, user agents must use the value of the element's 'color' property as the computed value for the border color. This is the reason why setting document.getElementById("demo").style.color = "red" in your code makes border red too. In your case, CSS rule border: 3px solid; does not define border-color property, only border-style and border-width, hence the observed behavior.
upvote count: 4
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28722330
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45731276
has answer: http://stackoverflow.com/a/28722369
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has title: Add class to html root
has body: I would like to add a class to the root html tag at the top of the page when a button is pressed. The only code I have come across is for adding classes to div elements with ids. Untitled Document Start presentation I have tried to adapt this code but nothing works ;
accepted answer: http://stackoverflow.com/a/28722369
tagged with: css
has comment: http://stackoverflow.com/comment/45731397
type: AnsweredQuestion
score: 0

http://stackoverflow.com/q/28619300
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28619825
has answer: http://stackoverflow.com/a/28619825
tagged with: http://stackoverflow.com/tag/html
has title: Lock Div to fixed position with background
linked to: http://stackoverflow.com/q/11271704
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28619693
has body: I'm trying to hold the yellow div element always on house window even if we resize browser, but I can't achieve it only with css, so looking for a JavaScript solution. Here is my fiddle: http://jsfiddle.net/jj4fxpmy/6/ The prob is the yellow square moves up as I resize browser. I want it to stick to the house. It is important for me to keep background-position right bottom: .background{width:100%;height:100%;top:0%;left:0%;position:fixed; background:url(http://wallpapers.7savers.com/seasons---summer-wallpapers_1146_1920x1200.jpg) no-repeat; background-color:transparent; background-position:right bottom; background-size:100%; Any help will be greatly appreciated.
type: Question
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28619693

http://stackoverflow.com/q/28719035
has comment: http://stackoverflow.com/comment/45725161
answer count: 2
has body: Objective I have to show or hide fields when user choose values from a list. On the followed sample I'm trying to simulate what I would like to do, I would like to show the input text field only when the car colour is set it to Red : Code: Each time that user choose an option , I'm setting their properties on the controller $scope.CarModel.Colour = "Red"; That's fine, but I don't know how to trigger ng-show="CarCtrl.ValidateColour(CarModel.Colour) once the model is updated, in order to hide or show the field. &lt;input type="text" class="form-control" id="carColour" ng-model="CarModel.Colour" ng-show="CarCtrl.ValidateColour(CarModel.Colour)"&gt;
downvote count: 1
tagged with: javascript
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45724985
has answer: http://stackoverflow.com/a/28720134
tagged with: ng-show
upvote count: 0
has title: Trigger ng-show when model is updated
type: Question
has comment: http://stackoverflow.com/comment/45725227
has answer: http://stackoverflow.com/a/28720033
score: -1
has comment: http://stackoverflow.com/comment/45725042

http://stackoverflow.com/q/28608497
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29520132
type: Question
score: 9
tagged with: reactjs
upvote count: 9
downvote count: 0
has answer: http://stackoverflow.com/a/28611714
tagged with: javascript
answer count: 3
tagged with: refluxjs
favorite count: 0
possible better answer: http://stackoverflow.com/a/28610207
accepted answer: http://stackoverflow.com/a/28611714
has answer: http://stackoverflow.com/a/28610207
has body: From reading the docs I don't quite understand how Reflux async actions work. In particular I need to trigger something when an async action completes. In one of my components I want to listen for an async action complete and then transition to a view. mixins: [State, Navigation, Reflux.listenerMixin], componentDidMount() { this.listenTo(actions.loadProject.completed, ()=&gt;{this.transitionTo('info')}); }, I have created my action like this: var actions = Reflux.createActions([ "someSyncAction", "anotherSyncAction" ]); actions.loadProject = Reflux.createAction({ "loadProject": {children: ['completed','failed']}, }); And in my projectStore I have something like this: onLoadProject(id) { var url = '/api/projects/' + id; io.socket.get(url, (body, jwr) =&gt; { if(jwr.statusCode !== 200){ console.error('Failed to load project', id, body); return actions.loadProject.failed(); } var p = body; debug('loaded project', id, p); this.project = p; this.trigger(p); actions.loadProject.completed(); }); }, But it appears actions.loadProject.completed is not a function, so the above code won't work. What is the correct approach?
has title: Reflux how to listen for async action completed

http://stackoverflow.com/comment/45648870
score: 1
has text: http://jsfiddle.net/ywy9ndao/ ? **Edit:** seems to work only in Chrome
comment on: http://stackoverflow.com/q/28677335
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45675775
comment on: http://stackoverflow.com/a/28692265
type: Comment
score: 0
type: AnswerComment
has text: Thanks, it is working, but why this is working in firefox and IE. Acutally I can't change this behaviour because I am getting it from some sources of file.

http://stackoverflow.com/comment/45551997
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28625506
has text: have you tried anything from your side?

http://stackoverflow.com/q/28627794
tagged with: datepicker
tagged with: css
answer count: 4
has answer: http://stackoverflow.com/a/54090604
has answer: http://stackoverflow.com/a/28627897
upvote count: 10
has body: I'm using bootstrap datepicker from here: https://github.com/eternicode/bootstrap-datepicker Now I would like to fit it's width with the parent container, but at the moment it only fills a fixed size and I don't know where to change it via CSS. Maybe you've got an similar problem earlier and would like to help me? I've attached a picture of the problem: https://i.sstatic.net/ShZTU.png And here's the code before adding the datepicker functionality via JavaScript: '; Robert Jang email@example.com Then I add the datepicker functionality with this JavaScript code: jQuery('#bs-datepicker-inline').datepicker(); And after this my final source code looks like this: Robert Jang email@example.com « February 2015 » Su Mo Tu We Th Fr Sa 25 26 27 28 29 30 31 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 1 2 3 4 5 6 7 Today Clear « 2015 » Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Today Clear « 2010-2019 » 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 Today Clear I hope someone could help me. Please let me know if you need some more information. Many thanks in advance. EDIT 1: Here's the CSS Code of the Datepicker .datepicker { direction: ltr; padding: 0; width: auto !important; } .datepicker.datepicker-inline { border: 1px solid #eee; display: inline-block; position: relative; } .datepicker > div { display: none; } .datepicker.days div.datepicker-days, .datepicker.months div.datepicker-months, .datepicker.years div.datepicker-years { display: block; } .datepicker div.datepicker-months td, .datepicker div.datepicker-years td { width: 210px !important; } .datepicker table { margin: 0; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .datepicker td { line-height: 32px; padding: 0 !important; text-align: center; width: 30px; } .table-striped .datepicker table tr td, .table-striped .datepicker table tr th { background-color: transparent;…
downvote count: 1
type: Question
score: 9
has answer: http://stackoverflow.com/a/43919792
has answer: http://stackoverflow.com/a/32857600
tagged with: javascript
has title: How to change bootstrap inline datepicker to fit full width
favorite count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion

http://stackoverflow.com/q/28653195
accepted answer: http://stackoverflow.com/a/28653355
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45603485
tagged with: file
has comment: http://stackoverflow.com/comment/45603680
has comment: http://stackoverflow.com/comment/45603673
has body: I am working on a project in which there are a few ways I need to connect an object (a string, specifically) in an array to an additional bit of text amounting to a few sentences. Currently I have a function that creates the array and populates it with values (both strings and numbers) related to the game being played: /* store names by male and female for selection later */ var aliasM = ["Spike", "Mike", "Pops", "Noodles", "Shorty"]; var aliasF = ["Shanna", "Rose", "Sugar", "Alana"]; function aliasSelector() { if (Math.random() &lt;= 0.55) { alias = aliasM[Math.floor(Math.random() * aliasM.length)]; var mTook = aliasM.indexOf(alias); aliasM.splice(mTook, 1) } else { alias = aliasF[Math.floor(Math.random() * aliasF.length)]; var fTook = aliasF.indexOf(alias); aliasF.splice(fTook, 1); } return alias; } function playerGen(name, alias, turns, mech, cash, credit) { this.name = name; this.alias = aliasSelector(); this.turns = 0; this.mech = Math.ceil(Math.random() * 5); this.cash = 1000 + Math.round(Math.random() * 1000); this.credit = Math.round(Math.random() * 2000); } /*Next we create array objects for each player */ function nameCheck() { p1 = document.getElementById("p1Entry").value; if (p1 !== "") { playerList.push(new playerGen(p1)); } /* and so on */ } What I'd like to include is a short description of each alias name. So if the player gets the Alias "Spike", there is a short paragraph someplace telling us about Spike. I'm not sure how to make this connection without including the sentence in the array. I'm thinking a conditional of some kind might work or creating a notation of some kind that connects the name to the paragraph, stored as a variable spikeInfo. I think this last method makes the most sense, something like: var SpikeInfo = "Spike is an HVAC specialist from Fresno who...."; Can this stuff be stored in another file, or is there value in doing so? Would that be a .txt file, or another .js file?
type: Question
has title: Connecting text relating to array object: how and where?
tagged with: arrays
has answer: http://stackoverflow.com/a/28653355
tagged with: javascript
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28653325
has answer: http://stackoverflow.com/a/28653325
tagged with: external

http://stackoverflow.com/q/28629504
downvote count: 0
tagged with: setinterval
has title: setInterval executes only once
favorite count: 0
has comment: http://stackoverflow.com/comment/45559950
has answer: http://stackoverflow.com/a/28629795
upvote count: 2
has comment: http://stackoverflow.com/comment/45569083
has answer: http://stackoverflow.com/a/28629609
has body: I'm having trouble with a setInterval function. It executes, but only once. function show(el){ el.style.opacity = 0; el.style.display = "block"; showingInterval = window.setInterval(function() { el.style.opacity += 0.001; if(el.style.opacity == 1) { alert("done"); clearInterval(showingInterval); } }, 1); } The function show(el) is not the problem. It changes opacity to 0 and display to "block" just fine. The interval function runs one time changing the opacity of the element to 0.0001. It stays at that state and doesn't change any more, though. Thanks for the help!
possible better answer: http://stackoverflow.com/a/28629795
score: 2
type: AnsweredQuestion
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28629609
has answer: http://stackoverflow.com/a/28629900
answer count: 3
tagged with: anonymous-function
has comment: http://stackoverflow.com/comment/45559248

http://stackoverflow.com/q/28627605
has title: Alt key behaviour with Javascript on Chrome/Windows 7?
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28630367
has comment: http://stackoverflow.com/comment/45557881
tagged with: keydown
type: AnsweredQuestion
tagged with: keyup
has comment: http://stackoverflow.com/comment/45558150
type: Question
has comment: http://stackoverflow.com/comment/45559308
has answer: http://stackoverflow.com/a/28630367
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45556602
has body: I'm trying to emulate a behaviour of a windows menu where you could navigate menus using an combination like: alt + KEY + KEY ... as a simple test I did this: $(document).on('keydown', function(e) { $(".dropdown&gt;a").css("text-decoration","underline"); }).on('keyup', function(e) { $(".dropdown&gt;a").css("text-decoration","") }); Which should add or remove an underline for all my links under .dropdown whenever I press any key on the website, it works fine for all , but the Alt key, with this key the system appears to be awaiting another key to be pressed and will only show the underline if I press alt twice. I'm wondering if this is something that can be worked around or is something regarding the operating system. Why does is happen?
score: 0

linechart
tag name: linechart
tags question: http://stackoverflow.com/q/28732380
type: Tag

http://stackoverflow.com/comment/45736178
comment on: http://stackoverflow.com/q/28724417
score: 0
type: Comment
type: QuestionComment
has text: @tarazoburo I am using the exact tooltipframe that's what my element ID is.

http://stackoverflow.com/comment/45533485
score: 0
comment on: http://stackoverflow.com/q/28615068
type: QuestionComment
has text: You are not passing "an IIFE", or anything "as IIFE", but you pass objects *to* an IIFE!
type: Comment

http://stackoverflow.com/q/28696838
tagged with: javascript
tagged with: extjs
tagged with: controller
tagged with: extjs4
has comment: http://stackoverflow.com/comment/45685228
score: -6
favorite count: 0
has comment: http://stackoverflow.com/comment/45685195
type: UnansweredQuestion
has body: //****************controller******************** Ext.define('Insurance.controller.OpenQuoteController', { extend: 'Ext.app.Controller', //define the stores stores: ['OpenQuote'], //define the models models: ['ApplicationListData'], //define the views views: ['OpenQuoteComp'], refs: [{ ref: 'myGrid', selector: 'grid' }], init: function () { this.control({ 'viewport > panel': { render: this.onPanelRendered } }); }, onPanelRendered: function () { //just a console log to show when the panel si rendered console.log('The panel was rendered'); }, onMtai: function (t) { console.log('You typed something!'); var thisRegEx = new RegExp(t.getValue(), "i"); var store = this.getOpenQuoteStore(); var grid = this.getMyGrid(); store.filterBy(function (rec) { for (var i = 0; i < grid.columns.length; i++) { // Do not search the fields that are passed in as omit columns if (grid.omitColumns) { if (grid.omitColumns.indexOf(grid.columns[i].dataIndex) === -1) { if (thisRegEx.test(rec.get(grid.columns[i].dataIndex))) { if (!grid.filterHidden && grid.columns[i].isHidden()) { continue; } else { return true; } ; } ; } ; } else { if (thisRegEx.test(rec.get(grid.columns[i].dataIndex))) { if (!grid.filterHidden && grid.columns[i].isHidden()) { continue; } else { return true; } ; } ; } ; } return false; }); } }); //*******************view************************** Ext.define('Insurance.view.openquote.OpenQuoteComp', { extend: 'Ext.grid.Panel', alias: 'widget.OpenQuoteGrid', title: 'Diary Record(s):0', width: 700, xtype: 'openquotecomp', defaults: { flex: 1 // layout:'fit' }, initComponent: function () { this.columns = [ {header: 'Client Name', dataIndex: 'clientName'}, {header: 'Business Manager', dataIndex: 'bmManger'}, {header: 'Date', dataIndex: 'dealDate', flex: 1}, {header: 'Reference Number', dataIndex: 'refNumber'}, {header: 'Vehicle', dataIndex: 'vehicle'}, {header: 'Agent', dataIndex: 'agent'} ]; this.callParent(arguments); } //renderTo: Ext.getBody() }); //***************model**********…
has answer: http://stackoverflow.com/a/28713343
tagged with: grid
downvote count: 6
has comment: http://stackoverflow.com/comment/45685111
has title: Load data from server side into ExtJs Grid
has comment: http://stackoverflow.com/comment/45683983
type: Question
has comment: http://stackoverflow.com/comment/45685174
upvote count: 0
has comment: http://stackoverflow.com/comment/45712823
answer count: 1

http://stackoverflow.com/comment/45533785
has text: It's a functional programming example. `wrapValue2` returns a function
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28615366

http://stackoverflow.com/comment/45618991
type: QuestionComment
has text: No, the `.length` does not require the function to have a name. You just need a reference to the function object, the same as you need when you'd call it. Inside an IEFE you can use `arguments.callee`, but that is despised, better name your function; or just use a constant.
comment on: http://stackoverflow.com/q/28619320
score: 1
type: Comment

http://stackoverflow.com/comment/45716122
type: AnswerComment
has text: Can u please create a demo on jsfiddle?
type: Comment
comment on: http://stackoverflow.com/a/28714040
score: 0

http://stackoverflow.com/comment/45701463
score: 0
has text: in jquery.ui.widget.js requires "public" jquery module. Try to map "public" jquery module for using in jquery.ui.widget module. And your jquery module still clear of other plugins
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28616762

http://stackoverflow.com/comment/45729206
type: Comment
has text: Whoops... my bad. I didn't test that part. You need a closure in the event listener for this. Answer code & fiddle updated!
type: AnswerComment
comment on: http://stackoverflow.com/a/28719854
score: 0

http://stackoverflow.com/comment/45647533
has text: here you get the url of the page.. If you click on the nav button the chart in the bottom shold show the values sorted! And this work only on the last button [link](http://weedmap.de)
type: QuestionComment
comment on: http://stackoverflow.com/q/28677145
score: 1
type: Comment

http://stackoverflow.com/comment/45741044
has text: I dont think its as simple as that - in recent examples there is video-like time slider (which you can simply drag drop to go to any time in the video). Also there is this "scene" structure I see in their codes so I was wondering maybe it's a commom system that's being used
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28709445

http://stackoverflow.com/comment/45580096
type: QuestionComment
has text: Ok I understand! I can replace the url value with '/Student/updatestatus' no problem because it was hardcoded to begin with. But I need the id that's coming from model.studentid and the only place I'm using it in my view is in a hidden field. So I can't just call document.getelementbyid to get the value, doesn't work on a hidden field. Maybe I don't understand something you're telling me?
score: 0
comment on: http://stackoverflow.com/q/28640246
type: Comment

http://stackoverflow.com/q/28687931
tagged with: angularjs-ng-repeat
has answer: http://stackoverflow.com/a/28688013
has title: Cannot use ng-repeat with a JSON from ajax call
has answer: http://stackoverflow.com/a/28688279
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28688006
tagged with: http://stackoverflow.com/tag/json
tagged with: ionic-framework
type: Question
has body: i am having lots of trouble with json coming from ajax call and ng-repeat. I have posted my code here http://jsfiddle.net/7quj9omw/ so you can view in a more organized way, although i know it is not complete, running this will just get a massive error and it contains my local url for the ajax call. The thing is, my JSON object is retrieved fine, i can console.log(EventsService.Todos()) in my EventsController fine, it logs out a JSON object, but when passing to the ng-repeat in the markup, it wont work. If I copy my JSON and post it directly in my code, it works fine. I deeply think that is a parse problem, but i have already tried using PARSE.json in my variable and dont work as well. Am I doing something wrong passing my data from my service all the way to my html markup ng repeat? If anybody have any clues, i would be greateful, thanks. EDIT: there is a print of the console.log out i did in my json: Below is an example of my JSON return: [ { "id":"26", "idDeles":"zCNTdU", "data":"2015-02-21", "titulo":"Didge Steakhouse Pub ", "descricao":"Noite de s\u00e1bado no Didge Steakhouse Pub em Balne\u00e1rio Cambori\u00fa. ", "fotografo":"Mariana Haag", "fonte":"http:\/\/night.com.br\/fotos\/zCNTdU", "status":"1", "quantidadeFotos":"78", "views":"0", "thumb":"http:\/\/night.com.br\/arquivos\/casas\/50\/fotos\/24790\/tb\/0001_img_0020.jpg" }, { "id":"25", "idDeles":"zqNTdU", "data":"2015-02-21", "titulo":"Showbol Arena ", "descricao":"Noite de s\u00e1bado no Showbol Arena em Itaja\u00ed. ", "fotografo":"Adivasson Correa", "fonte":"http:\/\/night.com.br\/fotos\/zqNTdU", "status":"1", "quantidadeFotos":"165", "views":"0", "thumb":"http:\/\/night.com.br\/arquivos\/casas\/181\/fotos\/24788\/tb\/0001_img_0010.jpg" } ]
score: 0
tagged with: javascript
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/28688006
answer count: 3
accepted answer: http://stackoverflow.com/a/28688279

http://stackoverflow.com/q/28694205
upvote count: 2
type: UnansweredQuestion
tagged with: socket.io
type: Question
tagged with: c#
tagged with: javascript
has answer: http://stackoverflow.com/a/61478644
answer count: 1
downvote count: 0
has title: Send Message to Socket, from C# client to node.js + socket.io server
favorite count: 0
tagged with: sockets
has body: I would like to send a message through socket with c# windows store app client to node.js and socket.io server my client side code is like this (c#) private async void SendDatatoSocket(string sendTextData) { if (!connected) { StatusText = "Must be connected to send!"; return; } Int32 wordlength = 0; // Gets the UTF-8 string length. try { OutputView = ""; StatusText = "Trying to send data ..."; txtblock_showstatus.Text += System.Environment.NewLine; txtblock_showstatus.Text += StatusText; Debug.WriteLine(StatusText); // add a newline to the text to send string sendData = sendTextData + Environment.NewLine; DataWriter writer = new DataWriter(clientSocket.OutputStream); wordlength = sendData.Length; // Gets the UTF-8 string length. // Call StoreAsync method to store the data to a backing stream await writer.StoreAsync(); StatusText = "Data was sent" + Environment.NewLine; txtblock_showstatus.Text += System.Environment.NewLine; txtblock_showstatus.Text += StatusText; Debug.WriteLine(StatusText); // detach the stream and close it writer.DetachStream(); writer.Dispose(); } catch (Exception exception) { // If this is an unknown status, // it means that the error is fatal and retry will likely fail. if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown) { throw; } StatusText = "Send data or receive failed with error: " + exception.Message; txtblock_showstatus.Text += System.Environment.NewLine; txtblock_showstatus.Text += StatusText; Debug.WriteLine(StatusText); // Could retry the connection, but for this simple example // just close the socket. closing = true; clientSocket.Dispose(); clientSocket = null; connected = false; } // Now try to receive data from server try { OutputView = ""; StatusText = "Trying to receive data ..."; Debug.WriteLine(StatusText); txtblock_showstatus.Text += System.Environment.NewLine; txtblock_showstatus.Text += StatusText; DataReader reader = new DataReader(clientSocket.InputStream); string receivedData; reader.InputStreamOpt…
tagged with: node.js
score: 2

http://stackoverflow.com/comment/45743252
comment on: http://stackoverflow.com/q/28727620
has text: never seen this done before, any benefits over iframe?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45693897
type: Comment
has text: So it was just revealed to me that the motivation for using B is so that you can chain your function and variables in the following way. I've never written code like this. Is this a known approach? http://jsfiddle.net/s0vva8dm/1/
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28696895

http://stackoverflow.com/comment/45705392
type: AnswerComment
has text: I have the variable in my global section and above the if. Should I remove both? By the way, thank you!
type: Comment
comment on: http://stackoverflow.com/a/28708001
score: 0

http://stackoverflow.com/a/28736886
has comment: http://stackoverflow.com/comment/45757946
has comment: http://stackoverflow.com/comment/45759061
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45763611
has comment: http://stackoverflow.com/comment/45763051
has comment: http://stackoverflow.com/comment/45759334
accepted answer of: http://stackoverflow.com/q/28736778
type: Answer
answers question: http://stackoverflow.com/q/28736778
has body: .alert-message div is not yet loaded in DOM when you are using it. Try to echo it before script: echo " "; echo " ";
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45758338

http://stackoverflow.com/a/28732447
answers question: http://stackoverflow.com/q/28732355
score: 0
has body: The content should automatically determine the height of its container Element. Your padding and margins will not be considered part of the content when you are floating it. The best way to preserve content height when floating is to add another block level Element after the floating Element (inside the parent of both of them) and clear:left; on it. .clearLeft{ clear:left; }
type: Answer

http://stackoverflow.com/q/28622982
has comment: http://stackoverflow.com/comment/45547676
has body: when checking multiple check boxes, then how to store below values? &lt;input type="checkbox" id='+k+' amount ='+cost+' onclick=\"checkout(this)\"&gt; In function.. var total = obj.getAttribute("amount"); can I store this total in array for more check boxes are checked
type: Question
tagged with: javascript
score: 0
has title: I am getting value with this pointer object but dont know how to store if more values are there
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28623285
has comment: http://stackoverflow.com/comment/45547892
has comment: http://stackoverflow.com/comment/45547821
has comment: http://stackoverflow.com/comment/45547971

arraylist
tags question: http://stackoverflow.com/q/28730827
tags question: http://stackoverflow.com/q/28667151
tags question: http://stackoverflow.com/q/28653939
type: Tag
tag name: arraylist

http://stackoverflow.com/comment/45726118
type: Comment
type: QuestionComment
has text: it returns an empty array ! i guess this should have returned the file info in an array ! but all it returned is array(0) {
comment on: http://stackoverflow.com/q/28719450
score: 0

http://stackoverflow.com/a/28749318
has body: I looked at a number of app generators and everyone does it differently. Mostly though I've seen it work the opposite from what you are asking. The route modules do not get the app passed in, they just return themselves and are attached to the app. I like to use the following pattern: routers/hello.js: var express = require('express'); var router = express.Router(); router.get('/hello', function (req, res) { res.send('Hello, World!'); }); module.exports = router; app.js: var express = require('express'); var app = express(); app.use('/sample', require('./routers/hello')); // other routers are attached module.exports = app; server.js: var http = require('http'); var app = require('app'); var server = http.createServer(app); server.listen(3000): So the modules in routers/ return an Express Router object that are then attached to the app on their respective paths (routes). This is inspired on the Express Application generator, but uses Routes instead of Routers. My advice, use the linked generator and start from there.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28748337
has comment: http://stackoverflow.com/comment/45780914

http://stackoverflow.com/q/28702799
has comment: http://stackoverflow.com/comment/45695501
upvote count: 11
type: AnsweredQuestion
has body: I started using filesaver.js today.I have created the following function: function saving(){ var blob = new Blob(final_transformation, {type: "text/plain;charset=utf-8"}); saveAs(blob, "hello world.txt"); } but when i call that function i get"Failed to construct 'Blob': The 1st argument provided is either null, or an invalid Array object. " Any ideas?
accepted answer: http://stackoverflow.com/a/28702898
possible better answer: http://stackoverflow.com/a/51390343
downvote count: 1
has answer: http://stackoverflow.com/a/51390343
type: Question
has title: Failed to construct 'Blob': The 1st argument provided is either null, or an invalid Array object.
score: 10
has comment: http://stackoverflow.com/comment/45695572
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45695483
answer count: 2
tagged with: file-io
has answer: http://stackoverflow.com/a/28702898
favorite count: 0

http://stackoverflow.com/a/28644426
upvote count: 10
type: Answer
has body: You need to open the Developer Tools before the debugger; is executed. Open using F12 key (read this to learn about more features) See it in action: Developer Tools are not opened Developer Tools are opened http://jsfiddle.net/qkd5swv9/
score: 9
type: AcceptedAnswer
downvote count: 1
answers question: http://stackoverflow.com/q/28644251
accepted answer of: http://stackoverflow.com/q/28644251

http://stackoverflow.com/a/28713711
accepted answer of: http://stackoverflow.com/q/28713592
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28713592
score: 1
type: AcceptedAnswer
downvote count: 0
has body: Why push change x when the push is performed on y initialized with x? Because y is not "initialized with x", it is x. In Javascript all variables contain references (with the exception of primitive values, like strings or numbers). x is a name for an array. Stating y = x; merely creates another name for the same array. This example happens cross browsers, and I wondered if node.js do the same well surprise it does, Of course. It's in the spec that way. now the question: I'm using wrong .push() method? Yes. (Well, no, you're using it right, you just expected the wrong thing.) And what is the correct approach to initialize objects from existing ones. If you want to clone an object, there are different methods of going about it, depending on whether you want a shallow or a deep clone. This information can be looked up easily, I won't provide yet another implementation. Related search: https://stackoverflow.com/search?q=javascript+clone+object

http://stackoverflow.com/q/28599380
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/28599409
has title: creating many similar elements in javascript animation
tagged with: javascript
tagged with: jquery
has body: For a javascript animation, I am trying to create buttons with the numbers 1-9 on them. Right now my javascript for the number 1 looks like: that1 = { thisx : 120, thisy: H-400, thisnumber= "1", draw: function() { var keywidth = 100; var keyheight = 150 ; var x = this.thisx; var y = this.thisy; var cornercut = 5; ctx.beginPath(); //drawing the key ctx.moveTo(x, y+cornercut); ctx.quadraticCurveTo(x,y, x+cornercut, y); ctx.lineTo(x+keywidth-cornercut, y); ctx.quadraticCurveTo(x+keywidth, y, x+keywidth, y+cornercut); ctx.lineTo(x+keywidth, y+keyheight-cornercut); ctx.quadraticCurveTo(x+keywidth, y+keyheight, x+keywidth-cornercut, y+keyheight); ctx.lineTo(x+cornercut, y+keyheight); ctx.quadraticCurveTo(x, y+keyheight, x, y+keyheight-cornercut); ctx.lineTo(x, y+cornercut); ctx.closePath(); ctx.stroke(); ctx.fillText(this.thisnumber, x+.5*keywidth,y+.8*keyheight); }, highlight: function() { ctx.fillStyle="red"; ctx.fill(); } } ; I could just copy this to create this2, this3, this4, this5, etc., but I feel like there is an easier way. Can anyone help? I am using JS because I believe it will be the easiest way to control these objects using animation, but please let me know if you have another suggestion.
score: 0
answer count: 1
tagged with: animation
has answer: http://stackoverflow.com/a/28599409

http://stackoverflow.com/q/28616955
has answer: http://stackoverflow.com/a/28617279
upvote count: 1
tagged with: transition
has title: How can I make my function to run the moment the page is running?
has body: I would like to make a function run the moment a person loads my page. No interactivity. The function is loading when someone clicks. I also would like to make the function loop after 1 minute and a half. I tried replacing "click" for window.onload and body.onload but as you may have noticed by now I am a true begginer with javascript. Can someone give me a hand please. For now all I have is this: // Animate an element by adding a class to it: // Paramaters: // anim: the class name to add // time: animation duration (optional, fallsback to the class) // cb: an optional callback function to happen once the animation ends $.fn.animatecss = function(anim, time, cb) { if (time) this.css('-webkit-transition', time / 1000 + 's'); this.addClass(anim); if ($.isFunction(cb)) { setTimeout(function() { // Ensure that the element is available inside the callback. $(this).each(cb); }, (time) ? time : 5000); } return this; }; $(document).ready(function() { $('.box')click(function() { $(this).animatecss('blur-out', 5000, function() { console.log('callback'); }); }); }); .blur-out { -webkit-filter: blur(8px); -webkit-transform: scale(1.4, 1.4); -webkit-transition: all 5s ease-out; transition: all 5s ease-out; visibility: hidden; } .box { background:#fff; margin: 80px; padding: 20px; } &lt;div class="box"&gt; &lt;img src="http://companionplants.com/images/small-plant2.jpg"&gt; &lt;/div&gt;
tagged with: javascript
has comment: http://stackoverflow.com/comment/45537129
has answer: http://stackoverflow.com/a/28617061
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45537074
type: Question
answer count: 2
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: onload
accepted answer: http://stackoverflow.com/a/28617061
possible better answer: http://stackoverflow.com/a/28617279

http://stackoverflow.com/comment/45569084
comment on: http://stackoverflow.com/a/28634596
type: AnswerComment
score: 0
type: Comment
has text: if case is 1, it will fall through to case 2 as you have not included a break;

http://stackoverflow.com/a/28644404
has body: I think the reload function can take an argument that forces full refresh. ie: window.location.reload(true); For reference: https://developer.mozilla.org/en-US/docs/Web/API/Location/reload
answers question: http://stackoverflow.com/q/28644209
has comment: http://stackoverflow.com/comment/128559452
downvote count: 0
has comment: http://stackoverflow.com/comment/127963811
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/a/31627663
downvote count: 0
has comment: http://stackoverflow.com/comment/51254771
has body: var months = ["يناير", "فبراير", "مارس", "إبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"]; var days =["اﻷحد","اﻷثنين","الثلاثاء","اﻷربعاء","الخميس","الجمعة","السبت"]; var date = new Date(); console.log("The current month is " + months[date.getMonth()]); console.log("The current day is " + days[date.getDay()]);
answers question: http://stackoverflow.com/q/28694214
type: Answer
score: 9
upvote count: 9
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28694214

apache
tag name: apache
tags question: http://stackoverflow.com/q/28734828
tags question: http://stackoverflow.com/q/28657739
type: Tag
tags question: http://stackoverflow.com/q/28661152

http://stackoverflow.com/a/28615648
score: 0
answers question: http://stackoverflow.com/q/28615575
type: Answer
has body: No, you can't hide it off the edge of the screen. Devices like mobiles will let people scroll past the edge and it will look bad. I recommend using this example of hiding and showing it with javascript. http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_hide_show

http://stackoverflow.com/a/28749224
score: 1
has body: Add in HTML &lt;form class="form-2" name="form1" id="form1" method="POST" onsubmit="DoSubmit();"&gt; &lt;input type="hidden" name="message" value="0" /&gt; &lt;input type="text" name="message" value="" /&gt; &lt;input type="hidden" name="submit" value="0" /&gt; &lt;input type="submit" name="submit" value="" /&gt; &lt;input type="hidden" name="name" value="0" /&gt; &lt;input type="text" id="name" name="name" value=""placeholder="Your Name" &gt; &lt;input type="hidden" name="username" value="0" /&gt; &lt;input type="text" id="username" name="username" value=""placeholder="Username" &gt; &lt;input type="hidden" name="mail" value="0" /&gt; &lt;input type="text" id="mail" name="mail"value="" placeholder="E-mail id" &gt; &lt;input type="hidden" name="phone" value="0" /&gt; &lt;input type="text" id="phone" name="phone"value="" placeholder="Mobile Number" &gt; &lt;input type="hidden" name="pass1" value="0" /&gt; &lt;input type="password" id="pass1" name="pass1"value="" placeholder="Password" &gt; &lt;input type="hidden" name="pass2" value="0" /&gt; &lt;input type="password" id="pass2" name="pass2"value="" placeholder="Re-type Password" &gt; &lt;/form&gt; Then in JS function DoSubmit(){ if((name == "") &amp;&amp; (mail == "") &amp;&amp; (numb == "") &amp;&amp; (pass1 == "") &amp;&amp; (pass2 == "")) { alert("Make sure that you've entered all the details :("); document.getElementById('name').focus(); return false; } else { document.getElementById("form1").action = "register_2step_1.php"; document.form1.message.value = '1'; document.form1.submit.value = '1'; document.form1.name.value = '1'; document.form1.username.value = '1'; document.form1.mail.value = '1'; document.form1.phone.value = '1'; document.form1.pass1.value = '1'; document.form1.pass2.value = '1'; return true; } }
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28749059
downvote count: 0
has comment: http://stackoverflow.com/comment/45780832
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45781358
answers question: http://stackoverflow.com/q/28749059

http://stackoverflow.com/q/28731550
has comment: http://stackoverflow.com/comment/45749604
upvote count: 3
has comment: http://stackoverflow.com/comment/45749260
has comment: http://stackoverflow.com/comment/45749387
downvote count: 1
answer count: 1
favorite count: 0
tagged with: php
has answer: http://stackoverflow.com/a/28732066
accepted answer: http://stackoverflow.com/a/28732066
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45749297
has title: Read var from external javascript file and convert it to php variables
has body: I have a javascript file (let's call it external.js) located at some place on my server with the following content: var exchange = { "USD": { "transfer": 203.49, "cash": 90.08, "average": 203.49, }, "EUR": { "transfer": 231.16, "cash": 102.32, "average": 231.16, }, "USDCOL": { "rate": 2625.00, "ratecash": 2350.00, "ratetrm": 2500.59, "trmfactor": 0.05, "trmfactorcash": 0.06 }, "EURUSD": { "rate": 1.1359 } "GOLD": { "rate": 1203.95 }} //this code is simplified there is a lot more values I will like to read that file from PHP (something similar to what is done with external xml files) and split those strings into variables, like this: $USD_transfer = 203.49; $USD_cash = 90.08; $USD_average = 203.49; $EUR_transfer = 231.16; $EUR_cash = 102.32; $EUR_average = 231.16.49; $GOLD_rate = 1203.95; Then proceed and execute the rest of my php code. I tried file_get_contents, reading a section of a file, to extract every variable value one by one, but it is obviously unpractical. &lt;?php //Read 6 characters starting from the 166 character to get $USD_transfer $file = file_get_contents('./external.js', NULL, NULL, 166, 6); $USD_transfer = $file; ?&gt; PD: since I am working with a pre-made (unalterable) code that generates (only) that javascript file I can not modify it, if it where my choice I would use a database... but that's not the case. My coding skills are very limited, can you guys please help me?
has comment: http://stackoverflow.com/comment/45749339
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45749177

http://stackoverflow.com/comment/45651138
comment on: http://stackoverflow.com/q/28678872
has text: doing something like `console.log = console.warn = console.dir = console.debug = console.time = console.timeEnd = console.assert = function () {};` etc would supress all console logging
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45777856
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28747746
has text: Do you want the sun to travel around the red path as if it is rising and setting above the text?

http://stackoverflow.com/a/68058202
has body: if you are using 3.3.2 Y axis will be hidden by this: options: { scales: { yAxis: { display: false, } } },
type: Answer
score: 2
upvote count: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28716464

http://stackoverflow.com/comment/45748336
score: 0
comment on: http://stackoverflow.com/q/28730737
type: QuestionComment
type: Comment
has text: it should be ng-click="setActive('cw')" without `$scope`

http://stackoverflow.com/a/28725041
upvote count: 1
has body: When you are creating re-usable components/widgets/directives create isolateScope. In your directive definition declare scope: {} It creates private, unshared scope per usage of that directive. More on isolateScope from angular documentation. As the name suggests, the isolate scope of the directive isolates everything except models that you've explicitly added to the scope: {} hash object. This is helpful when building reusable components because it prevents a component from changing your model state except for the models that you explicitly pass in. Note: Normally, a scope prototypically inherits from its parent. An isolated scope does not. See the "Directive Definition Object - scope" section for more information about isolate scopes. Best Practice: Use the scope option to create isolate scopes when making components that you want to reuse throughout your app.
answers question: http://stackoverflow.com/q/28724945
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28724945
has comment: http://stackoverflow.com/comment/45736909
type: Answer
has comment: http://stackoverflow.com/comment/66593608
score: 1

socket.io
tags question: http://stackoverflow.com/q/28722737
tags question: http://stackoverflow.com/q/28657175
tags question: http://stackoverflow.com/q/28663886
tags question: http://stackoverflow.com/q/28700251
tags question: http://stackoverflow.com/q/28646651
type: Tag
tags question: http://stackoverflow.com/q/28611267
tags question: http://stackoverflow.com/q/28609196
tags question: http://stackoverflow.com/q/28637924
tag name: socket.io
tags question: http://stackoverflow.com/q/28612768
tags question: http://stackoverflow.com/q/28615875
tags question: http://stackoverflow.com/q/28708389
tags question: http://stackoverflow.com/q/28694205

http://stackoverflow.com/comment/45744311
comment on: http://stackoverflow.com/q/28728787
type: Comment
has text: Working demo. `this.json` does need to be `self.json`: http://jsbin.com/jujelekimo/1/edit?js,output (click "Run with JS")
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45625597
has text: not knocking your question, or that it's a homework assignment, just making it clear that it is, so the answers you get are more focused.
comment on: http://stackoverflow.com/q/28664865
score: 0
type: Comment
type: QuestionComment

kartograph
tags question: http://stackoverflow.com/q/28676085
type: Tag
tag name: kartograph

http://stackoverflow.com/comment/45740981
comment on: http://stackoverflow.com/q/28727248
score: 0
type: Comment
type: QuestionComment
has text: It is validated xml, but when it does that it tells me that it is invalid XML, instead of just returning "xml is null" but thanks

http://stackoverflow.com/comment/45556274
has text: ohh... simply gr8 ... Thank You :)
comment on: http://stackoverflow.com/a/28627770
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/32486639
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/28736722
score: 0
has body: As far as I considered, it's hard to get all id attributes that needed to be downloaded with paging in grid. What I did was redirecting page to another view. In that view, I hidden same grid with no paging. And sent ids needed to be downloaded from grid to backend, then generated file for client user. Not sure whether this way is best practice. But I used this method solved this problem.
accepted answer of: http://stackoverflow.com/q/28736722

http://stackoverflow.com/comment/45607255
type: Comment
has text: Okay tell me what do you want to achieve.
type: AnswerComment
comment on: http://stackoverflow.com/a/28654842
score: 0

http://stackoverflow.com/comment/45537083
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28616618
has text: @Jack Yes, we can require a browser extension but would prefer not to have to go that route. I will explore that option only once a more agnostic solution is shown to be truly inviable.

http://stackoverflow.com/q/28694860
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/45680521
answer count: 0
downvote count: 0
score: 1
has body: I have this: Test In IE10, when the page is loaded, the onLoad is called. Printed 0 on the screen. When I click the button the clickc is called, thenonResize is called and prints the image size. Okay, but if I add the events onLoad and onResize dynamically to IMG, only onLoad will be called. Exemple: My objective is get the size of the image when possible, because in this situation, Chrome/Firefox/IE11 returns the size of the image in onLoad, but in the IE9/IE10 returns the size 0.
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45680748
has title: Event onResize not working on tag img
upvote count: 1
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/28659258
has answer: http://stackoverflow.com/a/28659331
accepted answer: http://stackoverflow.com/a/28659331
type: Question
has comment: http://stackoverflow.com/comment/45614214
has comment: http://stackoverflow.com/comment/45614293
has comment: http://stackoverflow.com/comment/45614143
upvote count: 0
has comment: http://stackoverflow.com/comment/45614411
has comment: http://stackoverflow.com/comment/45614105
tagged with: javascript
tagged with: jquery
score: -1
tagged with: servlets
tagged with: ajax
has comment: http://stackoverflow.com/comment/45614146
answer count: 1
has comment: http://stackoverflow.com/comment/45614306
has comment: http://stackoverflow.com/comment/45614491
favorite count: 0
has title: Unable to make a AJAX call
has comment: http://stackoverflow.com/comment/45614120
downvote count: 1
has body: I am trying to insert data into the database using AJAX. An ajax call goes to a servlet, that is meant to insert data into the database. But I think I have made a mistake somewhere in initializing ajax object. When I click on the submit button,data doesn't get submitted to the database. HTML: Name Goals Scored Passes Made Submit to database JQuery : Where did I make a mistake?
type: AnsweredQuestion

http://stackoverflow.com/a/28734620
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/28734340
score: 2
has comment: http://stackoverflow.com/comment/45756356
has body: I think what you are trying to do is to, disable the file selection based on some condition, in that case I think you can just disable in file input field. $('input[type="file"]').prop('disabled', true)
answers question: http://stackoverflow.com/q/28734340
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28670779
answers question: http://stackoverflow.com/q/28670514
has comment: http://stackoverflow.com/comment/45636155
upvote count: 2
has body: You can define a factory function to produce your individual "constructors": shape = (defaultSize, calculate = (size) -&gt; size) -&gt; () -&gt; size = defaultSize f = () -&gt; calculate size f.size = (_) -&gt; size = _ f f lines = shape(10) circles = shape(15, (size) -&gt; size * size * Math.PI) This compiles to: var circles, lines, shape; shape = function(defaultSize, calculate) { if (calculate == null) { calculate = function(size) { return size; }; } return function() { var f, size; size = defaultSize; f = function() { return calculate(size); }; f.size = function(_) { size = _; return f; }; return f; }; }; lines = shape(10); circles = shape(15, function(size) { return size * size * Math.PI; }); console.log(lines()()); console.log(lines().size(20)()); console.log(circles()()); console.log(circles().size(30)());
has comment: http://stackoverflow.com/comment/45635594
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/comment/45593697
has text: It works. You can check it here: http://zdg.ru/tmp/sizeable.html See the page source code.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28647762

http://stackoverflow.com/q/28607434
tagged with: css
has body: I'm trying to draw 6X6 squares with different colors. But the new color overriding the old one. And i want to add eventhandler for every square. &lt;canvas id="myCanvas" width="3000" height="1500" style="border:1px solid #d3d3d3;"&gt; Your browser does not support the HTML5 canvas tag.&lt;/canvas&gt; JavaScript: var xPoint = 30; var yPoint = 30; var c = document.getElementsByTagName('canvas')[0]; var ctx = c.getContext("2d"); for(var i =1; i&lt;=6;i++) { var tyPoint = yPoint * i; for(var j=1;j&lt;=6;j++) { var txPoint = xPoint * j; var colorcode = CalculateHEX(); ctx.beginPath(); ctx.fillStyle = colorcode ; ctx.rect(20, 20, txPoint , tyPoint ); ctx.fill(); ctx.stroke(); ctx.closePath(); } } function CalculateHEX() { alert('HEX'); var rgbCode ="#"; for(var c = 0;c&lt; 3;c++) { var y = Math.floor((Math.random() * 255) + 1); rgbCode = rgbCode + Number(y).toString(16); } return rgbCode; } Here is the fiddle.
type: Question
has title: How to get multiple color rectangle using HTML5 Canvas?
has answer: http://stackoverflow.com/a/28607569
tagged with: javascript
score: 4
upvote count: 4
answer count: 2
tagged with: canvas
has comment: http://stackoverflow.com/comment/45518800
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28607643
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/28635569
type: Answer
has comment: http://stackoverflow.com/comment/45571731
has comment: http://stackoverflow.com/comment/45571401
upvote count: 3
has body: Prevent event from bubbling if it happened on input element: $("#expandable :input").click(function(e) { e.stopPropagation(); }); This way click event will not reach click handler on #expandable element. Special selector :input matches inputs, textareas, selectboxes.
score: 3
accepted answer of: http://stackoverflow.com/q/28635549
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45571249
answers question: http://stackoverflow.com/q/28635549

http://stackoverflow.com/a/28643828
has body: What I understand from your code and comment is that, you have data points for your donut chart and each data object contains a property called 'annual' which you want to use as a input data for the bar chart. You should be calling a separate function to plot your bar chart passing it the annual data array. Clear the existing bar chart on 'mouseout' event, so that a new bar chart can be plotted on the next 'mouseover' event. You can use jQuery empty() function for clearing out the chart container.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28635733

http://stackoverflow.com/a/28743630
score: 1
answers question: http://stackoverflow.com/q/28743501
upvote count: 1
downvote count: 0
type: Answer
has body: You could just do this in the controller: for(var i = 0; i &lt; $scope.users.length; i++){ if($scope.users[i].id === userId){ $scope.user = $scope.users[i]; break; } }

http://stackoverflow.com/a/28624295
has comment: http://stackoverflow.com/comment/45550913
accepted answer of: http://stackoverflow.com/q/28624092
score: 0
answers question: http://stackoverflow.com/q/28624092
type: AcceptedAnswer
has body: Dont use prepend if you want to replace entire title. You can just use $(".captiondiv").html(str); EDIT the problem was that element (".caption-title:visible") had multiple values. It was solved using $(this) element to get the wanted element. var str = $(this).find(".caption-title:visible").text(); $(".captiondiv").html(str);
has comment: http://stackoverflow.com/comment/45549870
type: Answer
has comment: http://stackoverflow.com/comment/45553635
has comment: http://stackoverflow.com/comment/45551132
has comment: http://stackoverflow.com/comment/45552574
has comment: http://stackoverflow.com/comment/45549830

http://stackoverflow.com/a/28597837
answers question: http://stackoverflow.com/q/28597787
type: Answer
has body: You're setting flag=true inside the success callback in your AJAX call. To fix this, simply move the actions you plan on completing inside the success callback, or give it a new one: function checkUserName(callback) { $.ajax({ type : "get", url : "/vclub/verify/checkUserName.do", data : {lastName: "jason"}, success : callback }); } checkUserName(function(data) { console.log(data); alert("Done!"); });
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/q/28609212
tagged with: javascript
has comment: http://stackoverflow.com/comment/45522456
score: 0
accepted answer: http://stackoverflow.com/a/28609545
tagged with: css
has comment: http://stackoverflow.com/comment/45522284
type: AnsweredQuestion
type: Question
has body: How can I force ui-btn-active never to be set anywhere? Listening for events seems very bloaty since I don't really know where it is applied. Searching online I only found very outdated solutions.
possible better answer: http://stackoverflow.com/a/28609386
has title: Prevent application of a class in jquerymobile
has answer: http://stackoverflow.com/a/28609545
has answer: http://stackoverflow.com/a/28609386
answer count: 2
tagged with: jquery-mobile

http://stackoverflow.com/comment/45532565
has text: Can you provide more code ?
comment on: http://stackoverflow.com/q/28614706
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28650798
upvote count: 1
has comment: http://stackoverflow.com/comment/45609337
has body: You can create two geometries with same vertex buffers and different indexes: var position = new THREE.BufferAttribute(positionArray, 3); var normal = new THREE.BufferAttribute(normalArray, 3); var uv = new THREE.BufferAttribute(uvArray, 2); var indices1 = new THREE.BufferAttribute(indexArray1, 1); var geometry1 = new THREE.BufferGeometry(); geometry1.addAttribute('position', position); geometry1.addAttribute('normal', normal); geometry1.addAttribute('uv', uv); geometry1.addAttribute('index', indices1); var indices2 = new THREE.BufferAttribute(indexArray2, 1); var geometry2 = new THREE.BufferGeometry(); geometry2.addAttribute('position', position); geometry2.addAttribute('normal', normal); geometry2.addAttribute('uv', uv); geometry2.addAttribute('index', indices2); and then create 2 meshes with different materials as you normally would. As far as I understand, this will re-use same data in both meshes.
answers question: http://stackoverflow.com/q/28631414
has comment: http://stackoverflow.com/comment/45608849
downvote count: 0
score: 1
type: Answer

http://stackoverflow.com/comment/45647575
type: QuestionComment
has text: You want `var toString = Function.prototype.call.bind(Object.prototype.toString)`
score: 4
comment on: http://stackoverflow.com/q/28677126
type: Comment

http://stackoverflow.com/comment/45715530
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28710373
type: Comment
has text: It seems you're experiencing this bug: https://code.google.com/p/chromium/issues/detail?id=377665

http://stackoverflow.com/q/28631667
downvote count: 0
score: 1
has title: find top k elements in array
type: Question
tagged with: arrays
has comment: http://stackoverflow.com/comment/45563582
has answer: http://stackoverflow.com/a/28631771
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28631818
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28631771
has body: I have an array in the format: var series = [[horse,1],[cat,2],[dog,4],[dragon,4],[cow,6]] In order to find the top 3 elements based on the 2nd parameter I sort the array. So for this purpose I use the code below: series.sort( function(a,b) { if (a[1] === b[1]) { return 0; } else { return (a[1] &lt; b[1]) ? 1 : -1; } }); Which works fine. Then If I want to find the top 3 I can always select [0,2]. However, if the 4th value equals the the 3th then I miss it. In this case if I ask for the top 3 the output should be [[horse,1],[cat,2],[dog,4],[dragon,4] because dragon and dog have equal value (4). So, I wonder is there some library I could use out of the box or some efficient algorithm to return the top 3 values which does not necessarily mean returning top 3 element arrays?
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/28631818
has comment: http://stackoverflow.com/comment/45563491
favorite count: 0
has comment: http://stackoverflow.com/comment/45563831
has comment: http://stackoverflow.com/comment/45563519
has answer: http://stackoverflow.com/a/28631978
type: AnsweredQuestion

http://stackoverflow.com/a/28773011
has body: It seems the issue was caused by a semicolon missing in another file. The other file was an angular controller with no semicolon at the end. When grunt uglifys the code it smooshed this file and the file above together creating its own sort of anonymous function, which of course was disliked by the compiler.
downvote count: 0
answers question: http://stackoverflow.com/q/28750272
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/28651878
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28652983
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45601062
tagged with: underscore.js
has answer: http://stackoverflow.com/a/28652372
tagged with: coffeescript
has body: Friends, I have the following problem. I have a collection of objects being returned from an ASP.NET MVC controller as JSON. In the view, I want to order these objects in a specific order based on a name property. I attempted to do so by creating a separate JS array. Based on the names property, I insert the object into a specific index in the array. I'm sure there is a better way to solve this problem. Also I currently getting only the last condition for "events" inserted in every index position. Below is my code to date. Thanks much! &lt;script id="tmpl-refinement-results" type="text/template"&gt; &lt;% var sortedFacets = [] %&gt; &lt;%_.each(SearchAggregationDetails, function(aggValue, y){ if(aggValue.FilterText = "News"){ sortedFacets[0] = aggValue; } if(aggValue.FilterText = "Articles"){ sortedFacets[1] = aggValue; } if(aggValue.FilterText = "Case Studies"){ sortedFacets[2] = aggValue; } if(aggValue.FilterText = "Nice Exhibit Case Studies"){ sortedFacets[3] = aggValue; } if(aggValue.FilterText = "Events"){ sortedFacets[4] = aggValue; } }) %&gt; &lt;% _.each(sortedFacets, function(aggregation, i) { %&gt; &lt;li&gt; &lt;a href="&lt;%=aggregation.TypeUrl %&gt;"&gt;&lt;%=aggregation.FilterText %&gt; &lt;span class="refinement-results-list num-val"&gt; &lt;%=aggregation.DocCount %&gt;&lt;/span&gt;&lt;/a&gt; &lt;/li&gt; &lt;% }); %&gt;
type: Question
answer count: 2
has title: Order objects in a JavaScript collection
tagged with: asp.net-mvc
tagged with: arrays

http://stackoverflow.com/q/28625843
has comment: http://stackoverflow.com/comment/45552633
has body: am trying to write my first web application so if there are any silly mistakes / questions please excuse I am trying to put 2 buttons in my web application page, I want to call a class which is there in my src Directory in eclipse, I tried importing the class and then called the function in button onclick method but this doesn't seems to work am confused and I don't know what else to try <%@ page language="java" contentType="text/html; charset=ISO-8859-1"pageEncoding="ISO-8859-1"%> Insert title here UserName : Password : Build Number : Previous Build Number : Integ SCR This is the class that has java methods public class OnClickTest { public void test() { System.out.println("Test"); } public void start() { System.out.println("Start"); } }
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: Question
score: 0
has comment: http://stackoverflow.com/comment/45552680
linked to: http://stackoverflow.com/q/13840429
has title: how can I call a function(which is there in another class of java) when i click on a button in Java Script
has comment: http://stackoverflow.com/comment/45553674
duplicate of: http://stackoverflow.com/q/13840429
has comment: http://stackoverflow.com/comment/45552640
answer count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45552697

http://stackoverflow.com/comment/45736866
type: QuestionComment
has text: Could you please be more specific? How to fix to code accordingly? Many thanks. I just start learning ajax and those explainations are so advanced. Please help with this particular case.
comment on: http://stackoverflow.com/q/28723248
score: 0
type: Comment

http://stackoverflow.com/comment/45753381
has text: Thanks again. It works. One more advice I am trying to check sessionValue like this if(elem.value.length > 0 && sessionValue > 0) any advice?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28733831
type: AnswerComment

http://stackoverflow.com/a/47411919
has body: I tried this in mongo-sync version 4.1.2 but they made some changes and it is not working with the solutions provided here the solution which worked for me Path node_modules/mongo-sync/node_modules/bson/ext/index.js Old Code try { // Load the precompiled win32 binary if (process.platform == "win32" &amp;&amp; process.arch == "x64") { bson = require('./win32/x64/bson'); } else if (process.platform == "win32" &amp;&amp; process.arch == "ia32") { bson = require('./win32/ia32/bson'); } else { bson = require('../build/Release/bson'); } } catch (err) { // Attempt to load the release bson version try { bson = require('../build/Release/bson'); } catch (err) { console.dir(err) console.error("js-bson: Failed to load c++ bson extension, using pure JS version"); bson = require('../lib/bson/bson'); } } Change in the try block (copy the bson initialization from catch block) bson = require('../lib/bson/bson'); So it will look like try { // Load the precompiled win32 binary if(process.platform == "win32" &amp;&amp; process.arch == "x64") { bson = require('./win32/x64/bson'); } else if(process.platform == "win32" &amp;&amp; process.arch == "ia32") { bson = require('./win32/ia32/bson'); } else { bson = require('../build/Release/bson'); } } catch(err) { // Attempt to load the release bson version try { bson = require('../lib/bson/bson'); } catch (err) { console.dir(err) console.error("js-bson: Failed to load c++ bson extension, using pure JS version"); bson = require('../lib/bson/bson'); } }
type: Answer
answers question: http://stackoverflow.com/q/28651028
upvote count: 1
score: 0
downvote count: 1

http://stackoverflow.com/comment/45677208
score: 0
type: Comment
type: QuestionComment
has text: The marquee plugin appears to have a [`destroy` method](https://github.com/aamirafridi/jQuery.Marquee#methods) - I would suggest putting that in your code also before emptying out the container (only if it's been initialised), then retesting.
comment on: http://stackoverflow.com/q/28693005

http://stackoverflow.com/q/28744834
has title: PhoneRTC: Send data from Java to Javascript on start
type: AnsweredQuestion
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45772482
type: Question
tagged with: phonertc
accepted answer: http://stackoverflow.com/a/28745239
tagged with: javascript
has comment: http://stackoverflow.com/comment/45772389
has comment: http://stackoverflow.com/comment/45772573
has body: I have included phonertc sample application as part of my Android Native Java Application. On my home activity, I have a button which start the phonertc sample app on click. Here is what button does: Intent i = new Intent(this, CordovaApp.class); startActivity(i); Inside CordovaApp.class, I have the following code taken from the sample app of phonertc: public class CordovaApp extends CordovaActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.init(); // Set by &lt;content src="index.html" /&gt; in config.xml loadUrl(launchUrl); } } This loads the sample phonertc application in a separate activity. I want to send some data of my own from Java to sample phonertc application when it is loaded. My goal is to do communication between the phonertc application and my java android code apart from the communication of the plugin. How can I do this? Is there any way that phonertc application calls function of my java android code after getting loaded in webview? Please help.
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45772320
has answer: http://stackoverflow.com/a/28745239
tagged with: android

http://stackoverflow.com/a/28693988
has body: you can use &lt;input type="text" name="mark" pattern="[a-z0-9]{2}"&gt; You can specify your regular expression in the pattern and have any character whitelisted For having 50+ kind of input use the following &lt;input type="text" name="mark" pattern="[0-9]{2}[+]?"&gt;
answers question: http://stackoverflow.com/q/28693688
score: 0
type: Answer

http://stackoverflow.com/comment/45498169
type: QuestionComment
has text: use simple css rule to push it further over `col-sm-6.col-sm-offset-12{ /* more margin or other css */}`. Personally i would probably use some special class like `"offscreen"`
score: 0
comment on: http://stackoverflow.com/q/28595687
type: Comment

http://stackoverflow.com/comment/45792023
has text: Finally, if you're feeling so inclined, I'd welcome pull requests to my 'Metawidget JS Examples' repository: https://github.com/metawidget/metawidget-js
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28753130
type: Comment

http://stackoverflow.com/comment/45727286
score: 0
type: QuestionComment
has text: You should add the values of `pattern` and `values` used in your example in your post, what you expect exactly as result and explain what is wrong in your actual result (what do you mean with "not working") I guess a lot of SO users can't read arabic and can't tell what's wrong with your function.
type: Comment
comment on: http://stackoverflow.com/q/28718704

http://stackoverflow.com/q/28734787
has title: Trouble implementing Meteoric (Meteor-Ionic) package -- Ionic styling not showing up
score: 2
downvote count: 0
tagged with: meteoric
tagged with: ionic-framework
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/28734910
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/29041516
tagged with: meteor
favorite count: 0
type: UnansweredQuestion
has body: I want to create a Meteor app that implements the Meteoric package, enabling me to use Ionic UI features. Going off of this: https://github.com/meteoric/meteor-ionic/blob/master/GUIDE.md I'm trying to simply get it to use Ionic styling but it doesn't work. It Meteoric does render the HTML correctly, though. router.js Router.configure({ layoutTemplate: 'layout' }); Router.route('/', { name: 'timeLists' }); layout.html &lt;template name="layout"&gt; {{#ionBody}} {{&gt; ionNavBar}} {{#ionNavView}} {{&gt; yield}} {{/ionNavView}} {{/ionBody}} &lt;/template&gt; timeLists.html &lt;template name="timeLists"&gt; {{#ionContent}} Hello. {{/ionContent}} &lt;/template&gt; What am I missing here? Thanks!

http://stackoverflow.com/a/28740454
type: Answer
has body: I think it will be wise if you start to learn how to debug Javascript code, you can start by the link below: http://www.w3schools.com/js/js_debugging.asp I hope it could help.
answers question: http://stackoverflow.com/q/28740103
score: 0

http://stackoverflow.com/comment/45587134
has text: If you want it to run more than once then, yes, it should be in a loop.
comment on: http://stackoverflow.com/a/28639722
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45530453
comment on: http://stackoverflow.com/a/28610839
type: Comment
score: 0
has text: ok, in the JS I provided, when you `console.log(key)` after `var key = $(this).val();` what do you get?
type: AnswerComment

http://stackoverflow.com/q/28710984
tagged with: asp.net
favorite count: 0
type: UnansweredQuestion
tagged with: ip-address
type: Question
has comment: http://stackoverflow.com/comment/45710601
tagged with: c#
has body: is there any way to get client machines exact ip address in asp.net.I have tried following code System.Web.HttpContext context = System.Web.HttpContext.Current; string ipAddress =context.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (!string.IsNullOrEmpty(ipAddress)) { string[] addresses = ipAddress.Split(','); if (addresses.Length != 0) { return addresses[0]; } } return context.Request.ServerVariables["REMOTE_ADDR"]; But this code sometimes returns exact ip address of machine and sometimes it gives public ip address,how to solve this issue
has title: Get Client machine's Exact IP Address(Not public IP) using Asp/Javascript
tagged with: javascript
score: 0
upvote count: 1
has answer: http://stackoverflow.com/a/28711006
answer count: 1
downvote count: 1

http://stackoverflow.com/q/28743175
accepted answer: http://stackoverflow.com/a/28743459
has answer: http://stackoverflow.com/a/28743489
tagged with: angularjs
has answer: http://stackoverflow.com/a/28743459
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45769210
type: Question
has comment: http://stackoverflow.com/comment/45769307
possible better answer: http://stackoverflow.com/a/28743489
has comment: http://stackoverflow.com/comment/45769395
tagged with: javascript
has title: How can you execute multiple calls on a conditional ng-click?
score: 0
answer count: 2
has body: I have a conditional ng-click through which i would like to call multiple methods: &lt;a ng-click="!flag || (setFirst(section); setSecond(section);)"&gt; Unfortunately this will not work. But is there a way in which i can wrap these 2 calls together ? I know that the following approach will work, but i don't to do the check for every single method i'll call &lt;a ng-click="!flag || setFirst(section); !flag || setSecond(section);"&gt; The sample code is available here: http://jsfiddle.net/tLtur9tj/1/ Thanks

http://stackoverflow.com/q/28657686
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: arrays
tagged with: nested-loops
tagged with: javascript
has answer: http://stackoverflow.com/a/28657733
downvote count: 0
answer count: 1
favorite count: 0
tagged with: multidimensional-array
has title: javascript variable in array 2d in nested loop is missing
has body: I create dynamic table then store value. But I found final array is mistake. I want to somebody help and expand problem. Why x in x before loop = [[]] not [["111", "0", "0"]]. x = []; $(document).on('click', '#save', function(event) { x.length = 0; var y = []; for (var m = 0; m &lt; row; m++) { y.length = 0; console.log('x before loop = ',x); for (var n = 0; n &lt; arr_stklist.length - 1; n++) { if (arr_stklist[n] == "text") { y.push(document.getElementById('arr_TextAns['+m+']['+n+']').value); } else if (arr_stklist[n] == "level") { y.push(document.getElementById('arr_LevelAns['+m+']['+n+']').value); } } // console.log('y = ',y); // console.log('x before = ',x); x.push(y); // console.log('x after = ',x); } // console.log('final = ',x); event.preventDefault(); }); result is x before loop = [] y = ["111", "0", "0"] x before = [] x after = [["111", "0", "0"]] x before loop = [[]] y = ["222", "0", "0"] x before = [["222", "0", "0"]] x after = [["222", "0", "0"], ["222", "0", "0"]] final = [["222", "0", "0"], ["222", "0", "0"]] I want final is [["111", "0", "0"], ["222", "0", "0"]]
accepted answer: http://stackoverflow.com/a/28657733

http://stackoverflow.com/comment/45513344
comment on: http://stackoverflow.com/a/28603565
score: 0
type: Comment
has text: @Afaan don't you ever see dropdowns, that look good and are not made of simple ` `? Nevertheless, I've got confirmation from OP in question's comments.
type: AnswerComment

http://stackoverflow.com/comment/45518278
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28607094
has text: try to give proper explanation to your answer than just throwing away only codes

http://stackoverflow.com/q/28668024
accepted answer: http://stackoverflow.com/a/28668080
has answer: http://stackoverflow.com/a/28668082
score: 0
has comment: http://stackoverflow.com/comment/45630323
has answer: http://stackoverflow.com/a/28668080
possible better answer: http://stackoverflow.com/a/28668079
type: Question
has title: Other div options are not working
type: AnsweredQuestion
has body: My javascript seems to have problem. The hover/selected state is only working on the first button to click. But when you click the others, the selected state is now working already. $('.option-btn').click(function(){ if ($('.option').hasClass('selected')) { $(this).removeClass('selected'); } else { $(this).addClass('selected'); } }); The result should be the user can click as many as he can. (Making several buttons to be active/selected) Here's the sample fiddle: http://jsfiddle.net/fdLfthnv/
has answer: http://stackoverflow.com/a/28668079
tagged with: javascript
answer count: 3

http://stackoverflow.com/comment/45555657
type: Comment
comment on: http://stackoverflow.com/a/28627063
score: 0
has text: If I change **"5984"** to **8080** I get the following error **Problem with HTTP GET request: http.clientRequest error for request in 240~245 ms** http://smk.iriscouch.com:8080/testbook/_all_docs
type: AnswerComment

http://stackoverflow.com/comment/55765577
comment on: http://stackoverflow.com/q/28667616
type: QuestionComment
has text: Please mark my solution as the accepted solution or suggest how it can be improved.
score: 0
type: Comment

http://stackoverflow.com/a/28685483
type: Answer
answers question: http://stackoverflow.com/q/28685407
has body: Here is some editing done: Reply When calling the function not using "1231" will assumed to be a variable, which was not defined. Furthermore, ending lines with semicolons in javascript is needed for right interpretation.
score: 0

http://stackoverflow.com/q/28716591
has comment: http://stackoverflow.com/comment/45732125
answer count: 1
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28722613
has body: I have HTML + Angular looks like this: 33 and it looks like: And I need to add / change value whihch is between divs (in this example it's number 33) How ever i try to sendkey that it's not helping. I double check if my XPATH is correct but still... var pkValue = "11"; element(by.xpath('(/html/body/div[2]/div/div/div[2]/form/fieldset[2]/div[2]/div/div/div[2]/div[2]/div/div/div/div[3]/div)')).sendKeys(pkValue); Is there something I'm missing or if I need to do something else for this?
has comment: http://stackoverflow.com/comment/45733652
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45732270
tagged with: protractor
score: 1
type: Question
accepted answer: http://stackoverflow.com/a/28722613
tagged with: testing
linked to: http://stackoverflow.com/q/21695714
downvote count: 0
has title: Insert value to div
tagged with: javascript
tagged with: end-to-end
has comment: http://stackoverflow.com/comment/45733084

http://stackoverflow.com/q/28674459
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45642586
has comment: http://stackoverflow.com/comment/45642334
has comment: http://stackoverflow.com/comment/45642340
has comment: http://stackoverflow.com/comment/45642242
type: Question
accepted answer: http://stackoverflow.com/a/28674513
tagged with: javascript
tagged with: jquery
has body: I'm trying to change an editable css table extracted from codepen to something a little bit different. However, I'm having trouble simply getting the HTML5, CSS, JS and JQuery parts to work. This is the link: http://codepen.io/ashblue/pen/mCtuA. I have pasted the below codes into dreamweaver cs6. Basically the problem is that when I open up the html file I am unable to use any of the add, remove, move functions. I can only edit the name and value entries and am able to see the boostrap components, but they do not function. I'm assuming I only need to open the HTML file as I've linked the CSS and JS within it. Also, I'm running a local apache client and opening the html file from local host. The HTML code is: ... HTML5 Editable Table Through the powers of contenteditable and some simple jQuery you can easily create a custom editable table. No need for a robust JavaScript library anymore these days. An editable table that exports a hash array. Dynamically compiles rows from headers Simple / powerful features such as add row, remove row, move row up/down. Name Value Stir Fry stir-fry Untitled undefined Export Data The CSS code is: @charset "utf-8"; /* CSS Document */ .table-editable { position: relative; } .table-editable .glyphicon { font-size: 20px; } .table-remove { color: #700; cursor: pointer; } .table-remove:hover { color: #f00; } .table-up, .table-down { color: #007; cursor: pointer; } .table-up:hover, .table-down:hover { color: #00f; } .table-add { color: #070; cursor: pointer; position: absolute; top: 8px; right: 0; } .table-add:hover { color: #0b0; } The JS code is: // JavaScript Document var $TABLE = $('#table'); var $BTN = $('#export-btn'); var $EXPORT = $('#export'); $('.table-add').click(function () { var $clone = $TABLE.find('tr.hide').clone(true).removeClass('hide table-line'); $TABLE.find('table').append($clone); }); $('.table-remove').click(function () { $(this).parents('tr').detach(); }); $('.table-up').click(function () { var $row = $(this).parents(…
score: 0
has comment: http://stackoverflow.com/comment/45642767
has title: Combine HTML5, CSS and JS
answer count: 1
has comment: http://stackoverflow.com/comment/45642185
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28674513
tagged with: css

http://stackoverflow.com/comment/45721427
comment on: http://stackoverflow.com/q/28716539
has text: Your regex is broken. IMO this is the **ONLY** way to validate an email address: http://stackoverflow.com/a/201378/2594742
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/q/28665554
score: 3
upvote count: 3
accepted answer: http://stackoverflow.com/a/28684966
tagged with: unit-testing
type: Question
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45626919
tagged with: tdd
answer count: 1
has title: Javascript Unit Testing in Symfony
has answer: http://stackoverflow.com/a/28684966
favorite count: 0
tagged with: symfony
has body: So some context: We use Symfony to load our assets (as we have quite a few dependencies (Underscore, Marionette, Backbone, .. etc) and we run Javascript unit tests, using Jasmine. So to run them within our CI server, we use PhantomJS to hit the spec Symfony route. The problem then comes with the speed of it being run in dev mode. What options do we have running Jasmine tests properly (considering our dependencies are managed through a Symfony Twig template) through a CLI tool rather than hitting them via a URL?
type: AnsweredQuestion

http://stackoverflow.com/q/28722561
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45732439
has answer: http://stackoverflow.com/a/28722871
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45731991
tagged with: css
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/45732967
has body: I've got some UI that has javascript events that cause CSS changes that reposition elements in the UI. I'm having a problem with hover states, where the hover state doesn't update properly after these changes. I've boiled down a very simple example here. hover "block 1" Observe: "block one" turns blue click "block 1" Observe: css changes cause the blocks to flip Observe: the mouse is now hovering "block 2" but "block 1" is still blue Expected behavior: "block 2" should be blue after the transform and "block 1" should be red. Observe: Moving the mouse very slightly causes them to "correct" $(function() { $('.block').click(function () { $('.container').toggleClass('flipped'); }); }); .container { display: flex; width: 150px; } .container.flipped { transform: rotate(180deg); } .block { height: 50px; width: 50px; background-color: red; margin: 10px; } .block:hover { background-color: blue; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div class="container"&gt; &lt;div class="block"&gt; block 1 &lt;/div&gt; &lt;div class="block"&gt; block 2 &lt;/div&gt; &lt;/div&gt; Is there a way to ensure that the hover state gets updated properly after classes are applied and changes occur?
type: Question
tagged with: javascript
has title: Trigger css hover state change after transition

http://stackoverflow.com/q/28709716
has answer: http://stackoverflow.com/a/28709728
answer count: 2
downvote count: 0
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28709785
favorite count: 0
has answer: http://stackoverflow.com/a/28709785
tagged with: http://stackoverflow.com/tag/html
has body: I have a "grid" with several input fields per row. Lets say each input field represents a day of the week. html: ... jQuery: $('#grid').on('change', '.fri', function () { var value = $(this).val(); //do something }); $('#grid').on('change', '.mon', function () { var value = $(this).val(); //do something }); // And so on... There can be any number of rows, all having the same fields. I made a working fiddle of what I am trying to do. However, I feel I am repeating myself a little too much (with the jQuery) and I was wondering if there is a way to do the above more concisely (preferably using jQuery).
accepted answer: http://stackoverflow.com/a/28709728
type: AnsweredQuestion
score: 1
upvote count: 1
has title: Grid with multiple input fields per row
type: Question
tagged with: javascript

http://stackoverflow.com/a/28614292
has comment: http://stackoverflow.com/comment/45649653
has comment: http://stackoverflow.com/comment/45540137
type: Answer
accepted answer of: http://stackoverflow.com/q/28613707
has comment: http://stackoverflow.com/comment/45647857
has comment: http://stackoverflow.com/comment/45646583
answers question: http://stackoverflow.com/q/28613707
has body: Try removing the click: $root.Filter binding. Instead, call self.Filter whenever selectedRatings changes by including self.selectedRatings.subscribe(Filter); at the end of your Searcher view model.
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/a/28721539
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28719108
has body: You assertation and expectation are changed. You must assert the function templateUrl is defined and expect the function return to be a string. assert.isDefined(state.templateUrl); expect(state.templateUrl()).toBe('scripts/select-line-module/views/select-line.html'); However, can you check if state is defined? I think it can be undefined.

http://stackoverflow.com/comment/45738832
type: Comment
has text: Looking at the output of oboe on a deeply nested, semi-structured document makes me want to throw up. Ugh. Back to the standards body.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28641538

http://stackoverflow.com/a/28638621
has comment: http://stackoverflow.com/comment/45576926
has comment: http://stackoverflow.com/comment/45577162
type: Answer
score: 1
answers question: http://stackoverflow.com/q/28638455
upvote count: 1
has body: You can specify the position properties of your path explicitly. line.set({top: 0, left: 0}); Fabric.JS seems to include some sort of computed padding by default, based on the line length and canvas size. Try adjusting your canvas dimensions and line length and you'll see the top and left values update automatically. Edit: It appears Fabric.JS may use the center of the canvas to calculate the X,Y positions for canvases. It may use a similar scheme for path origin points. See this related StackOverflow question: Canvas coordinates in Fabric.js have offset It seems to be part of how the library calculates positions automatically. Per the comments of the linked question, you can fix this with: fabric.Object.prototype.originX = true; fabric.Object.prototype.originY = true; And you wont have to adjust the originX or originY properties on each path object.
downvote count: 0

http://stackoverflow.com/comment/45656995
type: QuestionComment
type: Comment
has text: bleh, if you are targeting CSS3 browsers, you could use CSS3 scaling directly on the `img`. Hint: `transform: scale(2,2);`, makes it 200% larger.
comment on: http://stackoverflow.com/q/28681738
score: 0

http://stackoverflow.com/q/28669160
type: AnsweredQuestion
has title: Click one item on a row only
score: 1
accepted answer: http://stackoverflow.com/a/28669206
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 3
has answer: http://stackoverflow.com/a/28669324
favorite count: 0
has answer: http://stackoverflow.com/a/28669206
upvote count: 1
possible better answer: http://stackoverflow.com/a/28669228
has body: Is it possible to disabled the other buttons in a row, when I have selected at least one? $('.bet-offer div.option').click(function(){ if ($(this).hasClass('selected')) { $(this).removeClass('selected'); } else { $(this).addClass('selected'); } }); The result should be the user can click on any buttons in a row, but once clicked, the other items on that row should be disabled already. However, the user can still select buttons from the other items in other rows. Here's the sample fiddle: http://jsfiddle.net/1vuf1gm7/3/ Thanks!
has answer: http://stackoverflow.com/a/28669228

http://stackoverflow.com/comment/92450101
has text: Related: https://stackoverflow.com/questions/8126777/can-you-add-priorities-to-ajax-calls/
comment on: http://stackoverflow.com/q/28722906
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45531950
type: QuestionComment
has text: because the result from `w("div")` is a jQuery object, not an instance of `w`
score: 0
comment on: http://stackoverflow.com/q/28614341
type: Comment

http://stackoverflow.com/comment/45654467
comment on: http://stackoverflow.com/q/28680679
score: 0
type: QuestionComment
type: Comment
has text: @FelixKling: Yeah, you seem to be right: https://babeljs.io/docs/learn-es6/#enhanced-object-literals

http://stackoverflow.com/comment/45626257
score: 0
type: AnswerComment
type: Comment
has text: What about using a templateUrl or template in the directive? So I don't have to have anything in the DOM.
comment on: http://stackoverflow.com/a/28665133

http://stackoverflow.com/comment/45776704
has text: @Chris No problem. Please don't forget to upvote and accept the answer if it was useful.
score: 0
comment on: http://stackoverflow.com/a/28746684
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45671319
type: QuestionComment
has text: You should call `states[i].simulation.config_map` not `states[i].simulation.configMap`
comment on: http://stackoverflow.com/q/28689822
score: 0
type: Comment

http://stackoverflow.com/q/28659488
favorite count: 0
has title: Grid system does not work when it is inside a hidden div
type: UnansweredQuestion
has body: I am using the Salvattore plugin to create a grid based layout for my website. Here is how the plugin should set up in HTML: It basically finds .grid and then .columns3 which determines how many columns the plugin should create inside .grid. The outcome would look like: All works fine, until the .grid is a child of a parent which has display: hidden - i.e: Why I gave it display: none? well, I am trying to use this .grid inside div's which are hidden by default and only show when requested, for example, inside a popup window or UI accordion and tabs. I have created a live test here: http://loai.directory/beta if you look, you will see two containers with the .grid one that works fine and the other one below where it says The hidden div is below me which is the one in question. Here is what I thought of doing "but don't have the skills to try it or even know where to start" - I was wondering, would the problem be solved if using JavaScript to trigger the plugin again each time the .grid state changes?
tagged with: plugins
tagged with: grid
downvote count: 1
has answer: http://stackoverflow.com/a/28660146
score: -1
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28704318
tagged with: jquery
has comment: http://stackoverflow.com/comment/45698846
favorite count: 0
has comment: http://stackoverflow.com/comment/45698497
accepted answer: http://stackoverflow.com/a/28704589
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28704371
has answer: http://stackoverflow.com/a/28704371
upvote count: 2
has title: Closest not working on dynamically added content
has comment: http://stackoverflow.com/comment/45699078
has comment: http://stackoverflow.com/comment/45698434
type: Question
has answer: http://stackoverflow.com/a/28704589
tagged with: javascript
has body: I am trying to use .closest() with my HTML page. I have this HTML : //Content Ok When the user clicks '.button' , im adding this HTML to the above HTML dynamically through an ajax call. The ajax call, on success, appends the below html to body: //Content So, I have listpanel below listcontainer and both of them are inside body. Now i am using .closest as: $listpanel = $('.listpanel'); $div = $listpanel.closest('.listcontainer'); But somehow, the closest is selectin the html element rather than the listcontainer. I am not sure why this is happening. could someone help me with this? Thank you. Edit: This is how my Ajax call looks like: $('.button').click(function(){ $.ajax({ url:"listpanel.html", cache: false, dataType: "html", success:function(data) { $('body').append(data); } }); });
has comment: http://stackoverflow.com/comment/45698623
answer count: 2
has comment: http://stackoverflow.com/comment/45698634
downvote count: 0

http://stackoverflow.com/q/28618268
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28618383
has title: Javascript keeps adding up a sum on total
has answer: http://stackoverflow.com/a/28618519
possible better answer: http://stackoverflow.com/a/28618304
has answer: http://stackoverflow.com/a/28618341
has answer: http://stackoverflow.com/a/28618304
type: Question
has body: I am trying to add up some form fields but it doesn't matter the arrays i tried, it keeps adding up the total value if checked again, I would need it to sum the values from the checkboxes with the input value from Amount only if checked if unchecked value subtracts or doesn't add, Some help is awesomely appreciated. Baby Seat 0-2 Year £5(Day) Child Seat 3-7 Year Seat £7(Day) TomTom GPS Bike Rack Montainbike And My JS is as follow: var updateTotal = function () { var Amount = parseFloat(document.getElementById("Amount").value); var total = 0; total += ($('input[name=baby-st]:checked').length > 0) ? parseFloat($('input[name=baby-st]:checked').val()) : 0; total += ($('input[name=child-st]:checked').length > 0) ? parseFloat($('input[name=child-st]:checked').val()) : 0; total += ($('input[name=gps]:checked').length > 0) ? parseFloat($('input[name=gps]:checked').val()) : 0; total += ($('input[name=bike-rack]:checked').length > 0) ? parseFloat($('input[name=bike-rack]:checked').val()) : 0; total += ($('input[name=mbike]:checked').length > 0) ? parseFloat($('input[name=mbike]:checked').val()) : 0; document.getElementById('Amount').value = Amount+total; }; $('#baby-st, #child-st, #gps, #bike-rack, #mbike').change(function() { if(this.checked) { } updateTotal(); }); THE DEMO
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/28618568
has comment: http://stackoverflow.com/comment/45539531
has answer: http://stackoverflow.com/a/28618383
has comment: http://stackoverflow.com/comment/45540084
answer count: 5

http://stackoverflow.com/comment/45593246
has text: How would I get that to apply to my other text, which is in a table?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28647790

http://stackoverflow.com/comment/45576250
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28638273
score: 0
has text: @Feek it allows it for non-pixel

http://stackoverflow.com/q/28603377
has title: javascript : create objects dynamically
has comment: http://stackoverflow.com/comment/45513046
has answer: http://stackoverflow.com/a/28603470
has body: Ok. I want to create a JSON array dynamically. Case is: Lets say, I have array: var arrayCompanyUsers = ["dealers", "builders"]; From the above array, I want to generate another array as below: [ "dealers" : { "RequestQuote" : false, "PlaceOrder" : false, }, "builder" : { "RequestQuote" : false, "PlaceOrder" : false, } ] Two questions: how to generate resultant array ? can i access the properties as: dealers.RequestQuote ?
answer count: 3
downvote count: 0
favorite count: 0
upvote count: 1
accepted answer: http://stackoverflow.com/a/28603470
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28603512
score: 1
has comment: http://stackoverflow.com/comment/45511914
has comment: http://stackoverflow.com/comment/45511790
possible better answer: http://stackoverflow.com/a/28603455
has answer: http://stackoverflow.com/a/28603455
type: Question
tagged with: arrays
has comment: http://stackoverflow.com/comment/45511837
tagged with: javascript

module
tags question: http://stackoverflow.com/q/28635934
type: Tag
tags question: http://stackoverflow.com/q/28742684
tags question: http://stackoverflow.com/q/28614282
tags question: http://stackoverflow.com/q/28674652
tag name: module

http://stackoverflow.com/comment/45640166
has text: Unfortunately. this does not pass the event to the iframe. I have set the event listener in the iframe and it does not get any thing:(
type: AnswerComment
comment on: http://stackoverflow.com/a/28672306
type: Comment
score: 1

http://stackoverflow.com/q/28647614
type: Question
has title: Limit the amount of times font size can be increased and decreased
has body: In my ruby on rails application I am using the following javascript in the application.js to increase and decrease the text size: function resizeText(multiplier) { var elem = document.getElementById("sizeable"); var currentSize = elem.style.fontSize || 1; elem.style.fontSize = ( parseFloat(currentSize) + (multiplier * 0.2)) + "em"; } And this is called by these pieces of code in the view: &lt;img id="plustext" alt="INCREASE TEXT SIZE" src="images/makeTextBigger.jpg" onclick="resizeText(1)" /&gt; | &lt;img id="minustext" alt="DECREASE TEXT SIZE" src="images/makeTextSmaller.jpg" onclick="resizeText(-1)" /&gt; The code then makes the text with the id sizeable bigger or smaller depending on what was clicked: &lt;tr id='sizeable'&gt; &lt;td&gt;&lt;%= certificate.age_rating %&gt;&lt;/td&gt; &lt;td&gt; &lt;%= link_to 'Edit', edit_certificate_path(certificate) %&gt; &lt;%= link_to 'Show', certificate_path(certificate) %&gt; &lt;%= link_to 'Destroy', certificate_path(certificate), method: :delete, data: { confirm: 'Are you sure?' } %&gt; &lt;/td&gt; &lt;/tr&gt; But what I want to do is restrict the amount of times the font size can be increased and decreased to 2 clicks. I have tried this, and replaced my previous java script so my application.js now looks like this: $(function(){ $('#film_release_date').datepicker({ dateFormat: 'dd-mm-yy', altFormat: 'yy-mm-dd', changeYear: true, maxDate: "5Y", minDate: "0D", changeMonth: true }); }); var minSize = 1; var maxSize = 5; function resizeText(multiplier) { var elem = document.getElementById("sizeable"); var newSize = parseFloat(elem.style.fontSize) + multiplier * 0.2; if (newSize &lt; minSize) newSize = minSize; if (newSize &gt; maxSize) newSize = maxSize; elem.style.fontSize = newSize + "em"; } But this appears not to work. How can I adapt my code to do this? I do not have much knowledge of java script.
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45592799
has comment: http://stackoverflow.com/comment/45593040
has answer: http://stackoverflow.com/a/28649777
possible better answer: http://stackoverflow.com/a/28647762
has answer: http://stackoverflow.com/a/28647762
tagged with: ruby-on-rails
tagged with: limit
answer count: 4
has answer: http://stackoverflow.com/a/28647790
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28648377
tagged with: font-size
accepted answer: http://stackoverflow.com/a/28649777
score: 0

http://stackoverflow.com/q/28666434
has body: I am trying to read a cookie in plain javascript only. I'm not using any jquery cookie library. Here's how my cookie looks: var task_cookie = { task1 : getTask('task1') , task2 : getTask('task2') , task3: getTask('task3') , task4: getTask('task4') , task5: getTask('task5') }; document.cookie = "task_cookie=" + JSON.stringify(task_cookie)+";path=/;domain=.task.com"; Now, I'm trying to read the value of task_cookie later on a different page I found this code on stackoverflow function read_cookie(name) { var result = document.cookie.match(new RegExp(name + '=([^;]+)')); result &amp;&amp; (result = JSON.parse(result[1])); return result; } But this would give me the whole task_cookie.I however want to grab each key value inside the task_cookie. I want something like this: $.cookie('task1') $.cookie('task2') However this is very easy in jquery after I stringify. But forsome reason I need to use pure javascript. How can I get individual values of task1 , task2 etc which are inside the task_cookie object? I'm having a hard time figuring this out :/
tagged with: cookies
has answer: http://stackoverflow.com/a/28666530
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28666530
tagged with: javascript
type: Question
has comment: http://stackoverflow.com/comment/45627611
has title: Reading a cookie(which is an object) in pure javascript
possible better answer: http://stackoverflow.com/a/28666501
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28666501
has comment: http://stackoverflow.com/comment/45627629

http://stackoverflow.com/comment/45594959
comment on: http://stackoverflow.com/q/28648587
score: 0
type: QuestionComment
type: Comment
has text: there is no #expose-mask in your HTML code.

http://stackoverflow.com/a/28633429
answers question: http://stackoverflow.com/q/28633104
has comment: http://stackoverflow.com/comment/45567159
has body: One thing you could do would be to have 'caller' call the function passed into it, and print the returned value. function caller(func) { function printMessage(message) { console.log(message); } printMessage(func()); } function callee() { return 'hello world'; } function callee2() { return 'hello world 2'; } caller(callee); caller(callee2); Edit After reading your comments on question, this may be better suited to an OO approach e.g: //--- Base 'libary' caller ---// var caller = function() { } //--- Add out printMessage function to our base libary ---// caller.prototype.printMessage = function(message){ console.log(message); } //--- Users 'libary' callee ---// var callee = function() { caller.call(this); //--- Our users libary has a printing function ---// this.print = function ( message ) { this.printMessage("callee &gt; " + message); } } callee.prototype = Object.create(caller.prototype); // Set callee's prototype to caller's prototype callee.prototype.constructor = callee; // Set constructor back to callee //--- Using the users libary ---// var userLibary = new callee(); userLibary.print("hello world"); // 'callee &gt; hello world' //--- The original libary's print method is still accessible ---// userLibary.printMessage("hello world"); // 'hello world'
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45567431

xlink
type: Tag
tag name: xlink
tags question: http://stackoverflow.com/q/28722162

http://stackoverflow.com/q/28681652
score: 0
has body: After loading geojson polygons, I want to implement a toggle menu to filter by a value. I assume the implementation is similar to this cartodb map which uses SQL statements. I image I could use a layer-selector and pass a variable from a menu such as District 1 . My code just brings in and styles a layer of 15 polygons. I want to keep this, but add a filter. How is this done in leaflet? Examples much appreciated. L.mapbox.accessToken = 'pk.eyJ1Ijoic2tvcmFzYXVydXMiLCJhIjoiaEdGTUZWTSJ9.osOC8tWU3bMaNprVNoEu7g'; var lamap = L.mapbox.map('mapid', 'skorasaurus.5eb85050') .setView([34.000880, -118.04036], 10); var featLayer = L.mapbox.featureLayer().addTo(lamap); featLayer.loadURL('citycouncils.geojson'); function getMyColor(myargument) { if (myargument === '1') { return '#996767' }; if (myargument === '2') { return '#679967' }; if (myargument === '10') { return '#672799' }; if (myargument === '14') { return '#670099' }; if (myargument === '15') { return '#699799' }; } // styles each polygon based on its properties in the geojson file, using leaflet's setStyle featLayer.on('ready', function() { featLayer.eachLayer(function(polygon) { polygon.bindPopup('District ' + polygon.feature.properties.DISTRICT); console.log(typeof setStyle); polygon.setStyle({ opacity: 0.55, weight: 2, opacity: 1, fillOpacity: 0.55, fillColor: getMyColor(polygon.feature.properties.DISTRICT), color: 'white' }); }); });
answer count: 1
accepted answer: http://stackoverflow.com/a/28683388
tagged with: leaflet
has comment: http://stackoverflow.com/comment/45657572
type: AnsweredQuestion
tagged with: javascript
has answer: http://stackoverflow.com/a/28683388
has comment: http://stackoverflow.com/comment/45656195
type: Question
has title: How to filter geojson using toggle buttons in Leaflet?

http://stackoverflow.com/a/28642366
has comment: http://stackoverflow.com/comment/45690311
has body: This seems to work fine. Here is a working demo. Here is the relevant code var data = { line: 'abc,Siva,Naga,def' }; Handlebars.registerHelper('lineBreak', function(line, delim) { return new Handlebars.SafeString(line.split(delim).join('&lt;br/&gt;')); }); {{lineBreak line ','}}
has comment: http://stackoverflow.com/comment/45692302
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/28638350
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45690936

http://stackoverflow.com/a/28728866
type: Answer
accepted answer of: http://stackoverflow.com/q/28728788
answers question: http://stackoverflow.com/q/28728788
has comment: http://stackoverflow.com/comment/45747444
score: 0
type: AcceptedAnswer
has body: You can maintain a session storage variable(https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage) and delete it once work is done, this way you will access to the target path and at the same time maintain the security as well.

http://stackoverflow.com/a/28694581
score: 0
answers question: http://stackoverflow.com/q/28693304
type: Answer
has body: ok I find :) . and post it to help others ,maybe one day ... should write this code on grid dataBinding event : private _onGridDataBinding(e){ if(e.action == "itemchange") {e.preventDefault();} }

http://stackoverflow.com/q/28675693
has comment: http://stackoverflow.com/comment/45644646
tagged with: http://stackoverflow.com/tag/html
tagged with: submit
downvote count: 0
score: 1
favorite count: 0
type: UnansweredQuestion
upvote count: 1
answer count: 0
has title: Make sure that submit function is firing on certain button
type: Question
has body: I have a submit function: jQ("webform-client-form-' . $form['#node']-&gt;nid . '").submit(function(event) var curElement = document.activeElement; console.log(curElement); var $btn = curElement.attr("class"); $webform = $btn.split(\' \')[0]; console.log($webform); if($webform == "webform-submit") { console.log("yeahah"); } var $form = jQ(this); if ($form.find("[data-stripe=\"token\"]").attr("value") == "") { $form.find("button").prop("disabled", true) Stripe.card.createToken($form, stripeResponseHandler); return false; } else { return true; } }); and try do fire that function only on pressing a certain button. Problem is that when pressing the button, document.activeElement is the &lt;html&gt; tag and not the button I pressed. Does anyone know if I did something wrong? Thanks
has comment: http://stackoverflow.com/comment/45648896
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45783136
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28749999
has text: Yes split the page, and then display the content which was previously on the page. So the screen splits and displays the same content on both the sides of the screen but with different action buttons on the page.

http://stackoverflow.com/comment/45729712
score: 0
type: AnswerComment
type: Comment
has text: This closure will make no difference as the commands start immediately
comment on: http://stackoverflow.com/a/28721486

http://stackoverflow.com/comment/45651450
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28678969
has text: Apologize for not explaining clearly. I trying to understand how is the X-Frame-Options options normally set?How can I do it via the server side code. Should a filter be created? How can it be done in the web server configuration?

http://stackoverflow.com/comment/45513672
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28604444
has text: Please share the code you have tried yet.
score: 0

http://stackoverflow.com/q/28625780
tagged with: crop
has body: So I'm trying to get the top left x,y values for the green box to crop an image that has been rotated into a square. The green square can move left and right on the dotted line, so I'm able to get the x value, I'm just having a hard time getting the Y especially when the blue rectangle is a different aspect ratio. So I know how much the blue rectangle has be rotated and with width and height, also the width and height of the bounding box and same for the green square. So I need the min and max Y at a certain X value with a rotation between -10 - 10 degrees? I'm using html and js right now. the blue rectangle is a scrollable div that's rotated inside the square div so you can see a preview of the crop. diagram: https://i.sstatic.net/FwXjZ.jpg thanks
has title: Quick and simple way to get min and max y for square within a rotated rectangle
type: Question
type: AnsweredQuestion
tagged with: rotation
has answer: http://stackoverflow.com/a/28626547
tagged with: javascript
tagged with: image
score: 0
accepted answer: http://stackoverflow.com/a/28626547
tagged with: trigonometry
answer count: 1

http://stackoverflow.com/q/28646788
tagged with: php
tagged with: audio
has body: We are trying to make a html5 audio player in which we have more than one .mp3 file which we shows in tabular form using loop with php and we actually want that : when we will click on every mp3 file then it should be play in only one interface just like as http://gaana.com. What we did : &lt;?php if(isset($_GET['song'])) { $song_name = $_GET['song']; echo "&lt;audio id=\"audio1\" src=\"$song_name.mp3\" controls preload=\"none\" type=\"audio/mp3\" autobuffer autoplay&gt;&lt;/audio&gt;"; } ?&gt; &lt;script&gt; function EvalSound(soundobj) { var thissound=document.getElementById(soundobj); thissound.play(); } function EvalSound1(soundobj1) { var thissound=document.getElementById(soundobj1); thissound.pause(); } &lt;/script&gt; in the above code we are getting the .mp3 file using get method and we are passing the mp3 file name in within url.
type: UnansweredQuestion
has title: How to play many audio files with one html5 audio player
tagged with: javascript
type: Question
score: 0
answer count: 1
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28646899

http://stackoverflow.com/q/28690643
has comment: http://stackoverflow.com/comment/45675578
has comment: http://stackoverflow.com/comment/63933170
accepted answer: http://stackoverflow.com/a/28692538
tagged with: base64
score: 24
type: Question
possible better answer: http://stackoverflow.com/a/61195034
tagged with: html5-canvas
tagged with: firefox
downvote count: 0
tagged with: javascript
has title: Firefox error rendering an SVG image to HTML5 canvas with drawImage
favorite count: 0
has comment: http://stackoverflow.com/comment/45676067
has body: I am trying to convert an external svg icon to a base64 png using a canvas. It is working in all browsers except Firefox, which throws an error "NS_ERROR_NOT_AVAILABLE". var img = new Image(); img.src = "icon.svg"; img.onload = function() { var canvas = document.createElement("canvas"); canvas.width = this.width; canvas.height = this.height; var ctx = canvas.getContext("2d"); ctx.drawImage(this, 0, 0); var dataURL = canvas.toDataURL("image/png"); return dataURL; }; Can anyone help me on this please? Thanks in advance.
has comment: http://stackoverflow.com/comment/45675625
answer count: 3
has answer: http://stackoverflow.com/a/28692538
tagged with: http://stackoverflow.com/tag/svg
has comment: http://stackoverflow.com/comment/45672948
has answer: http://stackoverflow.com/a/63737712
upvote count: 24
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/61195034

http://stackoverflow.com/comment/134567762
comment on: http://stackoverflow.com/a/70324242
has text: Except now things like Burp Suite are now a thing. Edit: I know that it existed before this answer was posted
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28718135
score: 0
upvote count: 1
answer count: 1
downvote count: 1
has body: I've got an app in which I'm taking a POST request with 2 variables. Next I take info from three collections based on those variables. And with collected data i make save request to another collection. What I've got now is weird structure like One.findOne({var: variable}, function(err, one) { Two.findOne({var: variable}, function(err, two) { Three.findOne({var: two.something}, function(err, three) { var something = new Four(); something.data = {one: one, two: two, three: three}; something.Save(); }); }); }); Is there any possibility to make it like the one below? Or is it proper to build that nested build? Or maybe I should rethink my db structure? GetOne(); GetTwo(); GetThree(); var something = new Four(); var something = new Four(); something.data = {one: one, two: two, three: three}; something.Save();
favorite count: 0
accepted answer: http://stackoverflow.com/a/28718654
tagged with: node.js
has answer: http://stackoverflow.com/a/28718654
type: AnsweredQuestion
has title: Mongoose multiple requests to build another without nesting
type: Question
tagged with: mongoose
tagged with: javascript

http://stackoverflow.com/q/28683384
has body: I'm using Node.js 0.10 + WebSocket-Node (Seen here) hosted by openshift and thats pretty much it, i'm not using express. Other than being unable to get any connecting client's ip address the server is otherwise behaving exactly as intended and processing websocket requests and connections wonderfully. I've done my homework and I know openshift is behind a reverse proxy and the x-forwarded-for header should be consulted for the correct ip. However the WebSocketRequest.remoteAddress property, (which is meant to take its returned ip from the X-Forwarded-For header if its present,) returns the value of OPENSHIFT_NODEJS_IP (as listed in rhc env), which is presumably the server's ip. Furthermore i've manually gone through the WebSocketRequest.httpRequest object, (which is meant to be a reference to the original Node HTTP request object) and can't find any trace of the x-forwarded-for header in there, (Though I won't pretend to be anywhere near knowledgable enough to understand what I did see in there.) My server also processes standard HTTP requests which DO return the clients ip when I check request.headers['x-forwarded-for'], sadly this doesn't help get the IP's of clients connected via websocket though, as they do not trigger a standard HTTP response. I must be missing something here and would be extremely grateful for any new routes of investigation or cunning workarounds anyone can offer.
answer count: 1
tagged with: websocket
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/35373779
linked to: http://stackoverflow.com/q/28687910
favorite count: 0
has title: Why can't I get the connecting client's ip address on my server running Node.js + Websocket hosted by Openshift (Using WebSocket-Node)
type: UnansweredQuestion
tagged with: openshift
tagged with: node.js
score: 3
upvote count: 3
type: Question

http://stackoverflow.com/a/28707642
downvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28706389
has body: Here is what I changed the PHP to: if ($deletion_count = deleteUsers($deletions)) { $successes[] = lang("ACCOUNT_DELETIONS_SUCCESSFUL", array($deletion_count)); echo resultBlock($errors,$successes); } else { $errors[] = lang("SQL_ERROR"); echo resultBlock($errors,$successes); } And the I changed the AJAX to this: function deleteUser(){ var id = &lt;?php echo $userdetails['id'] ?&gt;; $.ajax({ type: "POST", url: 'admin_user.php?id=' + id, data: $('form.adminUser').serialize(), error: function(e){ alert(e); }, success: function (data) { result = $(data).find("#success"); $('#resultBlock').html(result); } }); } Because data was loading all html I had to find exactly what I was looking for out of the HTMl so that is why I did .find.
score: 0
upvote count: 1

http://stackoverflow.com/a/28620120
score: 0
has body: meager has pretty much summed things up if you're talking about accessing public instance properties or methods. You have to use this in front of it as that's just how the language works. But, if you have private instance properties or methods, you can define those as local variables inside the constructor and you can access them without this. function slideshow(options) { // no need to resave the options arguments as they can be used // directly from the argument variable // define a per-instance private variable that other methods defined // within the constructor can use directly without the use of `this` var theShow = $(options.selector || '#slideshow'); // define public methods this.method1 = function() { // can access private instance variable here without this in front of it theShow.addClass('test'); } this.method2 = function() { theShow.addClass(options.decoaration); } } This general design pattern is described here: http://javascript.crockford.com/private.html Practically speaking, this works because the constructor function with the public methods declared inside it creates a closure that lasts for the duration of the object lifetime so the local variables in the constructor become per-instance variables accessible only from the functions declared within the constructor.
answers question: http://stackoverflow.com/q/28620049
type: Answer

http://stackoverflow.com/q/28644523
has comment: http://stackoverflow.com/comment/45587217
type: AnsweredQuestion
score: 1
tagged with: wordpress
has body: I have an issue with my ajax pagination on wordpress : $(function($) { // When i click on pagination link $('.last-news').on('click', '.pagination a', function(e){ // I remove the default behavior e.preventDefault(); // Then i add a smoothscroll to the top var scrollPosition = $(window).scrollTop(), $content = $('.last-news .content'); $('html, body').stop().animate({ scrollTop:$("#last-news").offset().top }, 400); // There is the ajax code where i get the content of my link var link = $(this).attr('href'); // I fadeOut the content before i fadeIn the new one $content.fadeOut(200, function(){ // I call the content of my link $content.load(link + '.last-news .content', function() { $content.fadeIn(200); // I change the url without refreshing the page history.pushState(null, null, link); }); }); }); }); The url of my page is like : localhost/my_site/page/x The pagination works well without javascript This code worked strangely when i had this type of permalink: localhost/my_site/?&amp;paged=x (The x+1/x-1 and next/prev links worked but when i called the last page nothing happened) Now i have an error when i console.log the error of .load() ("error") How can i debug this? (Im not familliar enough with ajax :s). Do you have any idea what i can try to fix it? Thanks for your time
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45587486
tagged with: javascript
has title: Ajax pagination wordpress
has answer: http://stackoverflow.com/a/28657008
answer count: 1
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/45589168
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/45587289
accepted answer: http://stackoverflow.com/a/28657008

http://stackoverflow.com/comment/45659451
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28683069
type: QuestionComment
has text: Fixed - had an out of data version of SASS!!!!

http://stackoverflow.com/comment/45751181
type: Comment
comment on: http://stackoverflow.com/a/28732513
type: AnswerComment
has text: Very succinct and easy to understand. Using `$each()` is definitely the way to go.
score: 0

http://stackoverflow.com/comment/45601404
score: 1
has text: Open the inspector, paste in my suggestion into the console. You will see that it indeed works to clear the input. I can't debug the error you're having, but the message indicates that you're possibly trying to select something which isn't an element.
comment on: http://stackoverflow.com/a/28651991
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45666570
type: QuestionComment
comment on: http://stackoverflow.com/q/28686821
has text: I think all you need to call is $set on the new field and updated field, and add { upsert: true }, I am not sure what $inc does. see http://docs.mongodb.org/manual/tutorial/modify-documents/
score: 0
type: Comment

ios
tags question: http://stackoverflow.com/q/28669506
tags question: http://stackoverflow.com/q/28635398
tags question: http://stackoverflow.com/q/28734559
tags question: http://stackoverflow.com/q/28685928
tags question: http://stackoverflow.com/q/28676446
tags question: http://stackoverflow.com/q/28682231
tags question: http://stackoverflow.com/q/28661589
tags question: http://stackoverflow.com/q/28738785
tags question: http://stackoverflow.com/q/28662876
type: Tag
tags question: http://stackoverflow.com/q/28681154
tags question: http://stackoverflow.com/q/28678584
tags question: http://stackoverflow.com/q/28717151
tags question: http://stackoverflow.com/q/28686138
tags question: http://stackoverflow.com/q/28678692
tags question: http://stackoverflow.com/q/28606010
tags question: http://stackoverflow.com/q/28698714
tags question: http://stackoverflow.com/q/28598047
tag name: ios
tags question: http://stackoverflow.com/q/28693111
tags question: http://stackoverflow.com/q/28679460
tags question: http://stackoverflow.com/q/28634761
tags question: http://stackoverflow.com/q/28740721
tags question: http://stackoverflow.com/q/28633939
tags question: http://stackoverflow.com/q/28609393
tags question: http://stackoverflow.com/q/28609164
tags question: http://stackoverflow.com/q/28664703
tags question: http://stackoverflow.com/q/28681409
tags question: http://stackoverflow.com/q/28719973
tags question: http://stackoverflow.com/q/28711222
tags question: http://stackoverflow.com/q/28639000
tags question: http://stackoverflow.com/q/28645971
tags question: http://stackoverflow.com/q/28638293
tags question: http://stackoverflow.com/q/28693688
tags question: http://stackoverflow.com/q/28702375
tags question: http://stackoverflow.com/q/28707996
tags question: http://stackoverflow.com/q/28696578
tags question: http://stackoverflow.com/q/28615331
tags question: http://stackoverflow.com/q/28662653
tags question: http://stackoverflow.com/q/28594278
tags question: http://stackoverflow.com/q/28718124
tags question: http://stackoverflow.com/q/28595297
tags question: http://stackoverflow.com/q/28747912

http://stackoverflow.com/comment/45551697
score: 0
type: Comment
type: QuestionComment
has text: what about the first message ?
comment on: http://stackoverflow.com/q/28625281

http://stackoverflow.com/comment/45627733
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28665614
score: 0
has text: The jQueryUI tooltip

http://stackoverflow.com/comment/45608971
has text: your rendering the form within a modal, that changes things, look at https://coderwall.com/p/ej0mhg/open-a-rails-form-with-twitter-bootstrap-modals You also have some html errors, like a form tag wrapping your actual form, form_for creates this tag for you
score: 0
comment on: http://stackoverflow.com/q/28651743
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45787481
type: Comment
comment on: http://stackoverflow.com/a/28746838
has text: you could map, but it would be better to iterate in that case, I added code to demonstrate. Advantage of using array.prototype built in methods for iterating is that it is less code and logic for you, and if performance isn't an issue it becomes a simpler task and less variables to keep track of.
type: AnswerComment
score: 0

http://stackoverflow.com/a/28595845
has body: You can use split like this: var str = '15/17/*18/20/*22'; var m = str.split(/\d+/).filter(Boolean); //=&gt; ["/", "/*", "/", "/*"] Or else (thanks to @hwnd): var m = str.split(/[^/*]+/).filter(Boolean);
has comment: http://stackoverflow.com/comment/45498286
has comment: http://stackoverflow.com/comment/45498307
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45498510
type: Answer
answers question: http://stackoverflow.com/q/28595772
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/45498330
accepted answer of: http://stackoverflow.com/q/28595772

http://stackoverflow.com/comment/45746979
comment on: http://stackoverflow.com/a/28730276
type: AnswerComment
score: 0
type: Comment
has text: I like this one but it doesn't work on my Chrome. Can you double check this answer please?

http://stackoverflow.com/q/28690901
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28690987
type: Question
has title: Toastr Growl is not showing up after a successful AJAX call
tagged with: toastr
has answer: http://stackoverflow.com/a/28690987
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
answer count: 1
has body: Working through my JavaScript code, I'm able to get the alert for malformed URLs working but when a successful POST happened, I can get the response.id to show up via an alert call but not using the same toastr growl I used for my malformed URLs logic. Am I missing something? &lt;link href="http://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.css" rel="stylesheet"/&gt; &lt;script src="http://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function () { $('#submit').click(function () { var txt = $('#url').val(); var re = /(http(s)?:\\)?([\w-]+\.)+[\w-]+[.com|.in|.org]+(\[\?%&amp;=]*)?/ if (!re.test(txt)) { toastr.options = { "closeButton": false, "debug": false, "newestOnTop": false, "progressBar": false, "positionClass": "toast-bottom-center", "preventDuplicates": false, "onclick": null, "showDuration": "300", "hideDuration": "1000", "timeOut": "5000", "extendedTimeOut": "1000", "showEasing": "swing", "hideEasing": "linear", "showMethod": "fadeIn", "hideMethod": "fadeOut" }; toastr["error"]("Invalid URL!"); $('#url').val(''); return false; } $.ajax({ url: "{{ url_for('api.start_status') }}", type: 'POST', contentType: "application/json", dataType: 'json', data: JSON.stringify({"url": txt}), success: function (response) { var meme = response.id; toastr(meme); } }); }); }); &lt;/script&gt; UPDATE #1: As suggested, this is the code now and it still shows the same behavior. Confirmed that it also doesn't work in SAFARI so at least 2 browsers show the same issue. &lt;link href="http://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.css" rel="stylesheet"/&gt; &lt;script src="http://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function () { toastr.options = { "closeButton": false, "debug": true, "newestOnTop": false, "progressBar": false, "positionClass": "toast-bottom-center", "preventDuplicates": fals…
tagged with: python

http://stackoverflow.com/comment/45570447
comment on: http://stackoverflow.com/a/28612586
has text: What about HTTP Streaming ? Can that be used to implement chat ?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28743091
type: Question
has body: I want to use zombie js to test my little node app. I'm using the mock ressoures with zombie but when i write body: object in mock.the xhr always fail because of Request Failed: parsererror, SyntaxError: Unexpected token o when i write body: 'json content' xhr work well To test this client js var xhrGetRiver = $.getJSON("api/1/settings/rivers/fs/") xhrGetRiver.done(function(json) { console.log(json); $.each(json, function(index, fsriver) { insertFSRiver(fsriver); }); }); xhrGetRiver.fail(function(jqxhr, textStatus, error) { var err = textStatus + ', ' + error; console.log("Request Failed: " + err); }); I have write this test var data = []; var json = { "id": "test", "properties": { "url": "/tmp", "server": "192.168.9.2", "port": 22, "username": "testUser", "password": "test", "protocol": "ssh", "update_rate": "15m", "includes": "*.docx" } }; data.push(json); this.browser.resources.mock('/api/1/settings/rivers/fs/', { statusCode: 200, headers: { 'ContentType': 'application/json' }, body: data // xhr fail //body: '[ { "id":... ... } ]' // Work well
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has title: zombie.js xhr json always fail
tagged with: zombie.js
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28743537
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/45512950
comment on: http://stackoverflow.com/a/28603286
type: Comment
has text: I kinda misread the question, and frankly I even thought the `location.href` excluded the hash from the url. Regardless, the correct approach in this case would be to use `location.hash` instead (as it is really the only thing you are checking against). That way you can also drop the .indexOf().
score: 0
type: AnswerComment

http://stackoverflow.com/q/28694230
has answer: http://stackoverflow.com/a/46378840
type: AnsweredQuestion
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47224675
has title: Add click action to countries in raphael JS world map
type: Question
has body: I'm making a world map in which you click a region (North America, Asia etc. ) using raphaeljs and world.js shapes @David Noël has opensourced a way of combining countries into one element which highlights when you rollover, which I have done succesfully. I'm usually OK with Javascript but I can't figure out how to create a click event for these regions, so some relevant info pops up for each region. I think there may be the answer in Davids link above but I don't fully understand the documentation You can see my progress so far here.. http://thetally.efinancialnews.com/tallyassets/mapareas/index.html
tagged with: javascript
has answer: http://stackoverflow.com/a/29630635
tagged with: raphael
tagged with: click
has comment: http://stackoverflow.com/comment/47403633
answer count: 2
downvote count: 0
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
possible better answer: http://stackoverflow.com/a/46378840
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29630635

http://stackoverflow.com/comment/45507360
score: 0
type: Comment
has text: So close. Unfortunately, this won't workusing multiple like so: {x}, {y}, and {z} `code` var elementScore = $("#score"); elementScore.data("source", elementScore.html()); elementScore.html(elementScore.data("source").replace(/({x})/g, totalScore)); elementScore.html(elementScore.data("source").replace(/({y})/g, mostOccur)); elementScore.html(elementScore.data("source").replace(/({z})/g, highestDiceValue)); also, I don't know how to edit code in comments. but the issue is only {z} gets changed proper. @samuel goodell
comment on: http://stackoverflow.com/a/28599267
type: AnswerComment

http://stackoverflow.com/comment/45635027
has text: @Ja͢ck, 2 points. First,in your solution also, image is loaded before logged in to console (try put an alert instead to make sure). Second, if you subscribe onload event after setting src to the image element, it will not always works fine.
comment on: http://stackoverflow.com/a/28669931
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45783528
has text: I do not get any exception, but the result of all the four **doc.select()** calls above are arrays with size 0. I am running this on GAE (Google AppEngine)
comment on: http://stackoverflow.com/q/28747797
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28613500
has comment: http://stackoverflow.com/comment/45530692
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45530553
has comment: http://stackoverflow.com/comment/45530589
has comment: http://stackoverflow.com/comment/45530644
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45530618
has comment: http://stackoverflow.com/comment/45530662
has body: You'll need to make use of an API if you want real-time updates. Open Exchange Rates API has tiered pricing, but they do seem to have a basic version which is free for personal use . Otherwise you could make use of a library like Money.js that is essentially a wrapper to Open Exchange Rates API (looks like you still need to sign up for an account with Open Exchange). Money.js seems super easy to use. They have an editor on their site so you can test out examples in JavaScript. This is how I tested it: var price = 10; fx.convert(price, {from: 'USD', to: 'GBP'}); //6.475340000000001
type: Answer
accepted answer of: http://stackoverflow.com/q/28613361
answers question: http://stackoverflow.com/q/28613361

http://stackoverflow.com/comment/45681329
type: AnswerComment
score: 0
has text: Politeness doesn't cost a thing. Did you make yourself a .htaccess file?
type: Comment
comment on: http://stackoverflow.com/a/28694738

http://stackoverflow.com/q/28620519
tagged with: ajax
has comment: http://stackoverflow.com/comment/45751238
downvote count: 0
has body: I have his code below that will collapse other tree nodes when I expand a node. My question is, how is primefaces doing this? Is this a built-in feature? &lt;h:form id="mytreeform"&gt; &lt;p:remoteCommand name="helloworld" update="mytree" /&gt; &lt;p:tree id="mytree" value="#{treeView.root}" var="node" dynamic="true"&gt; &lt;p:treeNode type="node" expandedIcon="ui-icon-folder-open" collapsedIcon="ui-icon-folder-collapsed"&gt; &lt;h:outputText value="#{node.name}" /&gt; &lt;/p:treeNode&gt; &lt;p:treeNode type="leaf" icon="ui-icon-document"&gt; &lt;h:outputText value="#{node.name}" /&gt; &lt;/p:treeNode&gt; &lt;p:ajax event="expand" listener="#{treeView.onNodeExpand}" oncomplete="helloworld()" /&gt; &lt;/p:tree&gt; &lt;/h:form&gt; #{treeView.onNodeExpand} just add leaf to the node being expanded.
has title: How primefaces <p:ajax oncomplete work?
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/45552848
answer count: 0
tagged with: primefaces
score: 1
has comment: http://stackoverflow.com/comment/45842327
type: Question
tagged with: javascript

http://stackoverflow.com/a/28639299
has comment: http://stackoverflow.com/comment/48814662
score: 32
type: Answer
downvote count: 0
has body: You could extend a controller and use it wherever you like. See the Fiddle for a better example. &lt;script&gt; var multiApp = angular.module('new', []); multiApp.controller('aCtrl', ['$scope', '$controller', function ($scope, $controller) { $scope.text1 = 'Hello'; angular.extend(this, $controller('bCtrl', {$scope: $scope})); }]); multiApp.controller('bCtrl', ['$scope', function ($scope) { $scope.text2 = 'World!'; }]); &lt;/script&gt; With html like: &lt;body ng-app="new"&gt; &lt;div id="container1" ng-controller="aCtrl"&gt; {{text1}} {{text2}} &lt;/div&gt; &lt;/body&gt; Fiddle: http://jsfiddle.net/kkelly/thk9n20o/#base.com
upvote count: 32
answers question: http://stackoverflow.com/q/28638823

http://stackoverflow.com/a/28744047
upvote count: 1
score: 1
downvote count: 0
has body: I'm not able to clearly understand your problem, I found a mistake from your code. <input type="radio" name="rads" value="<?php echo $correct; ?>" id = "radio"><?php echo $answer; ?> Value '; try this. sorry if I'm wrong.
answers question: http://stackoverflow.com/q/28743823
type: Answer

http://stackoverflow.com/comment/45637217
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28671684
has text: True, but this is for tests that we run regularly, not ad-hoc testing locally.

http://stackoverflow.com/comment/45682476
has text: your implementation looks fine to me. Are you sure you are not trying to push JSON string? If you want to push JS object, use `JSON.parse(json)` before pushing.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28695348

http://stackoverflow.com/q/28695182
upvote count: 1
type: Question
has title: Multiple character lookup within square brackets with regex
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28695228
tagged with: replace
answer count: 1
downvote count: 0
favorite count: 0
tagged with: regex
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28695228
has body: I’m using regex in JavaScript for certain text replacements to convert legacy encoded text to unicode (it’s an indic language). Suppose I anywhere I find either of a,b,c followed by either of x,y,z followed by e I have to replace it so that e comes first. So I have code like this: modified_substring = modified_substring.replace( /([abc])([xyz]*)e/g , "e$1$2" ) ; Now let us say I want to modify this rule as a or b or c or klm followed by either of x,y,z followed by e. So what would the code be? modified_substring = modified_substring.replace( /([abc]klm)([xyz]*)e/g , "e$1$2" ) ; That apparently doesn’t work. Is there a way to do this?
score: 1

http://stackoverflow.com/comment/45600990
type: Comment
type: QuestionComment
score: 0
has text: That did absolutely nothing
comment on: http://stackoverflow.com/q/28651743

http://stackoverflow.com/a/28631452
downvote count: 0
score: 13
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28631354
answers question: http://stackoverflow.com/q/28631354
type: Answer
upvote count: 13
has body: Since you have specified a relative path to the module, that path is relative to the directory of the source file where require is performed. In your case, it is already relative to the 'router' directory. This will work: var users = require('./users.js'); Or even just the following, since the extension is automatically resolved: var users = require('./users');

http://stackoverflow.com/a/28677201
has comment: http://stackoverflow.com/comment/45648760
type: Answer
has comment: http://stackoverflow.com/comment/45647845
answers question: http://stackoverflow.com/q/28676859
has comment: http://stackoverflow.com/comment/45649266
accepted answer of: http://stackoverflow.com/q/28676859
has comment: http://stackoverflow.com/comment/45649493
has body: I think this is what you're looking for. I had to change the number of "correct" answers to two because that's all the html you have. JS: $( "input" ).on( "click", function() { if($('input[value=yes1]:checked, input[value=yes2]:checked').length === 2){ $("#correct").show(); }else{ $("#correct").hide(); } }); Working JS Fiddle: http://jsfiddle.net/akj84vrq/12/
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45648553

http://stackoverflow.com/a/28669166
score: 0
has body: Angular has an $http cache that could help you accomplish something similar: $http.get(url, { cache: true}).success(...); There are also a few other ways using the same cache. Here is a very detailed post How to cache an http get service in angularjs Thanks, Paul
answers question: http://stackoverflow.com/q/28668078
type: Answer

http://stackoverflow.com/comment/45598554
score: 1
has text: Does this help https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_data_attributes ?
comment on: http://stackoverflow.com/q/28650570
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45608149
type: Comment
comment on: http://stackoverflow.com/a/28655667
score: 0
has text: Where in the HTML document does the second script go? (The one with `var elem = ...` ) Also, I think you're missing an opening curly bracket for you function.
type: AnswerComment

http://stackoverflow.com/a/28641723
has comment: http://stackoverflow.com/comment/45654425
accepted answer of: http://stackoverflow.com/q/28641444
answers question: http://stackoverflow.com/q/28641444
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45606769
has comment: http://stackoverflow.com/comment/45591135
type: Answer
downvote count: 0
score: 1
has body: JS Fiddle Demo You have a loop that adds every product until nextMaxItem. Which is equal to perPage * page. So when you call it, you get 10. But the script gives you an error, because you don't have 10, but 7. It cannot find the other ones. To avoid that error, check if it exists in the for loop: if(records[i] === undefined) break; Edit Some other small changes had to be made for it to work with any product number. All the relevant lines modified have a comment with an arrow: var page = 1, perPage = 10, content = document.getElementById('content'), pagination = document.getElementById('pagination'), records; function paganation(page) { var nextMaxItem = perPage * page, fromItem = (page - 1) * perPage, maxPages = Math.ceil( records.length / perPage ), // <----------- xmlContent = ' '; for (var i = fromItem; i < nextMaxItem; i++) { if(records[i] === undefined) break; // <----------- xmlContent += ' ' + ' ' + ' ' + ' ' + '' + ' ' + records[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue + ' ' + '' + ' ' + records[i].getElementsByTagName("SHORTDESCRIPTION")[0].childNodes[0].nodeValue + ' ' + ' ' + " "; } xmlContent += " "; content.innerHTML = xmlContent; var paginationContent = ""; if (page > 1) { paginationContent += ' Back '; } else { paginationContent += " Back "; } for (var j = 1; j <= maxPages; j++) { // <----------- <= instead of < paginationContent += ' '+j+' '; } var next = page + 1; if (next <= maxPages) { paginationContent += ' Next '; } else { paginationContent += " Next "; } pagination.innerHTML = paginationContent; } 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","/xml/product_catalog.xml",false); xmlhttp.send(); xmlDoc=xmlhttp.responseXML; records = xmlDoc.getElementsByTagName("PRODUCT"); paganation(1);
has comment: http://stackoverflow.com/comment/45583349
has comment: http://stackoverflow.com/comment/45598915
has comment: http://stackoverflow.com/comment/45607010
has comment: http://stackoverflow.com/comment/45606800

http://stackoverflow.com/q/28722872
tagged with: javascript
has answer: http://stackoverflow.com/a/28722965
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45732604
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/45732679
tagged with: php
has answer: http://stackoverflow.com/a/28723665
has body: error show [object Object],[object Object],[object Object] $var address = $('[name=address]').val(); $('.loader1').show(); $.ajax({ url: "address.json", type: "post", dataType: "json", data: { 'address': address, 'street' : global.street }, success: function(data) { if (data.error !== undefined) { alert(data.error); } else { $('#deposit-address').val(data.address); } $('.loader1').hide(); } }); return false; and json file ${"address": [ { "street":"1", "address":"730 test" }, { "street":"2", "address":"630 test" }, { "street":"3", "address":"530 test" } ]}
has title: how to fix jquery ajax data shows [object Object]
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/45733786

http://stackoverflow.com/q/28624363
tagged with: angularjs
has body: I am trying to load a component which is placed in a separate html using HMTL. The problem is that it is to be invoked as soon as the page is loaded in the browser. Below is my Modal Code: The component code is here: termsAndConditions.html Cisco's GSA shipping Policy This policy outlines the requirements of shipping Internationally including but not limited to: All members of the Cisco workforce are responsible to adhere to this policy AST is to not be used for personal shipments Prohibited items Textiles Shipments to Trade shows, hotels, residential addresses Importer of record requirements Shipment of used equipment Other restrictions; including export requirements Fixed Assets shipping from one Cisco entity to another Cisco entity must transfer the value to the receiving entity. It is the responsibility of the person initiating the shipment to ensure this takes place. Please refer to the Asset Management System. AMS is used in US, India, China and Brazil. The asset tracking process will vary for the rest of the countries. PLEASE NOTE: The person initiating the shipment is responsible for the accuracy of all shipment information. Should fines be levied due to misinformation given by individual, all associated costs will be charged to your Department. In International transactions governmental agencies have the power to request evidence to attest to the information given on commercial documentation, either at importation or in subsequent audits. International shipments may be subject to export and/or import licenses. The recipient of the international shipment may be required to obtain import licensing based on the destination country or address (business/residential) or the goods contained within the shipment. I have read and I comply with Cisco's GSA shipping Policy The Way I am invoking the modal using JavaScript is: $(document).ready(function(e) { $('#termsAndConditionsPopover').modal('show'); }); The problem is: if I dont use ng-include this works fine. But w…
linked to: http://stackoverflow.com/q/14968690
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28634715
score: 9
type: Question
upvote count: 9
linked to: http://stackoverflow.com/q/24706490
tagged with: document-ready
has comment: http://stackoverflow.com/comment/45550348
tagged with: javascript
has title: Angular and jQuery ng-include with document.ready not working
tagged with: angularjs-ng-include
accepted answer: http://stackoverflow.com/a/28634715
has comment: http://stackoverflow.com/comment/45556293
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0

utf-8
tags question: http://stackoverflow.com/q/28668226
tags question: http://stackoverflow.com/q/28594631
tags question: http://stackoverflow.com/q/28648101
tag name: utf-8
type: Tag

http://stackoverflow.com/comment/84786332
type: AnswerComment
has text: If anyone encounters a signing issue with this, I used "request" to actually make the call. With the "OAuth" lib, the URL was, I suppose, encoded twice which caused an issue (I had the issue described here: https://stackoverflow.com/questions/26517181/withings-web-api-call-signature-issue)
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28682671

http://stackoverflow.com/q/28739496
favorite count: 0
tagged with: regex
accepted answer: http://stackoverflow.com/a/28739541
has answer: http://stackoverflow.com/a/28739618
score: 2
type: AnsweredQuestion
upvote count: 2
has title: Javascript : Extract words starting with specific character in a string
possible better answer: http://stackoverflow.com/a/28739618
type: Question
has body: I'm having this string : Hey I love #apple and #orange and also #banana I would like to extract every words that start with the # symbol. Currently I'm achieving it with this code : var last = 0; var n = 0; var str = "Hey I love #apple and #orange and also #banana"; do{ n = str.indexOf("#", last); if(n != -1){ //The code found the # char at position 'n' last = n+1; //saving the last found position for next loop //I'm using this to find the end of the word var suffixArr = [' ', '#']; var e = -1; for(var i = 0; i &lt; suffixArr.length;i++){ if(str.indexOf(suffixArr[i], n) != -1){ e = str.indexOf(suffixArr[i], n+1); break; } } if(e == -1){ //Here it could no find banana because there isn't any white space or # after e = str.length; //this is the only possibility i've found } //extracting the word from the string var word = str.substr(n+1, (e-1)-n); } } while (n != -1); How can I manage to find words starting with # and with a-Z characters only. If for example I have #apple! i should be able to extract apple And also, as I mentionned in the code, how do I manage to get the word if it appears at the end of the string
tagged with: javascript
has answer: http://stackoverflow.com/a/28739541
answer count: 2
linked to: http://stackoverflow.com/q/13554208
downvote count: 0
tagged with: string
has comment: http://stackoverflow.com/comment/45762694

http://stackoverflow.com/comment/45733950
comment on: http://stackoverflow.com/a/28722543
score: 0
type: Comment
has text: I did. Same effect. There is no problem with propertyB caching because when i call it via console, i can see that it reevaluates the function even without using "volatile". The problem is, that propertyA does not recognise its dirty state.
type: AnswerComment

http://stackoverflow.com/q/28658235
has title: How to make a link that randomize a group of links when clicked?
has comment: http://stackoverflow.com/comment/45612405
upvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/28658304
tagged with: javascript
favorite count: 0
score: -1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28658304
has body: I tried this code from a certain website.... function randomlinks(){ var myrandom=Math.round(Math.random()*9) var links=new Array() links[0]="http://www.javascriptkit.com" links[1]="http://www.dynamicdrive.com" links[2]="http://www.cssdrive.com" links[3]="http://www.codingforums.com" links[4]="http://www.news.com" links[5]="http://www.gamespot.com" links[6]="http://www.msnbc.com" links[7]="http://www.cnn.com" links[8]="http://news.bbc.co.uk" links[9]="http://www.news.com.au" window.location=links[myrandom] } &lt;form&gt; &lt;input type="button" value="random link!" onClick="randomlinks()"&gt; &lt;/form&gt; it works very well... i changed &lt;form&gt; part to &lt;form&gt; &lt;input type="image" src="img.jpg" value="random link!" onClick="randomlinks()"&gt; &lt;/form&gt; it didn't work. please help me find out why! thank you..i'll wait
downvote count: 1
type: Question

http://stackoverflow.com/a/28813361
type: AcceptedAnswer
has body: Option 1: JASMINE STANDALONE Included is a sample app and sample tests. Open SpecRunner.html and run the included specs. Both the source files and their respective specs are linked in the of the SpecRunner.html. To start using Jasmine, replace the source/spec files with your own. Load the SpecRunner.html in your favorite browser https://jasmine.github.io/pages/getting_started.html Option 2: https://github.com/airportyh/testem.
type: Answer
score: 11
upvote count: 14
downvote count: 3
accepted answer of: http://stackoverflow.com/q/28686015
answers question: http://stackoverflow.com/q/28686015

http://stackoverflow.com/comment/45690866
comment on: http://stackoverflow.com/a/28698704
score: 0
type: AnswerComment
has text: Your code doesn't show how to change the enemy being attacked at all.
type: Comment

http://stackoverflow.com/comment/45700872
type: AnswerComment
comment on: http://stackoverflow.com/a/28704976
type: Comment
has text: Try the edited version. Basically you define a function on resize() event but don't really call it.
score: 0

http://stackoverflow.com/q/28715748
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
tagged with: css
tagged with: datatable
type: UnansweredQuestion
has title: allowing to type in datatable search button after table refresh
has answer: http://stackoverflow.com/a/28715866
type: Question
has body: My application is using datatable in which I am refreshing the table for every 25 seconds. If User types in the search text just a moment before the 25 seconds update time due to flickering the cursor inside search text box is losing its focus inside text box. How to avoid this??

http://stackoverflow.com/comment/45577542
type: Comment
type: QuestionComment
has text: Could you describe how it is done in HTML5 Canvas?
comment on: http://stackoverflow.com/q/28638627
score: 0

http://stackoverflow.com/comment/45662160
comment on: http://stackoverflow.com/q/28684653
score: 1
has text: `gradeData` seems to be an array, how does an array compare to the number `90` etc ?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28613944
type: Answer
score: 3
has body: As @MikeAtkins says you are trying to data bind the outer object. Try: var dataset = { "people": [ { "name": "person1", "projects": [ ... ] }, ... ] }; d3.select('body') .selectAll('p') .data(dataset.people) .enter() .append('p') .text(function(d){ return d.name; }); If you want to bind to the NESTED arrays (i.e. each project for each person) you should see this tutorial.
upvote count: 3
answers question: http://stackoverflow.com/q/28613475
downvote count: 0

http://stackoverflow.com/q/28635189
score: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45570288
has comment: http://stackoverflow.com/comment/45570257
linked to: http://stackoverflow.com/q/1133770
tagged with: node.js
has title: replacing string number with actual number itself
has comment: http://stackoverflow.com/comment/45570450
has comment: http://stackoverflow.com/comment/45570270
answer count: 0
type: UnansweredQuestion
type: Question
duplicate of: http://stackoverflow.com/q/1133770
has comment: http://stackoverflow.com/comment/45571628
has body: I have an api that calls: http://example.com/games?maxplayers=10 then I use url.parse(req.url,true).query which returns: { maxplayers: '10' } I would like to replace the string that contains 10 with the actual int value of 10 so I can query my database and return a result. As of right now it returns no result because it recognizes the 10 as a string. Any insight? EDIT: I tried this: var example = parseInt(url.parse(req.url,true).query) console.log(example); However all it prints is "NAN" I need it to return: { maxplayers: 10 }

http://stackoverflow.com/a/28630121
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/28629496
has body: try this : $(document).ready(function(){ $("a.explode").click(function(){ var _rule = $(this).parent().text(); alert(_rule); }); });
type: Answer
score: 0

http://stackoverflow.com/a/28694675
score: 0
answers question: http://stackoverflow.com/q/28694443
has body: Use this $("#loginForm").serialize() instead of $("#loginForm:input").serializeArray()
type: Answer

http://stackoverflow.com/a/28629708
has comment: http://stackoverflow.com/comment/45559715
type: Answer
has body: Change <input type=button value="test" onClick="self.location='http://127.0.0.1/info.php?runFunction=main'" to
answers question: http://stackoverflow.com/q/28629019
score: 0

http://stackoverflow.com/comment/45562916
score: 0
type: Comment
has text: i add it. It' does not correct the problem.
type: QuestionComment
comment on: http://stackoverflow.com/q/28631283

http://stackoverflow.com/comment/45594978
has text: You should not have that `done` callback if you intend to use promises. I don't know `bcrypt`, but it might even return promises only when no callback is passed.
score: 1
comment on: http://stackoverflow.com/q/28643775
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45539818
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28618343
has text: If I understand you correctly, what you're asking for is prevented because the scope within the function is inaccessible from outside of it. That is intended behavior. Unless your variable is declared outside of the function, or the function returns the variable, you will have no way to access it. Sample code would help clarify, but I think what you're asking for is not possible. If you could post sample code and what you hope to achieve, perhaps we can reach an alternate solution.

http://stackoverflow.com/comment/45768444
has text: I read it thnx for that! but what means it..?
comment on: http://stackoverflow.com/q/28742744
type: Comment
type: QuestionComment
score: 0

httpwebrequest
tags question: http://stackoverflow.com/q/28677109
type: Tag
tag name: httpwebrequest

http://stackoverflow.com/comment/45743984
comment on: http://stackoverflow.com/q/28728810
type: Comment
type: QuestionComment
score: 1
has text: Can store initial value right on the select using jQuery data()

http://stackoverflow.com/a/30148748
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28593992
downvote count: 0
score: 1
has body: Use angularFilesort to order files by dependency: // gulp/unit-tests.js ... // around line 36 inserted the following line: .pipe($.angularFilesort()) So should look like: gulp.src(srcFiles) .pipe($.angularFilesort()) .pipe(concat(function(files) { callback(bowerDeps.js .concat(_.pluck(files, 'path')) .concat(htmlFiles) .concat(specFiles)); }))

http://stackoverflow.com/q/28728598
score: -2
tagged with: javascript
tagged with: jquery
has title: How to send data of a form without refreshing using AJAX?
favorite count: 0
has answer: http://stackoverflow.com/a/28729103
tagged with: ajax
downvote count: 2
upvote count: 0
has answer: http://stackoverflow.com/a/28728753
type: UnansweredQuestion
tagged with: php
linked to: http://stackoverflow.com/q/5004233
has comment: http://stackoverflow.com/comment/45743538
has body: I have a form that contains just two buttons, a like and a dislike button. Each button gets the ID of a product in the 'action' section of the button and I want to pass that to a php file that contains a pdo function to submit a like/dislike to my database, but I don't want the page to refresh. I am really new to AJAX and have no clue on how to use it to solve this problem. Below is the relevant code, I'm wondering if I can get any tips on how to use AJAX with the code I have? index.html getID() .'" method="post"> index.php if (isset($_POST["like"])) { $productDataSet = new productDataSet(); $productDataSet->addLike(); } if (isset($_POST["dislike"])) { $productDataSet = new productDataSet(); $productDataSet->addDislike(); }
type: Question
answer count: 2

http://stackoverflow.com/a/28721871
accepted answer of: http://stackoverflow.com/q/28721794
type: Answer
answers question: http://stackoverflow.com/q/28721794
upvote count: 3
has comment: http://stackoverflow.com/comment/45734007
has body: here is a JsFiddle is that what you need ? for (var key in family) { var obj = family[key]; for (var prop in obj) { alert(prop + " = " + obj[prop]); } } Here is the way to access the properties directly and not with a loop jsFIddle (Method 2, uncomment)
score: 3
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45690778
has text: @Chuck No no no, it's not about the clear timeout, it is about having 3 timers running at the same time. One that last 500ms, one at 1000ms and one at 1500ms. You should wait until 1 timer finish before triggering the other one, just like that : http://jsfiddle.net/tsx18ttf/
comment on: http://stackoverflow.com/a/28697947
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/comment/55349120
has text: Thanks, added a new link
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28668850
type: AnswerComment

http://stackoverflow.com/q/28719417
score: 0
tagged with: css
has title: why is setTimeout activating my animation ?
accepted answer: http://stackoverflow.com/a/28720261
has body: hey guys have a look at this fiddle : Fiddle. now what i am doing in this fiddle is when i click on any li element , i have a data attribute attached to each li element , and the Jquery code basically grabs the perticular li elements data value and displays it in a div , now i'd really like to combine CSS-3 and Jquery togeather . with CSS-3 , every time i click on a li , it should have a small animation , I.E the below animation should be activated : @keyframes rotate { 0% { transform:rotateX(50deg) translateY(-20px); /*transform: translateX(100px);*/ } 100% { transform:rotateX(0deg) translateX(0px); } } .animated { -webkit-animation-name: rotate; -o-animation-name: rotate; animation-name: rotate; -webkit-animation-duration: 1s; -o-animation-duration: 1s; animation-duration: 1s; } I.E the animation should be activated before the li data can be displayed . now my Jquery code is as follows : $(document).ready(function () { $('ul').on('click', 'li', function () { $this = $(this); var _stor = $this.data('says'); $('.testimo').removeClass('animated').html(_stor).addClass('animated'); }); }); now , i got my problem solved by asking one of my senior colleagues , he just said to use the setTimeOut function and so i changed my Jquery code to something as follows : $(document).ready(function () { $('ul').on('click', 'li', function () { $this = $(this); var _stor = $this.data('says'); $('.testimo').removeClass('animated'); setTimeout(function(){ $('.testimo') .html(_stor).addClass('animated'); },100) }); }); Thsi works perfectly the way i want it to . but my question is WHY does this code work ? what is setTimeout have to do with an animation anyway ? my question is why does the code with setTimeout work ? Heres the fiddle with setTimeout. Thank you. Alexander.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28720261
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/120205801
comment on: http://stackoverflow.com/q/28656977
has text: may the coding gods bless you @Paul
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/45526275
has text: typeof does not take parameters . How is this correct? btw , it does in c#
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28611233

http://stackoverflow.com/a/28735670
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/45756075
has body: it won't work because you are not removing that attribute disabled. function checked(element1, element2) { var myLayer = document.getElementById('acceptbtn'); if (element1.checked == true &amp;&amp; element2.checked == true) { myLayer.class = "submit"; myLayer.removeAttribute("disabled"); } else { myLayer.class = "button:disabled"; myLayer.setAttribute("disabled","disabled"); }; } Update use any other name then checked as it seems to be reserved and not working. you also need to do getElementById for element1 and element2. function checkedFunc(element1Id, element2Id) { var myLayer = document.getElementById('acceptbtn'); var element1 = document.getElementById(element1Id); var element2 = document.getElementById(element2Id); if (element1.checked == true &amp;&amp; element2.checked == true) { myLayer.class = "submit"; myLayer.removeAttribute("disabled"); } else { myLayer.class = "button:disabled"; myLayer.setAttribute("disabled","disabled"); }; } &lt;input type="checkbox" id="f_agree" value="1" onchange="checkedFunc('f_agree', 'f_agree2')"/&gt; &lt;input type="checkbox" id="f_agree2" value="1" onchange="checkedFunc('f_agree','f_agree2')"/&gt; &lt;input type="button" value="check" id="acceptbtn" /&gt;
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28735615
has comment: http://stackoverflow.com/comment/45756235
answers question: http://stackoverflow.com/q/28735615
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45756084

http://stackoverflow.com/a/28737537
type: AcceptedAnswer
has body: One easy way is to convert both values to lower/upper case before indexOf() operation oAc.setFilterFunction(function (sValue, oItem) { debugger; sValue = sValue.toLowerCase(); var val = (oItem.getText().toLowerCase().indexOf(sValue) != -1) || (oItem.getAdditionalText().toLowerCase().indexOf(sValue) != -1); return val; }); Another solution is to use a regex to test the values instead of using indexOf if (!RegExp.escape) { RegExp.escape = function (value) { return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&amp;") }; } oAc.setFilterFunction(function (sValue, oItem) { debugger; var regex = new RegExp(RegExp.escape(sValue), 'i'); var val = regex.test(oItem.getText()) || regex.test(oItem.getAdditionalText()); return val; });
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28737511
answers question: http://stackoverflow.com/q/28737511
upvote count: 2

visual-studio-lightswitch
tags question: http://stackoverflow.com/q/28624550
type: Tag
tag name: visual-studio-lightswitch
tags question: http://stackoverflow.com/q/28626351

http://stackoverflow.com/comment/45516918
comment on: http://stackoverflow.com/a/28606356
has text: I think this is the right direction, any insight on how to safely do that replace?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28634346
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45568639
score: 0
has comment: http://stackoverflow.com/comment/45569213
has body: I managed (so far) to create this jsfiddle. What I want to do other than that is reversing the foggy plugin process using the same button that trigger the whole process with a little help from foggy(false); As you can see, I managed to trigger .foggy on .click but I can't reverse it yet Solution: I noticed that Foggy plugin isn't dynamic enough to remove the attribute that it created, it only removes style="" attr on load. While I am still beginner of JavaScrpit I couldn't edit it to fit my needs, so I decided to use different method to get the main div class="bcontainer" blurry, its simple but effective. since I used .toggleClass with .click I used it to add another class="backgroundblur" to div class="bcontainer" than I used pure css3 -webkit-filter: blur(2px); to get things done, and that is how I did it
has comment: http://stackoverflow.com/comment/45569164
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45569140
has title: jQuery foggy plugin with .click
type: Question

backbone.js
tags question: http://stackoverflow.com/q/28606219
tags question: http://stackoverflow.com/q/28744066
tags question: http://stackoverflow.com/q/28708116
tags question: http://stackoverflow.com/q/28613706
tags question: http://stackoverflow.com/q/28726760
tags question: http://stackoverflow.com/q/28674431
tags question: http://stackoverflow.com/q/28660642
tags question: http://stackoverflow.com/q/28627594
tags question: http://stackoverflow.com/q/28710040
tags question: http://stackoverflow.com/q/28698644
tags question: http://stackoverflow.com/q/28640734
tags question: http://stackoverflow.com/q/28638663
tags question: http://stackoverflow.com/q/28623246
tags question: http://stackoverflow.com/q/28683647
tags question: http://stackoverflow.com/q/28651043
tags question: http://stackoverflow.com/q/28744654
tags question: http://stackoverflow.com/q/28658091
tags question: http://stackoverflow.com/q/28641996
tags question: http://stackoverflow.com/q/28666538
tags question: http://stackoverflow.com/q/28686998
tags question: http://stackoverflow.com/q/28679533
tags question: http://stackoverflow.com/q/28747768
tags question: http://stackoverflow.com/q/28698141
tags question: http://stackoverflow.com/q/28701463
tags question: http://stackoverflow.com/q/28652632
tags question: http://stackoverflow.com/q/28598375
tags question: http://stackoverflow.com/q/28648517
tags question: http://stackoverflow.com/q/28647109
tags question: http://stackoverflow.com/q/28734575
tags question: http://stackoverflow.com/q/28680460
tags question: http://stackoverflow.com/q/28678842
tags question: http://stackoverflow.com/q/28723106
tags question: http://stackoverflow.com/q/28697381
tags question: http://stackoverflow.com/q/28636615
type: Tag
tags question: http://stackoverflow.com/q/28706420
tags question: http://stackoverflow.com/q/28720919
tags question: http://stackoverflow.com/q/28722774
tags question: http://stackoverflow.com/q/28618343
tags question: http://stackoverflow.com/q/28634666
tag name: backbone.js
tags question: http://stackoverflow.com/q/28613341
tags question: http://stackoverflow.com/q/28633869

http://stackoverflow.com/comment/45596948
type: Comment
has text: The above question needs a bit of tender love and care to meet SO standards with respect to formatting (a very little bit of which I have done - if it's accepted) and making the question more readily apparent to those looking to be helpful Expand you question a little bit, make it clearer, and - if you are able - provide some attempts at a solution or some links to documentation that you are reading. Here's the link on questions: http://stackoverflow.com/help/how-to-ask
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28649593

http://stackoverflow.com/q/28733647
accepted answer: http://stackoverflow.com/a/28733868
score: 0
tagged with: css
has body: Lets say I have a div with images, however not all have space to be displayed at same the time, so I used CSS property white-space: nowrap and overflow: hidden, so elements don't break into new lines or expand over div. Now I need JavaScript technique that will allow me to move them left or right so user can reach these not visible images aswell. Think of it as a slider. It should have two navigation buttons, left and right, by pressing each, images move in specific direction. Movement should be animated (not moving instantly, instead, they should move over specific period, frame by frame) Here is jsfiddle demo: http://jsfiddle.net/rfLffev7/ (red and green div represent a button that should trigger functions) HTML: &lt;div id="container"&gt; &lt;div id="left"&gt;&lt;/div&gt; &lt;div id="track"&gt; &lt;img src=""&gt; &lt;img src=""&gt; &lt;img src=""&gt; &lt;img src=""&gt; &lt;img src=""&gt; &lt;img src=""&gt; &lt;img src=""&gt; &lt;img src=""&gt; &lt;/div&gt; &lt;div id="right"&gt;&lt;/div&gt; &lt;/div&gt; CSS: #container { width: 600px; height: 200px; margin: 10px auto; } #left { width: 50px; height: 200px; float: left; background: #500; } #track { width: 500px; height: 200px; float: left; background: #333; white-space: nowrap; overflow: hidden; } #track img { width: 100px; height: 100px; border: 1px solid #fff; margin-top: 50px; margin-left: 10px; } #right { width: 50px; height: 200px; float: left; background: #050; }
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28733868
has title: Javascript - move elements by pressing another element
has comment: http://stackoverflow.com/comment/45753006
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/28733944
has answer: http://stackoverflow.com/a/28733944
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45537974
has text: For the `exception`, you need to refer to your `logcat`. For how to get it, you can refer to [here](http://stackoverflow.com/a/23353174/4186942).
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28596366
type: Comment

http://stackoverflow.com/a/28646357
has body: true is a symbol, not a string. You have 'true' instead of true. Try this. var midday = 'asdf'; if (isNaN(midday) || midday &gt;= 50) { alert('isNan == true or &gt;= 50'); } else { alert('none is true'); }
answers question: http://stackoverflow.com/q/28646265
accepted answer of: http://stackoverflow.com/q/28646265
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/45557609
comment on: http://stackoverflow.com/a/28628652
type: AnswerComment
type: Comment
score: 0
has text: is it still within the if?

http://stackoverflow.com/comment/45749284
type: Comment
comment on: http://stackoverflow.com/a/28731282
score: 0
type: AnswerComment
has text: Meh, it's proven that it's impossible to do for *every* arbitrary program. However, in reality it can be done for *most* programs, especially simple one like this (with its trivial input format).

http://stackoverflow.com/comment/45573824
has text: @konkked Hmm.. yeah I think I'll have to change my code around a bit. I did some research and it's called "Layout Thrashing" and is exactly what has been happening: https://blog.idrsolutions.com/2014/08/beware-javascript-layout-thrashing/
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28614621
score: 0

http://stackoverflow.com/a/29825502
has comment: http://stackoverflow.com/comment/60046712
type: Answer
has comment: http://stackoverflow.com/comment/47906522
upvote count: 3
has comment: http://stackoverflow.com/comment/48139475
has body: I had the same issue and i come up with this. You can initially load all sliders in array like: var sliders = []; $('.sliders').each(function(i,item){ var slider; slider.$(this).bxSlider(); sliders[i] = slider; }); Then, you can loop through and reload each $(sliders).each(function(){ this.reloadSlider(); });
score: 3
answers question: http://stackoverflow.com/q/28725775
downvote count: 0

http://stackoverflow.com/q/28719340
tagged with: http://stackoverflow.com/tag/html
tagged with: xpath
has title: XPath in Firebug console with a space in content
type: UnansweredQuestion
type: Question
linked to: http://stackoverflow.com/q/22436789
has answer: http://stackoverflow.com/a/33904810
answer count: 1
tagged with: javascript
has body: I am trying to use an XPath in the Firebug console to get a &lt;span&gt; element's text content. The actual &lt;span&gt; tag content is 'first name' with a space within as shown below: &lt;span class="vl-cell e-listview-container-mail-Col5" iscell="1"&gt;first name&lt;/span&gt; When I enter the XPath below into Firebug's command line $x("//div[@id='tble-listview-container-mail']/div[2]/span[4]")[0].innerHTML I get the following output: "first&amp;nbsp;name" // getting a &amp;nbsp; for the space within the string 'first name'. When I want to get the element containing this text like $x("//div[@id='tble-listview-container-mail']/div[2]/span[text()='first name']") I get this as output: [] // output is returned as empty Can someone tell how I can get the element if the inner text has a space within it?
score: 0

http://stackoverflow.com/a/28603106
upvote count: 1
has body: I commented the code a little so hopefully it makes more sense. The most important concepts to understand is variable hoisting and function scope. There is only function scope in JavaScript. x = 1; var a = 5; var b = 10; var c = function (a, b, c) { /* this `x` refers to the new `x` variable initialized below * near the closing function `c` brace. * It is undefined because of hoisting, and gets assigned * a value where it was initialized below. */ console.log(x); // undefined /* this `a` refers to this `a` parameter, * because it is within this function `c` scope. */ console.log(a); var f = function (a, b, c) { /* this `b` refers to this `b` parameter, * because it is within this function `f` scope. * * this `a` refers to this `a` parameter, * because it is within this function `f` scope. */ b = a; console.log(b); /* this `b` still refers to `b` in this function `f` scope. * * this `c` refers to this `c` parameter, * because it is within this function scope. */ b = c; /* this is a new `x` variable because it is * with this function `f` scope and there is no parameter `x`. */ var x = 5; }; /* these `a`, `b`, and `c` variables refer to * this function `c` parameters. */ f(a, b, c); // f(5, 10, 10) console.log(b); // 9 /* this is a new `x` variable because it is * with this function `c` scope and there is no parameter `x`. */ var x = 10; }; c(8, 9, 10); /* `a`, `b`, `c`, and `x` have not been touched, * because the other `a`,`b`,`c` variables were parameter names, * and other `x` variables were initialized within a different scope. */ console.log(b); // 10 console.log(x); // 1 JSBin Demo
score: 1
answers question: http://stackoverflow.com/q/28600279
downvote count: 0
has comment: http://stackoverflow.com/comment/45531635
type: Answer
has comment: http://stackoverflow.com/comment/45512236

http://stackoverflow.com/comment/45631393
score: 0
comment on: http://stackoverflow.com/q/28668300
type: Comment
type: QuestionComment
has text: Same thing, for that we have to first understand it by own ;-)

http://stackoverflow.com/comment/45545609
type: AnswerComment
has text: also i changed 'src' to 'image' in d service file and it still returns src not changing any value in the service why?
type: Comment
comment on: http://stackoverflow.com/a/28600152
score: 0

http://stackoverflow.com/comment/45574213
comment on: http://stackoverflow.com/q/28637235
score: 0
type: Comment
type: QuestionComment
has text: From my experience you can not rely on anything else as document.ready on iOS other than to inject the Markup via JS and monitor image loading by yourself.

breeze
tags question: http://stackoverflow.com/q/28629142
type: Tag
tags question: http://stackoverflow.com/q/28731733
tag name: breeze

http://stackoverflow.com/q/28723248
has comment: http://stackoverflow.com/comment/45733358
has comment: http://stackoverflow.com/comment/45737435
has comment: http://stackoverflow.com/comment/45736866
has comment: http://stackoverflow.com/comment/45734503
has body: I have a form for user to register new account. I tried to implement jquery + ajax to check email availability. I used e.preventDefault(); to prevent form submission if there is any error with user's input. Even ajax response is return false (means that email is already existed in database). But It still allows form submission. It should shows up this error: "This email address is already existed. Please choose another one". Please anyone tell me what is wrong with my jquery code? Thank you very much...! Here is my form: Full Name Email Address Password Register Here is my jquery + Ajax code: $(document).ready(function(){ $('#regname').focus(); $('#regemail').blur(emailCheck); $('#signupForm').submit(function(e) { var regname = $('#regname'); var regemail = $('#regemail'); var regpass = $('#regpass'); var register_result = $('#register_result'); register_result.html('Loading..'); if(regname.val() == ''){ regname.focus(); register_result.html(' * Full name can't be blank'); e.preventDefault(); } else if ($.trim(regemail.val()).length == 0) { regemail.focus(); register_result.html('* Email address can't be blank'); e.preventDefault(); } else if (emailCheck()==false) { regemail.focus(); register_result.html(' This email address is already existed. Please choose another one '); e.preventDefault(); } else if(regpass.val() == ''){ regpass.focus(); register_result.html('* Password can't be blank'); e.preventDefault(); } }); }); function emailCheck() { var regemail = $('#regemail'); var emailcheck = $('#emailcheck'); emailcheck.html(''); var UrlToPass = {regemail:regemail.val()} ; $.ajax({ type : 'POST', cache: false, data : UrlToPass, url : 'emailcheck.php', success: function(responseText){ if(responseText == 0){ return true; } else{ emailcheck.html(' This email is existed.'); return false; } } }); }
has comment: http://stackoverflow.com/comment/45736737
tagged with: jquery
linked to: http://stackoverflow.com/q/14220321
tagged with: ajax
has title: Jquery ajax email availability checker does not work
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/14220321
has comment: http://stackoverflow.com/comment/45735502
answer count: 0
score: 0
type: Question
tagged with: javascript

http://stackoverflow.com/a/28691812
has body: Turns out I was not storing and retrieving the cookie properly. I changed the code as below and its now working: Code for setting the cookie: &lt;input class="button-field" type="submit" i18n:attr="value" value="xmlui.general.go" style="visibility:hidden"&gt; &lt;xsl:attribute name="onclick"&gt; &lt;xsl:text&gt; &lt;!--Poonam (code added to create cookie)--&gt; var a = document.getElementById(&amp;quot;text-search&amp;quot;); //alert(a.value); document.cookie = "search=; expires=Thu, 01 Jan 1970 00:00:00 UTC"; //delete previous cookie document.cookie = &amp;quot;search&amp;quot;+&amp;quot;=&amp;quot;+a.value+&amp;quot;;&amp;quot;; //create new cookie //alert("Hello"+document.cookie); &lt;!--Poonam--&gt; var form = document.getElementById(&amp;quot;ds-search-box&amp;quot;); form.action= &lt;/xsl:text&gt; &lt;xsl:text&gt;&amp;quot;&lt;/xsl:text&gt; &lt;xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='contextPath']"/&gt; &lt;xsl:text&gt;/handle/&amp;quot; + radio.value + &amp;quot;&lt;/xsl:text&gt; &lt;xsl:value-of select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='search'][@qualifier='simpleURL']"/&gt; &lt;xsl:text&gt;&amp;quot; ; &lt;/xsl:text&gt; &lt;xsl:text&gt; &lt;/xsl:text&gt; &lt;/xsl:attribute&gt; &lt;/input&gt; Whenever a user performs search, the search string is stored in a cookie named search. The code first deletes the previous cookie before creating a new one. &lt;script type="text/javascript"&gt; window.onload = function (){ var cookie_string = getCookie("search"); //alert(cookie_string); document.getElementById(&amp;quot;text-search&amp;quot;).value = cookie_string; } function getCookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for(var i=0; i!=ca.length; i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1); if (c.indexOf(name) == 0) return c.substring(name.length,c.length); } return ""; } &lt;/script&gt; This reads the cookie and sets it in the search box.
type: Answer
answers question: http://stackoverflow.com/q/28668268
score: 0

http://stackoverflow.com/q/28672152
has answer: http://stackoverflow.com/a/28672306
type: Question
possible better answer: http://stackoverflow.com/a/58255146
upvote count: 15
has answer: http://stackoverflow.com/a/58255146
downvote count: 0
tagged with: javascript
tagged with: eventhandler
has answer: http://stackoverflow.com/a/28766463
has answer: http://stackoverflow.com/a/28672253
score: 15
favorite count: 0
has answer: http://stackoverflow.com/a/56623898
has comment: http://stackoverflow.com/comment/45638779
has comment: http://stackoverflow.com/comment/45637969
has title: Pass an Event to an iframe from the parent window? ( Javascript )
answer count: 5
tagged with: iframe
accepted answer: http://stackoverflow.com/a/28766463
has comment: http://stackoverflow.com/comment/45651433
has comment: http://stackoverflow.com/comment/45715076
type: AnsweredQuestion
has body: Before starting this question, i have to say I really searched everywhere to find the answer but nothing found. Also tried manythings like dispatchevent, postmessage, ... but nothing worked. Here is the case. I have a main windows, where I have 4 simple buttons, like downarrow, uparrow, left and right arrow. I want to create a simulation of events pass to the iframe which is in this main window. In that iframe is a page loaded where is an Eventhandler and react on the arrows. I tried following but did not worked var event = document.createEvent('KeyboardEvent'); // create a key event define the event event.initKeyboardEvent("keypress", // typeArg, true, // canBubbleArg, true, // cancelableArg, null, // viewArg, Specifies UIEvent.view. This value may be null. false, // ctrlKeyArg, false, // altKeyArg, false, // shiftKeyArg, false, // metaKeyArg, 39, // keyCodeArg (39 is the right arrow key ), 0); // charCodeArg); document.getElementById('vid').dispatchEvent(event); Is there anybody who has an idea how I can solve this issue?

http://stackoverflow.com/a/28631594
score: 0
answers question: http://stackoverflow.com/q/28631283
type: Answer
has body: The reason why it does not work in your plunkr is because you create a module named "radioExample" but you don't use it when you write the HTML code. Basically, replace this - &lt;html ng-app&gt; at the beginning of the code with this &lt;html ng-app="radioExample"&gt; This way, when you declare the controller, AngularJS knows which module it needs to look into to get the controller. Note - if you had not associated your controller with a module, then your code would work.

http://stackoverflow.com/a/28706900
has body: You can return a promise to signal that the test is asynchronous: function something() { return Q.reject(Error('fail')); } it('should reject', function() { return something().then(function() { throw new Error('expected rejection'); }, function() { return 'passed :]'; }); });
type: Answer
score: 3
upvote count: 3
downvote count: 0
answers question: http://stackoverflow.com/q/28704791

http://stackoverflow.com/a/28732924
score: 0
type: Answer
has body: Did you want it to look like this? (screw it i was planning on posting a pic but i still can't due to my rep im also new, but you can just try the code yourself) Here's the code: { border: red dashed 1px; } h3 { position: relative; left: 10px; width: 400px; } h4 { position: relative; left: 10px; width: 400px; } h5 { position: relative; left: 10px; width: 500px; } li { width: 800px; } #phoneNumber { position: relative; left: 950px; top: -110px; font-family: monospace; text-decoration:blink; color: black; width: 200px; } #emailaddress { position: relative; left: 630px; top: -150px; font-family: monospace; text-decoration:blink; color: black; } #phoneIcon { position: relative; height: 50px; width: 50px; left: 617px; top: -60px; } #emailIcon { position: relative; height: 50px; width: 50px; left: 670px; top: -130px; } body{ background-color: #C4D2E0; width: 100%; margin: 0px; padding: 0px; } div { margin: 5px; border-color: blue; border-width: thin; border-style: solid; width: 99%; } span { font-style: italic; font-weight: 300; position: relative; left: 10px; } #header { border-width: thin; border-color: blue; border-style: solid; background-color:#6B8FB2; position: relative; height: 250px; text-align: center; font-family: monospace; font-style: oblique; text-align: justify; width: 1200px; } #aboutmeDiv { position: relative; max-width: 1100px; left: 210px; top: -250px; margin-right: 800px; border-style: dashed green 1px; border-width: 0px; width: 500px; } .aboutme{ position: relative; left: 10px; margin-right: 0px; width: 450px; } #header h1 { position: relative; left: 20px; top: 4px; margin-right: 100px; border:0px; } #profilePic{ position: relative; left: 15px; top: -10px; border-color: blue; border-width: thin; border-style: solid; } #skills{ } #education{ } #workexperience{ } #projects{ } #volunteering { } #footer { height: 50px; background-color:#6B8FB2; border-width: thin; border-color: blue; border-style: solid; width:99%; text-align: center; } #verticalLine { pos…
answers question: http://stackoverflow.com/q/28731354
has comment: http://stackoverflow.com/comment/45845992
has comment: http://stackoverflow.com/comment/45752097
has comment: http://stackoverflow.com/comment/45752925

http://stackoverflow.com/a/28707759
has comment: http://stackoverflow.com/comment/45706106
upvote count: 1
has comment: http://stackoverflow.com/comment/45724259
score: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28707265
has comment: http://stackoverflow.com/comment/45727353
type: Answer
has body: You're getting things wrong. You can't load your express code into your PHP or vice versa (in fact you can, but it would be too much work). To make your PHP code talk to your express/node code, you should create an interface between them. I think a RESTful interface would be the easiest one to build. The code you've provided is already a RESTful interface. Then, in your PHP code (alongside with HTML and client-side JavaScript), you can make an XHR or Ajax request to the express/node route (but you'll need to send a json, which is not so different from what you got: res.json({hello: 'Hello World'}). More about Express json response here). Or, you do use a JSON request from PHP, which you can find more information here. EDIT: Ok, here is some PHP code: &lt;?php $url = "localhost:3000/"; // this should the route you've defined on // express. the `app.get('/')` part. $json = file_get_contents($url); var_dump(json_decode($json)); ?&gt; And your express code should be like: app.get('/', function(req, res){ res.json({hello: 'Hello World'}) }) Then, your PHP's var_dump should output: {hello: 'Hello World'}
accepted answer of: http://stackoverflow.com/q/28707265

http://stackoverflow.com/q/28595297
downvote count: 0
tagged with: ios
tagged with: javascript
favorite count: 0
score: 3
tagged with: xmlhttprequest
tagged with: angularjs
answer count: 0
upvote count: 3
type: UnansweredQuestion
has body: Here is my problem. I'm developing an webapp, written in Angular and NOT jQuery, for a client that need to have its database refreshed every week with new sets of data. So they chose to use SQLite3 because they can drop the new DB into a folder and the sales rep can download this DB file every Monday. But there are a series of data that gets cached on localStorage and those data need to be refreshed as soon as the iPad checks the DB file and returns true if is a new file. So, I'm using XMLHttpRequest() to check the head for the "Last-Modified" date and it works perfect on Chrome and Safari, but once I build the app and move to iPad, the Last-Modified date return null. I searched everywhere in the web to try find what could be wrong, but I just could not find any satisfactory answer: The code I'm using is var dbPath = "db/myDb.sqlite"; var getMTime = function(url, callback) { var xhr = new XMLHttpRequest(); xhr.open('HEAD', dbPath, true); xhr.onreadystatechange = function() { if (xhr.readyState === 4 &amp;&amp; xhr.status === 200) { var mtime = new Date(xhr.getResponseHeader('Last-Modified')); if (mtime.toString() === 'Invalid Date') { callback(); // dont want to return a bad date } else { callback(mtime); } } } xhr.send(); }; Thanks in advance for the help UPDATE Looks like the IOS WebView wipes the HEAD object response... So, thats why by running xhr.getResponseHeader I get empty object, but I would love to know if there is an alternative for that and why this object is being wiped...
has title: Get Last-Modified date of a file using JS XMLHttpRequest() on IOS
type: Question

video
tags question: http://stackoverflow.com/q/28606147
type: Tag
tags question: http://stackoverflow.com/q/28605591
tags question: http://stackoverflow.com/q/28728083
tags question: http://stackoverflow.com/q/28608058
tags question: http://stackoverflow.com/q/28695941
tags question: http://stackoverflow.com/q/28722307
tags question: http://stackoverflow.com/q/28680381
tags question: http://stackoverflow.com/q/28634557
tags question: http://stackoverflow.com/q/28638061
tags question: http://stackoverflow.com/q/28605239
tags question: http://stackoverflow.com/q/28667689
tags question: http://stackoverflow.com/q/28625662
tags question: http://stackoverflow.com/q/28678689
tags question: http://stackoverflow.com/q/28693428
tags question: http://stackoverflow.com/q/28676623
tags question: http://stackoverflow.com/q/28599067
tags question: http://stackoverflow.com/q/28684381
tags question: http://stackoverflow.com/q/28601762
tags question: http://stackoverflow.com/q/28744066
tags question: http://stackoverflow.com/q/28682231
tag name: video

http://stackoverflow.com/q/28652595
has comment: http://stackoverflow.com/comment/45602657
has comment: http://stackoverflow.com/comment/58461457
has comment: http://stackoverflow.com/comment/45602316
has comment: http://stackoverflow.com/comment/45602413
type: Question
has comment: http://stackoverflow.com/comment/45602513
has comment: http://stackoverflow.com/comment/45602395
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45602460
has body: So, here's my code(not all of it, just what you need to understand): HTML: ACASA CULTURA Cultura populară Cultura cultă Cultura de masă CULTURA ROMÂNIEI Elemente dacice Elemente romane Alte influențe INTERFERENȚE CULTURALE Români și romi Români și maghiari Români și evrei CSS: nav { text-align: center; margin-top: 5%; margin-bottom: 5%; font-family: Krona One; border-top: 1px solid #fff; text-decoration: none; color: #FFFFFF; font-size: large; } nav ul { list-style-type: none; position:relative; } nav ul li { display: inline-block; padding: 25px; } nav ul li a { color: #FFFFFF; text-decoration: none; } nav ul li a:hover { text-shadow: 0px 0px 20px #FFFFFF; color: #FFFFFF; text-decoration: none; } nav ul li a:hover + ul{ display: block; visibility:visible; } nav ul ul::before { background: url(images/menu_corner.gif) no-repeat 0% 0%; width: 9px; height: 5px; display: block; margin: 0 -5px 0 0; position: absolute; top: -5px; right: 50%; content: ''; } nav ul ul { text-align: center; font-weight: normal; display: none; visibility: hidden; position: absolute; background-color: #2E2E2E; font-family: 'Open Sans', sans-serif; padding-top: 15px; padding-bottom: 15px; line-height: 20px; padding-left: 0px; padding-right: 0px; margin-top: 30px; font-size: 16px; } nav ul ul li { display: block; padding-top: 10px; padding-right: 10px; padding-left: 10px; padding-bottom: 10px; margin-top: 5px; margin-bottom: 5px; } .border { border-top: 1px solid #434343; } nav ul ul li a:hover { color: #767676; text-decoration: none; text-shadow: 0px 0px 0px; } body { font-family: Segoe, "Segoe UI", "DejaVu Sans", "Trebuchet MS", Verdana, sans-serif; font-style: normal; font-weight: 400; background-image: url(http://i.imgur.com/qjincKZ.jpg); color: #FFFFFF; margin: 0 0 0 0; background-size: cover; } I don't know why, but the jQuery works only in dreamweaver... In order to work in dreamweaver, I have to download jQuery and add it to the contain folder, but for some pourposes, I pasted a CDN. If I…
has title: jQuery working in dreamweaver but not in browser
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
tagged with: dreamweaver
has comment: http://stackoverflow.com/comment/45602523
has comment: http://stackoverflow.com/comment/45602329
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28656008
tagged with: css
has comment: http://stackoverflow.com/comment/45602499
has comment: http://stackoverflow.com/comment/45602535
has answer: http://stackoverflow.com/a/28652702
has comment: http://stackoverflow.com/comment/45602285

http://stackoverflow.com/comment/45601803
comment on: http://stackoverflow.com/a/28652183
score: 0
type: AnswerComment
type: Comment
has text: That is strange, it works for me. Are you loading the html as a string into cheerio?

http://stackoverflow.com/comment/45651247
has text: try: `$scope.lrrDetail = response.data[0];`
score: 0
comment on: http://stackoverflow.com/q/28678945
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45760614
has text: I'm pretty sure emit function is called only once. When someone clicks on a button do this: http://pastebin.com/DQWZejRN I update the database and when it's done I call emit function.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28737671
score: 0

http://stackoverflow.com/comment/45781966
type: Comment
type: QuestionComment
has text: We could just spit out some code but where is the fun in that? Are you familiar with $_GET and $_POST? How about arrays? Jrad51 is right in that you will get better answers if you narrow down your question into more specific pieces. Get as far as you can on your own, this is very doable and a great beginner exercise.
score: 0
comment on: http://stackoverflow.com/q/28749343

http://stackoverflow.com/comment/45620004
has text: i found it , but did not work! --> http://community.sitepoint.com/t/jquery-get-index-value-of-selected-li/5773
type: Comment
comment on: http://stackoverflow.com/a/28662191
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45853367
comment on: http://stackoverflow.com/a/28750467
score: 0
type: AnswerComment
has text: Works perfectly. I've modified it to make the players part of an array which will help me further down the line but seeing this and trying to understand it has helped loads so thanks very much for your time and effort!
type: Comment

http://stackoverflow.com/a/28646272
type: AcceptedAnswer
upvote count: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/28646237
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28646237
has body: I'm pretty sure you can just use: var xpos = []; var speed = []; for (i=0;i&lt;10;i++) { vx = Math.floor((Math.random() * 5) + 1); xpos[i] = vx; vy = Math.floor((Math.random() * 100) + 10); speed[i] = vy; } document.write(xpos+"&lt;br&gt;"); document.write(speed); In JavaScript, arrays don't behave like indexed arrays in many other languages. You don't have to specify a size and you can assign values to arbitrary indices using angle brackets, like so: xpos[i] = vx; ... speed[i] = vy; Your question isn't entirely clear, but, if I'm understanding it right, you could simply do: xpos[i] = xpos[i] &lt;op&gt; speed[i]; where &lt;op&gt; is + or - Of course, if you're doing all this in the same loop it doesn't make a lot of sense to save to xpos and then immediately overwrite it with the difference. So you could just say: speed[i] = vy; xpos[i] = vx &lt;op&gt; speed[i];
has comment: http://stackoverflow.com/comment/45590802

http://stackoverflow.com/comment/45646030
score: 0
type: QuestionComment
type: Comment
has text: Your screen shot looks like some kind of UI. Most UIs have Ctrl-A for "select all", Ctrl-C for "copy", and Ctrl-V for "paste". I was making a biiiig guess that that UI would let you copy all the table names that way.
comment on: http://stackoverflow.com/q/28676373

http://stackoverflow.com/q/28709144
type: Question
type: AnsweredQuestion
score: -1
has body: Suppose I have a long mathematical expression like so : &lt;div&gt; "SUM( FIRST_ARG, SECOND_ARG, AVG( THIRD_ARG ) / MEAN( FOURTH_ARG) )" &lt;/div&gt; And also suppose that the containing div width is small such that it overflows after the last letter in ", AVG( THI". Is it first possible to break the expression such instead of overflowing and being hidden or being broken up on the overflown letter, that it fits much as words as possible before wrapping. So it turns into &lt;div&gt; "SUM( FIRST_ARG, SECOND_ARG," "AVG( THIRD_ARG ) / MEAN( FOURTH_ARG) )" &lt;/div&gt; I want to note that the whole mathematical expression is a long string.
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28709213
accepted answer: http://stackoverflow.com/a/28709213
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Is there a way to wrap word when overflowed? Meaning fit most words as possible before it wraps to new line?
downvote count: 1

http://stackoverflow.com/comment/45767471
comment on: http://stackoverflow.com/a/28742161
score: 0
type: Comment
has text: But in this case I should read and write parameters from and into pagename string by myself, and I'm looking for better way.
type: AnswerComment

http://stackoverflow.com/comment/45748660
type: Comment
comment on: http://stackoverflow.com/q/28709809
has text: does your code work if you use the same version of angular which is used in the tutorial the code came from?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45735284
type: AnswerComment
comment on: http://stackoverflow.com/a/28722172
score: 0
type: Comment
has text: Glad to be of help but what I did is nothing creative, it's just the casual way of doing it :)

http://stackoverflow.com/comment/45677905
score: 0
type: Comment
type: QuestionComment
has text: http://imgur.com/woQfkLY here is a picture to help show what it looks like. the top of the picture is the bottom portion of the video
comment on: http://stackoverflow.com/q/28693428

http://stackoverflow.com/comment/45495723
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28594502
has text: What does "synchronous" mean (as an opposite to "asynchronous")? Is it blocking? If so / if not, how is the result obtained? There is the answer..

http://stackoverflow.com/comment/45526664
comment on: http://stackoverflow.com/q/28595161
has text: Thanks you!! I will try something with that and let you know! :)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28682304
tagged with: jquery
has comment: http://stackoverflow.com/comment/45657617
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28682436
has comment: http://stackoverflow.com/comment/45657548
accepted answer: http://stackoverflow.com/a/28682436
type: Question
has body: I'm trying to find a way to get all the class names from an object when I hover on it. Then, after getting the class names, append new css to all elements that contain those class names. http://jsfiddle.net/fr5q8c4v/ $( '.cell' ).hover( function() { $(this).classNames.css( //something like this? "border", "solid 1px black" ); }, function() { $(this).classNames.css( "border", "solid 1px transparent" ) }); In this example, when I hover over a cell with a class name of "one" I want to apply css to all cells with a class name of "one".
tagged with: javascript
has title: Selecting multiple class names from 'this' object?
score: 0
answer count: 1

http://stackoverflow.com/comment/45716597
type: QuestionComment
has text: can you add your `callhttp` function?
comment on: http://stackoverflow.com/q/28714298
score: 0
type: Comment

http://stackoverflow.com/comment/45721772
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28717205
has text: i would suggest having a look at delegating events on lower level items up to persistent parent items. http://api.jquery.com/delegate/
score: 0

http://stackoverflow.com/q/28749471
type: AnsweredQuestion
score: 10
possible better answer: http://stackoverflow.com/a/28779761
upvote count: 10
has title: Mongoose Schema for geoJson coordinates
type: Question
tagged with: mongodb
has comment: http://stackoverflow.com/comment/107620983
accepted answer: http://stackoverflow.com/a/28749764
downvote count: 0
tagged with: mongoose
tagged with: javascript
tagged with: express
favorite count: 0
answer count: 3
has body: I tried to create a schema for geojson but have had some problems with syntax for coordinates. Here's my current code: var DataSchema = new Schema({ properties: { title: { type: String, required: true }, description: { type: String, required: true }, date: { type:Date, default:Date.now } }, geometry: { coordinates: [] } }); I tried using [] (empty array), it creates '' and [Number,Number] but it doesn't work. My question is: how do I have to construct my schema so as result I will get coordinates: [ 3.43434343, 5.543434343 ] without quotation marks, is this possible? Express Route app.post('/mountain_rescue', function (req, res){ new rescueData({properties:{title: req.body.title, description: req.body.description},geometry:{ coordinates:req.body.coordinates}}).save(function (e, result) { console.log(result); }); res.redirect('/mountain_rescue'); }); View Title: Description: Coordinates: Add
has answer: http://stackoverflow.com/a/28749725
has answer: http://stackoverflow.com/a/28779761
has answer: http://stackoverflow.com/a/28749764
tagged with: node.js

http://stackoverflow.com/comment/45710006
type: AnswerComment
score: 0
type: Comment
has text: Why not? Vaibhav's solution allows the click handlers to be bound.
comment on: http://stackoverflow.com/a/28710555

http://stackoverflow.com/comment/45589577
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28628144
has text: You may also try $("#loadingAnimate").hide() for autocomplete.
type: AnswerComment

http://stackoverflow.com/q/28678608
linked to: http://stackoverflow.com/q/22807757
has answer: http://stackoverflow.com/a/28686879
score: 0
answer count: 3
has title: Unable to change drop down list's option height in CSS
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28686817
has answer: http://stackoverflow.com/a/28687768
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/45650606
has body: Volvo Saab Mercedes Audi California Colorado Connecticut \ #organiser option{ height:70px; padding:25px 0; } #organiser{ height:50px; } I am trying to change the height of options in select but it remains the same.I even tried padding but it didnt work.I need help regarding this.Otherwise suggest me some website for best drop down list designs?
tagged with: html.dropdownlistfor
type: Question
has comment: http://stackoverflow.com/comment/45650833
tagged with: javascript

http://stackoverflow.com/a/28779211
score: 0
type: Answer
has body: You should use createjs.DomElement for this. Move your object out of the canvas element and give it an id. Then you could use the domElement to wrap it and add it to your stage like this (assuming you're using jQuery): var domElement = new createjs.DOMElement($("#myswf")); stage.addChild(domElement);
answers question: http://stackoverflow.com/q/28744690

http://stackoverflow.com/comment/45631007
has text: @Roamer-1888 superb solution
comment on: http://stackoverflow.com/a/28668001
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45703050
comment on: http://stackoverflow.com/a/28703768
has text: Interesting that we're inconsistent with the formatting, I'll look in to that. However, both appear to be valid JSON. Does the parse failure give you any indication as to where it's tripping up?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28601112
type: AnsweredQuestion
tagged with: jqgrid
has body: I am using grid with below properties cellEdit: true, datatype: 'json', viewrecords: true, cellsubmit: 'clientArray', loadonce: true colmodel has one column as : { name: 'Input', width: 120, editable: true, editoptions: { dataEvents: [ { type: 'change', fn: function (e) { alert('hi'); } }, ] } } Now when i enter a value in Input and clicks on other cell, the change event fires but when i enter a value and press tab it doesn't work.
type: Question
has comment: http://stackoverflow.com/comment/45507939
has title: jqgrid : onchange event not working on tab for local grid
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28601226
accepted answer: http://stackoverflow.com/a/28601226

http://stackoverflow.com/comment/45537417
comment on: http://stackoverflow.com/q/28617121
type: Comment
type: QuestionComment
has text: And what is `scrollbar`?
score: 0

http://stackoverflow.com/comment/45594299
type: AnswerComment
has text: sadly i cant modify the li element as its from site which i don't have access to. but thanks for the answer!
comment on: http://stackoverflow.com/a/28648273
score: 0
type: Comment

http://stackoverflow.com/q/28625578
has comment: http://stackoverflow.com/comment/45553779
has comment: http://stackoverflow.com/comment/45553044
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28626177
has answer: http://stackoverflow.com/a/28626177
has comment: http://stackoverflow.com/comment/45552110
type: Question
answer count: 2
tagged with: asp.net-mvc
tagged with: javascript
has title: Calling a controller method via javascript
has answer: http://stackoverflow.com/a/28625760
accepted answer: http://stackoverflow.com/a/28625760
score: 0
has comment: http://stackoverflow.com/comment/45552511
has comment: http://stackoverflow.com/comment/45552131
has body: I have an ASP.NET application where I am invoking a controller methode from JavaScript. My JavaScript code looks like this: function OnNodeClick(s, e) { $.ajax({ type: "POST", url: '@Url.Action("DeviceManifests", "Home")', data: { selectedRepo: e.node.name }, success: function (data) { if (data != null) { $('#GridView').html(data); } }, error: function (e) { alert(e.responseText); } }); } This calls the Home controller's DeviceManifests() method. This is what the method looks like: public ActionResult DeviceManifests(Guid selectedRepo) { var repoItem = mock.GetRepoItem(selectedRepo); return View("Delete", repoItem.childs); } The method gets invoked but the problem is the Delete-View doesn't get rendered. There's no error, just nothing happens. How can I update my code to get my desired behaviour?
tagged with: ajax
has comment: http://stackoverflow.com/comment/45554110

http://stackoverflow.com/q/28737140
tagged with: javascript
score: -1
answer count: 1
tagged with: jquery
favorite count: 0
has title: how can i create dyanmic chat.js using php and mysql
has answer: http://stackoverflow.com/a/28737220
accepted answer: http://stackoverflow.com/a/28737220
tagged with: php
type: AnsweredQuestion
downvote count: 2
tagged with: mysql
upvote count: 1
type: Question
has body: the thing is, I don't understand how I can pass the value from the url to the php itself dynamically. I think I need to retrieve mysql value from my database and assign it to some variable, is that correct? But how can I connect it to the URL? and pass to the javasript for chart.js .
has comment: http://stackoverflow.com/comment/45758431

http://stackoverflow.com/comment/45608311
comment on: http://stackoverflow.com/q/28655685
type: Comment
type: QuestionComment
has text: It says in the box: "**Waiting** (TTFB)". The TTFB means *Time To First byte*, i.e. the time it takes to get the first byte back from the server.
score: 0

http://stackoverflow.com/a/28643749
type: Answer
answers question: http://stackoverflow.com/q/28643703
upvote count: 1
score: 1
has body: use $(this).attr('id') instead of $(this).id
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28643703

http://stackoverflow.com/a/28687484
type: Answer
score: 5
upvote count: 5
downvote count: 0
has body: What am I doing wrong? The regular expression you are creating is ^/courses(/[a-z0-9-]+){2,3}(/|.jsp)?(?.*)?$ ^^^^^ Note the (? part, which is illegal (and hence the error). \ is the escape character in string literals and regular expression. The parser doesn't know that there is a regular expression in the string literal, the \ is evaluated as part of the string literal, so \? becomes ?. Simple test: &gt; "\?" "?" You have the same problem with \.jsp, which becomes .jsp. The . is not illegal at that position, but it will match every character instead of a .. If you want to pass it along to the regular expression, you have to escape it: "^/courses(/[a-z0-9\\-]+){2,3}(/|\\.jsp)?(\\?.*)?$" ^ ^ Or you simple you use an expression literal (which requires you do escape the / though): .replace(/^\/courses(\/[a-z0-9-]+){2,3}(\/|\.jsp)?(\?.*)?$/, "abc");
answers question: http://stackoverflow.com/q/28687449

http://stackoverflow.com/comment/45735251
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28723128
has text: Yeah i added the code in the question where i access the json and add to the DOM

http://stackoverflow.com/q/28658763
has answer: http://stackoverflow.com/a/28658954
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45613465
tagged with: http://stackoverflow.com/tag/html
score: 2
upvote count: 2
has answer: http://stackoverflow.com/a/28658926
has title: How to toggle button icon and description javascript
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28658889
has body: here is my problem. I need on click to change button icon and on another click to go to original state, like +,- and span description like home/back i dont know what to do. Pleas help. Here is html... &lt;div class="navbar-left left"&gt; &lt;button class="toggle btn mr2 white " &gt; &lt;i class="fa fa-home fa-2x "&gt;&lt;/i&gt; &lt;span class="mobile-hide "&gt;Home&lt;/a&gt; &lt;/button&gt; &lt;/div&gt; and bad js if ($('.toggle').hasClass('fa fa-home fa-2x')) { $('.toggle').toggleClass('fa fa-home ').html('&lt;span class="mobile-hide "&gt;Home&lt;/a&gt;'); } else($('.toggle').hasClass('fa fa-home ')) { $('.toggle').toggleClass('fa fa-home fa-2x ').html('&lt;span class="mobile-hide "&gt;Back&lt;/a&gt;'); } toggleMenu(); });
answer count: 3
downvote count: 0
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/45678168
type: QuestionComment
comment on: http://stackoverflow.com/q/28692470
score: 0
has text: @Vaibhav: I don't understand what you mean. The values *are* arrays. If I took out the `items` resource out from under `shop`, it worked; the issue comes only when nesting. Maybe `:shop_id` was used to automagically look up one of the `items`? I don't know. But I just tried to write a route that would access `items`, and failed; the property is never invoked.
type: Comment

http://stackoverflow.com/a/28634140
has comment: http://stackoverflow.com/comment/45568298
has comment: http://stackoverflow.com/comment/45568452
answers question: http://stackoverflow.com/q/28633868
has comment: http://stackoverflow.com/comment/45571956
type: Answer
has body: "Thanks, but I need to be sure that redirect is always executed (even to those with javascript off)" Remove the php header. add a no script path. Then do as Simone suggested:
upvote count: 1
has comment: http://stackoverflow.com/comment/45568207
has comment: http://stackoverflow.com/comment/45568411
has comment: http://stackoverflow.com/comment/45568613
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28633868
score: 1

http://stackoverflow.com/a/28666377
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28643115
has body: to fix the above problem i am not capturing both event, mouse down and click, if the target element on both event matches then only i am closing the panel. /* If mouse down and click on the same control, then only close the panel, Click event closing is added to avoid closing panel on scrollbar click. */ var closeSearchResultsIfClickedOutside = function (e) { if (e.type === 'mousedown') { /* only if mouse down is outside of search panel then only close the panel. */ if($(e.target).parents('.searchResults').length === 0) { isMouseDownOnSearchPanel = true; } else { isMouseDownOnSearchPanel = false; } } else if (e.type === 'click' &amp;&amp; isMouseDownOnSearchPanel) { /*click event is implemented to avoid closing when mouse down is on scrollbar. you dont get click get event for scrollbar*/ var scope = angular.element($("#searchContainer")).scope(); $("html").off("mousedown", closeSearchResultsIfClickedOutside); $("html").off("click", closeSearchResultsIfClickedOutside); isMouseDownOnSearchPanel = false; reinitializePanelsWidth(); } };

http://stackoverflow.com/q/28674771
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28700876
has comment: http://stackoverflow.com/comment/45644494
answer count: 1
has comment: http://stackoverflow.com/comment/45643420
has comment: http://stackoverflow.com/comment/45643294
has comment: http://stackoverflow.com/comment/45643003
tagged with: node.js
type: AnsweredQuestion
has title: Mongo not working with node.js program
has body: I'm trying to create a simple node.js program to input, update and delete "name and job" records of people and show the same in browser. I'm using node.js, mongo and jade. Following is my server.js file (in the "/base" folder): var express= require("express"), http= require("http"), bodyparser= require("body-parser"), mongo= require("mongodb"); var app= express(); db= new mongo.Db("newapp", new mongo.Server("127.0.0.1", "27017"), {safe:true}, {auto_reconnect: true}); var people= db.collection("people"); app.use(bodyparser.urlencoded({extended: true})); app.get("/", function(req, res){ people.find().toArray(function(err, docs){ if(err) throw err; res.render("index.jade", {people: docs}); }); }); app.post("/", function(req, res){ people.insert({name: req.body.name, job: req.body.job}, function(err, doc){ if(err) throw err; res.redirect("/"); }); }); app.get("/update/:id", function(req, res){ people.findOne({_id: new mongo.ObjectID(req.params.id)}, function(err, doc){ if(err) throw err; res.render("update.jade", {person: doc}); }); }); app.post("/update/:id", function(req, res){ people.update({_id: new mongo.ObjectID(req.params.id)}, { name: req.body.name, job: req.params.job }, function(err, item){ if(err) throw err; res.rediect("/"); }); }); app.get("/delete/:id", function(req, res){ people.remove({_id:new mongo.ObjectID(req.params.id)}, function(err){ if(err) throw err; res.redirect("/"); }); }); app.listen("3000", function(){ console.log("Now Listening on port: 3000"); }); I have an index.jade file (in the "/base/views/" sub-folder): form(method="POST") p Name: input(type="text", name="name") p Job: input(type="text", name="job") p: button Add if(typeof(people)!=="undefined") ul each person in people li h2= person.name+ " ("+ person.job+ ")" p a(href="/update/#{person._id}") Update a(href="/delete/#{person._id}") Delete else p No People My update.jade file (in the "/base/views/" sub-folder) is: form(method="POST") p Name: input(type="text", name="name", value="#{pe…
type: Question
has comment: http://stackoverflow.com/comment/45643520
tagged with: mongodb
has answer: http://stackoverflow.com/a/28700876

http://stackoverflow.com/comment/45584053
comment on: http://stackoverflow.com/a/28642738
type: AnswerComment
score: 0
type: Comment
has text: @jfriend00 True, but if you modify the core functions on the `prototype`, you have broken it for every string instance, however modifying an instance will only break it for that instance. So technically, using `String.prototype.indexOf` can work in more instances.

http://stackoverflow.com/comment/45745012
comment on: http://stackoverflow.com/a/28727835
score: 0
type: AnswerComment
has text: Depending on what holds references to what, it may also be necessary in some circumstances to null out the reference to allow it to be collected.
type: Comment

http://stackoverflow.com/q/28687715
favorite count: 0
has answer: http://stackoverflow.com/a/28687729
accepted answer: http://stackoverflow.com/a/28687729
upvote count: 1
has title: wrap() doesn't work well with after()
type: AnsweredQuestion
has body: $(".modal-body").after($('.myDiv').wrap('&lt;form&gt;&lt;/form&gt;')); the after method of .myDiv did work but it did not wrapped within ? I also tried like this $('.myDiv').wrap('&lt;form&gt;&lt;/form&gt;'); $(".modal-body").after($('.myDiv')); but doesn't worked. My desired result is my .myDiv wrapped with form tag and been placed after modal.
score: 1
has comment: http://stackoverflow.com/comment/45667801
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery

fabricjs
tags question: http://stackoverflow.com/q/28632682
tags question: http://stackoverflow.com/q/28626529
tags question: http://stackoverflow.com/q/28605076
tags question: http://stackoverflow.com/q/28689578
tags question: http://stackoverflow.com/q/28627220
tags question: http://stackoverflow.com/q/28712926
tags question: http://stackoverflow.com/q/28643612
tag name: fabricjs
tags question: http://stackoverflow.com/q/28638455
tags question: http://stackoverflow.com/q/28599067
tags question: http://stackoverflow.com/q/28693119
tags question: http://stackoverflow.com/q/28676293
type: Tag
tags question: http://stackoverflow.com/q/28628220
tags question: http://stackoverflow.com/q/28618670

http://stackoverflow.com/q/28650683
tagged with: jquery
favorite count: 0
has body: Let's say, we have a simple form validation code that binds event listeners on multiple input fields: var self = this, name = $("#name") || opts.name, surname = $("#surname") opts.surname, email = $("#email") || opts.email , phone = $("#phone") || opts.phone; name.on('blur change', function() { self.validateName(name); }); surname.on('blur change', function() { self.validateSurname(surname); }); email.on('blur change', function() { self.validateEmail(email); }); phone.on('blur change', function() { self.validatePhone(phone); }); Is there any way to shorten this without losing any performance? For example, if I want to check if some input are exists in the form, there will be too much repetitive if(input) {...} statements. UPD: ID's (or classes) can be different and function can accept an object with input fields: var validation = new Validation({ name: $('.name'), surname:.. });
has answer: http://stackoverflow.com/a/28650894
type: AnsweredQuestion
score: 1
has title: Shorthand for binding jQuery events
upvote count: 1
accepted answer: http://stackoverflow.com/a/28650894
type: Question
has comment: http://stackoverflow.com/comment/45600135
tagged with: javascript
has comment: http://stackoverflow.com/comment/45598902
answer count: 2
possible better answer: http://stackoverflow.com/a/28650744
downvote count: 0
has answer: http://stackoverflow.com/a/28650744

http://stackoverflow.com/q/28612649
downvote count: 1
type: Question
has title: regex for 6 digits before and 2 digits after decimal
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28612703
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45529700
has comment: http://stackoverflow.com/comment/45529280
tagged with: regex
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28612703
tagged with: java
score: 6
has body: I need a regex in which decimal is optional. If decimal is there then there can be max 6 digits before and max 2 digits after decimal. If decimal is not there then max of 6 digits is valid. Regex tested :^\d{0,6}\.?\d{1,2}$ The above regex allows max of 8 digits without decimal. How can I change according to my needs so that if there is no decimal then it would take max of 6 digits? VALID CASES 123456.12 21231 123456 15465.43 23.34 6.45 .12 INVALID CASES 12345678 123456.331
upvote count: 7

http://stackoverflow.com/q/28674046
possible better answer: http://stackoverflow.com/a/28674303
has body: I am trying to conditionally apply a class to an element but I can't get the syntax correct I have tried the following but it does not work. ng-class="{foo: bar === "true"}" bar is a boolean value. Also, the element already has a class attribute. Will foo be appended to the list of classes?
has answer: http://stackoverflow.com/a/28674303
answer count: 2
has title: Ng-class Conditional Syntax
tagged with: javascript
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28674254
score: 0
type: Question
accepted answer: http://stackoverflow.com/a/28674254
has comment: http://stackoverflow.com/comment/45642921

http://stackoverflow.com/q/28691032
downvote count: 0
score: 18
has answer: http://stackoverflow.com/a/28691091
has body: I am using jquery chosen and I want to set selected values from javascript Javascript/Jquery $(document).ready(function() { var selectedUserRole = document.getElementById('SelectedUserRole').value; var str_array = selectedUserRole.split(','); for (var i = 0; i &lt; str_array.length; i++) { // Trim the excess whitespace. str_array[i] = str_array[i].replace(/^\s*/, "").replace(/\s*$/, ""); // Add additional code here, such as: $("UserRole").prop('selectedValue', str_array[i]); // Here not working } }); Html: @Html.DropDownList("UserRole", null, new { id = "UserRole", @class = "chosen-select", @multiple = "multiple", @placeholder = "Lütfen Rol Seçiniz", @style = "width: 250px;" }) str_array has values below [5, 1, 7] I want to set 5 value selected, 1 value selected 7 value selected When I tried below $("UserRole").prop('selectedValue', str_array[i]); it is not working for me.
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28691072
favorite count: 0
accepted answer: http://stackoverflow.com/a/28691074
possible better answer: http://stackoverflow.com/a/48606281
answer count: 4
has answer: http://stackoverflow.com/a/48606281
has title: Jquery chosen set selected values from javascript
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28691074
upvote count: 18
type: Question

http://stackoverflow.com/a/28710802
has comment: http://stackoverflow.com/comment/45854466
upvote count: 1
has comment: http://stackoverflow.com/comment/45715395
type: Answer
has comment: http://stackoverflow.com/comment/45826834
accepted answer of: http://stackoverflow.com/q/28709913
has body: That is so annoying! I have had the exact same issue: dynamically created images do not flicker in FF, but they flicker in Chrome. I don't have any reference work for the internals of Chrome saying why it happens, but here is how I solved it when it happened to me. 2 things: 1. Don't use img src. Load the image as a background image to a div. Chrome must load/cache those differently...? 2. Preload the image. That makes all the difference. In FF you can achieve a preload by creating a DOM element containing the image, ala var $img=$(' '); $img.attr('src','image.ext'); However, Chrome requires that you actually append the image to the DOM (somewhere off screen) if you want to preload it, something like var $img=$(' '); $img.attr('src','image.ext'); $img.css({position:'absolute',top:'-10000px',left:'-10000px'}); $('body').append($img); Since you already have the displayMsg() function ready to go, you can preload the image by calling it with an empty message and then immediately removing the element it creates so it doesn't clutter the screen. The html/css were unchanged. JS ngcClientTag = 0; opt_avatar = '1'; /* PRELOAD *///=========================== //you know the avatar number, grab the image var img='http://parkbenchgames.com/images/ava/' + opt_avatar + '.png'; //make it a background style instead of an img tag var bgStyle="background-image:url("+img+")"; $(document).ready(function () { //preload the image! displayMsg(); //use setTimeout to make sure we are on the next iteration of event loop setTimeout(function() {$('.msg1').remove()},0); }); function displayMsg() { var message = $('#outgoing').val(); $('#outgoing').val(''); ngcClientTag++; var innerHtml = ' '; //display img in div instead of img tag //borrow class msg2 to give it the same dimensions as the img innerHtml +=' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' '; $("#newMsg").append(innerHtml); $("#s_m_" + ngcClientTag).text(message); // for text safe insert } fiddle http://jsfiddle.net/yo307pt7/4/
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45854435
has comment: http://stackoverflow.com/comment/45770062
answers question: http://stackoverflow.com/q/28709913
has comment: http://stackoverflow.com/comment/45828652
type: AcceptedAnswer

http://stackoverflow.com/comment/45594633
comment on: http://stackoverflow.com/q/28648090
type: QuestionComment
type: Comment
score: 0
has text: There is a clear separate concept. real arrays have functions specific to arrays

http://stackoverflow.com/a/28760001
accepted answer of: http://stackoverflow.com/q/28740645
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45923702
type: Answer
has body: This way you can select options HTML : Option 1 Option 2 Option 3 Option 4 Option 5 Option 6 Option 7 Option 8 Option 9 jQuery: $('select').find('option[value="option3"]').attr("selected", "selected"); $('select').find('option[value="option4"]').attr("selected", "selected"); $("select").multiselect();
answers question: http://stackoverflow.com/q/28740645
downvote count: 0
score: 1

http://stackoverflow.com/q/28750179
answer count: 1
has comment: http://stackoverflow.com/comment/45784211
has comment: http://stackoverflow.com/comment/45783537
favorite count: 0
accepted answer: http://stackoverflow.com/a/28751009
downvote count: 2
has comment: http://stackoverflow.com/comment/45783928
type: AnsweredQuestion
has title: Issue toggle on/off with infowindow
type: Question
tagged with: google-maps
has body: today i saw an answer about toggle on/off in the same button, and i decided to try to use. What i want is to click in the marker and than a infowindow appear in my map, but it doesn't work. JSFiddle simple marker with infowindow JSFiddle toogle on/off but no infowindow When i try to join(toogle with infowindow) like this: google.maps.event.addDomListener(buttonCarrosUI, 'click', function() { if(marker &amp;&amp; marker.setMap){ if (marker.getMap() != null) marker.setMap(null); else marker.setMap(map_canvas); }else{ var myLatLng; var title = marker.title; $.each( data.markers, function(i, marker) { myLatLng = new google.maps.LatLng(marker.latitude, marker.longitude); }); var infowindow = new google.maps.InfoWindow({ content: title, }); marker = new google.maps.Marker({ position: myLatLng, map: map_canvas, icon: image, title: title }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map_canvas,marker); }); } }); I Got this issue TypeError: marker is undefined var title = marker.title; I'll be very gratefull if someone can help me, thanks.
score: -2
has answer: http://stackoverflow.com/a/28751009
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45783250
tagged with: google-maps-api-3
has comment: http://stackoverflow.com/comment/45784380
has comment: http://stackoverflow.com/comment/45783872
upvote count: 0

http://stackoverflow.com/comment/45577430
score: 0
comment on: http://stackoverflow.com/a/28638810
type: Comment
has text: @nikhilrao: The article that Teemu linked to has a solution that works for an object, but it's not supported in all browsers, for example IE8 and earlier. For full support you have to use an actual array.
type: AnswerComment

http://stackoverflow.com/a/28705414
accepted answer of: http://stackoverflow.com/q/28705178
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28705178
has body: Rather than escaping the square brackets, you can instead quote the value of the attribute: var att_default = master_selects.filter('[name="' + attrib_id+ '"]').attr('value');
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28691300
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28690685
upvote count: 1
has body: Lets define two arrays of male and female indices, genders array, shuffle them and pop some items. It is easy to do with Underscore.JS, for example: var malesCount = 20; var femalesCount = 20; var profiles = { 'male' : _.shuffle(_.range(1, malesCount + 1)), 'female' : _.shuffle(_.range(1, femalesCount + 1)), }; var genders = []; for (var index = 0; index &lt; malesCount; index++) { genders.push('male'); } for (var index = 0; index &lt; femalesCount; index++) { genders.push('female'); } genders = _.shuffle(genders); var gender; var pictureNo; var src; while (gender = genders.pop()) { pictureNo = profiles[gender].pop(); src = 'assets/img/' + gender + '_profile' + pictureNo + '.jpg'; console.log(src); } I've tested this solution for 50K of males and 50K of females, it executes just in 115 msec.
type: Answer

http://stackoverflow.com/q/28599033
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45504504
tagged with: datatable
has answer: http://stackoverflow.com/a/28599486
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
downvote count: 1
type: Question
has body: I have my JSON Data in the below format { "RegX": { "LayerA": { "name": "abcd123", "url": "htt:cd1234" }, "LayerB": { "name": "xyz234", "url": "ht:bcd12" } }, "RegY": { "Layer1": { "name": "xyz123", "url": "ht/abc1234" }, "Layer2": { "name": "xy234", "url": "http://abc12" } } } I want to display this in a datatable in below format . TABLE NAME - REGX NAME URL LAYERA abcd123 httd1234 LAYERB xyz234 http:cd12 TABLE NAME - REGY NAME URL LAYER1 xyz123 http:d1234 LAYER2 xyz234 h/abcd12 Is there a way that i can display single JSON file in two different tables and display proper Row names and Column names also from JSON table ? I am planning to use datatables but not able to find proper implementation to use
tagged with: javascript
tagged with: jquery
score: 0
has title: JSON to Data Table Mapping
has comment: http://stackoverflow.com/comment/45504385
answer count: 1
has comment: http://stackoverflow.com/comment/45504228
favorite count: 0

http://stackoverflow.com/comment/45768571
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28742744
has text: can I delete this question now??
score: 0

http://stackoverflow.com/comment/45776112
score: 0
type: Comment
type: QuestionComment
has text: If this is an Ember Array object, use foundCountry.get('id') as opposed to .getAttribute. .getAttribute isn't a function. Check out the docs: http://emberjs.com/api/classes/Ember.ArrayProxy.html#method_get
comment on: http://stackoverflow.com/q/28746900

http://stackoverflow.com/q/28646170
has comment: http://stackoverflow.com/comment/45593498
tagged with: nosql
answer count: 0
has body: I am trying to access my couchDB database to perform simple get/post stuff. My couchDB URL is : http://restify.iriscouch.com/ When I run the below code Nothing happens! var http = require( 'http' ); http.get( 'http://restify.iriscouch.com/', function( res ) { console.log( res ); }); But if I change the couchDB url to http://mikeal.iriscouch.com/ it works. This url (http://mikeal.iriscouch.com/) is not mine I found it online from an example. The below code works. var http = require( 'http' ); http.get( 'http://mikeal.iriscouch.com/', function( res ) { console.log( res ); }); What am I doing wrong? Is there something wrong with my Database?
has comment: http://stackoverflow.com/comment/45592832
has comment: http://stackoverflow.com/comment/45597512
tagged with: http
type: Question
has comment: http://stackoverflow.com/comment/45592482
has comment: http://stackoverflow.com/comment/45595766
tagged with: javascript
has title: CouchDB Database Error
tagged with: couchdb
score: 0
has comment: http://stackoverflow.com/comment/45607360
has comment: http://stackoverflow.com/comment/45594957
tagged with: rest
type: UnansweredQuestion

http://stackoverflow.com/a/28672617
score: 1
accepted answer of: http://stackoverflow.com/q/28672405
answers question: http://stackoverflow.com/q/28672405
upvote count: 1
type: AcceptedAnswer
has body: There is not one. Models reside in the App/ folder. As this is where the User model resides. Create your own folder to have one. The documentation will cover this, found here. This will go through how the relationship is set up within your relevant model. public function roles(){ return $this-&gt;belongsToMany('App\Role', 'Pivot_table_name', 'foreign_key', 'other_key'); } Please Note: Pretty much everything is covered within the documentation. Now that you have your relation, you can call it like so on your user model $user = User::with('roles')-&gt;find(1); This will eager load your role on to the model for you, and can be accessed like so; $user-&gt;roles. The documentation also covers querying relationships using the whereHas method found here.
type: Answer
downvote count: 0

http://stackoverflow.com/comment/45540575
type: Comment
comment on: http://stackoverflow.com/a/28618663
type: AnswerComment
has text: i added the padding but the problem with padding is that it is not working fine on IE
score: 0

http://stackoverflow.com/a/28674702
has comment: http://stackoverflow.com/comment/45642970
has comment: http://stackoverflow.com/comment/45643237
has body: You need to set the Ajax Request with all parameters for a form request. For example the content-type as application/x-www-form-urlencoded. Look at this: application/x-www-form-urlencoded or multipart/form-data? UPDATE: ...and yes ...you must do a POST request, and not a GET. UPDATE: $.ajax({ url: 'verifyCaptcha', contentType: "application/x-www-form-urlencoded", type: "POST", success: function (response) { alert(response); }, error: function(response) { alert('ERROR', response); } });
answers question: http://stackoverflow.com/q/28674628
type: Answer
has comment: http://stackoverflow.com/comment/45642849
score: 0
has comment: http://stackoverflow.com/comment/45643173

http://stackoverflow.com/q/28649848
accepted answer: http://stackoverflow.com/a/28650054
favorite count: 0
has comment: http://stackoverflow.com/comment/45597347
has title: Why do projects like angular have their own version of common functions?
tagged with: angularjs
type: AnsweredQuestion
type: Question
possible better answer: http://stackoverflow.com/a/28649987
has answer: http://stackoverflow.com/a/28650054
has comment: http://stackoverflow.com/comment/45597290
has answer: http://stackoverflow.com/a/28649987
upvote count: 5
tagged with: javascript
has body: I am trying to understand or refresh my logic on this better - for example in angular it has the angular.forEach(). I thought it was because the code in a controller(or module in general) - didn't have access to the browser api (functions and objects, etc) - and for that matter the forEach function of the browser. But just tested it out as I was trying to understand it better/prove rationale - and both of these console.log() expressions worked. angular.module('myApp', []) .controller('JCtrl', ['$scope', function($scope) { $scope.test = 'scope and binding works'; [0, 1, 4].forEach(function(value) { console.log(value); }); console.log([].forEach); }]); here is the plnkr
answer count: 3
score: 5
downvote count: 0
has answer: http://stackoverflow.com/a/28649995
has comment: http://stackoverflow.com/comment/45597885

http://stackoverflow.com/a/28651410
score: 0
type: AcceptedAnswer
has body: TwilightSun answered the question. The server has a firewall.
accepted answer of: http://stackoverflow.com/q/28642457
type: Answer
answers question: http://stackoverflow.com/q/28642457

http://stackoverflow.com/comment/56337518
has text: @fanhats You should post here how you solved the issue with sequelize devs help at https://github.com/sequelize/sequelize/issues/3195.
comment on: http://stackoverflow.com/q/28643775
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45528793
has text: when i say `(p.foo = o.foo)(); // 2` so basically p.foo takes the value of o.foo() , and since this is an iffe, p.foo() will have to be executed in the global scope and so should print 4 i guess ?
type: AnswerComment
comment on: http://stackoverflow.com/a/28609266
score: 0
type: Comment

http://stackoverflow.com/comment/50863049
type: QuestionComment
has text: You can try this.. ```$scope.$on('$routeChangeStart', function() { $mdDialog.cancel(); }); ```
comment on: http://stackoverflow.com/q/28594555
score: 0
type: Comment

http://stackoverflow.com/comment/45683069
has text: @FrédéricHamidi i was expecting that the outer paranthesis is needed so the anonymous function can be treated as an expression e.g. `(function() {}).call(this)` or `+function() {}.call(this)`. But why does `(function() {}.call(this))` execute but `function() {}.call(this)` does not?
comment on: http://stackoverflow.com/q/28696237
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28651558
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28651504
has body: The outer self-invoking anonymous function (iffy) will do what the name suggests. It'll call itself immediately at run-time. So in conclusion to that, I assure you, the inner script will work the same way removing the outer function (as long as there are no other scripts around which might influence your code).
answers question: http://stackoverflow.com/q/28651504
type: AcceptedAnswer

http://stackoverflow.com/a/28607462
has comment: http://stackoverflow.com/comment/137908690
has body: To use Array.prototype.filter here might be obvious. So to remove only undefined values we could call var data = [42, 21, undefined, 50, 40, undefined, 9]; data = data.filter(function( element ) { return element !== undefined; }); If we want to filter out all the falsy values (such as 0 or null) we can use return !!element; instead. But we can do it slighty more elegant, by just passing the Boolean constructor function, respectively the Number constructor function to .filter: data = data.filter( Number ); That would do the job in this instance, to generally remove any falsy value, we would call data = data.filter( Boolean ); Since the Boolean() constructor returns true on truthy values and false on any falsy value, this is a very neat option.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/133861453
has comment: http://stackoverflow.com/comment/59293568
has comment: http://stackoverflow.com/comment/112910856
score: 261
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/116258593
has comment: http://stackoverflow.com/comment/62270950
upvote count: 262
has comment: http://stackoverflow.com/comment/92760057
accepted answer of: http://stackoverflow.com/q/28607451
answers question: http://stackoverflow.com/q/28607451
has comment: http://stackoverflow.com/comment/104819552

http://stackoverflow.com/a/28629018
type: Answer
has body: Why are you not using the ng-model on your input ? &lt;input type="text" ng-model="modelRef.thingToValidate" ng-blur="validatev(modelRef);" class="form-control"/&gt; Then In your JS you have a reference to the input value.. $scope.validatev = function (modelRef) { console.log(modelRef.thingToValidate); }; Note I havent tested this but it just demonstrates the ng-model useage.. Example : Angular Form Documentation
answers question: http://stackoverflow.com/q/28628869
has comment: http://stackoverflow.com/comment/45559490
score: 1
downvote count: 0
upvote count: 1

http://stackoverflow.com/comment/45662130
score: 0
comment on: http://stackoverflow.com/q/28684350
type: Comment
type: QuestionComment
has text: This is essentially an XY problem. Rather than asking how to remove an anonymous event handler, he should ask how he can use named event handlers to do what he wants. Alternatively, instead of removing the handlers, they could just check a global variable that says whether they're supposed to do anything.

http://stackoverflow.com/q/28603329
has comment: http://stackoverflow.com/comment/45512770
tagged with: asp.net
score: 0
has comment: http://stackoverflow.com/comment/45514102
answer count: 0
type: UnansweredQuestion
has body: I have Tried to implement multiple file upload like gmail in button click using uplodify jquery plugin but after page loading i ma not getting any button My coding i am mentioning below![The below is the designing andnext one is coding in ashx page![]1 if you have idea why the select files button not coming please respond to me thanks In advance
type: Question
has comment: http://stackoverflow.com/comment/45513996
has comment: http://stackoverflow.com/comment/45514445
has title: While uploading multiple files the browse button is not showing using jquery and Asp.net
has comment: http://stackoverflow.com/comment/45511650
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28611528
tagged with: google-chrome-app
has body: This is my first Chrome app creation attempt. Our school wants to create kiosk app for Chromebooks that will launch a webpage on our web server that is filled with shortcut links. This is mainly so young users like kindergarteners can bypass the login screen making the login screen is still available for older students. I spent a little bit of time on it yesterday and deployed it through the Google Apps management console, but the app does not display on our devices. I'm sure it's an issue with my code. When I install the app as an extension in Chrome on a Windows computer I get this error message: There were warnings when trying to install this extension: 'kiosk_enabled' is only allowed for packaged apps, but this is a hosted app. 'browser' is only allowed for packaged apps, but this is a hosted app. Here is the code in my manifest.json file. { "name": "Homepage", "version": "0.1", "manifest_version": 2, "description": "School homepage", "icons": { "128": "hn128x128.png", "96": "hn96x96.png" }, "app": { "urls": ["http://mydomain/homepage/"], "launch": { "web_url": "http://mydomain/homepage/" } }, "permissions": [ "browser" ], "kiosk_enabled": true } I was hoping that allowing guest mode would work, but there doesn't seem to be a way to configure a homepage for guests.
type: UnansweredQuestion
tagged with: kiosk-mode
upvote count: 1
linked to: http://stackoverflow.com/q/22640198
has answer: http://stackoverflow.com/a/32574552
has answer: http://stackoverflow.com/a/28612130
has title: How do I create a Chrome App effectively acting as a launch page in kiosk mode?
score: 1
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/53935577
downvote count: 0
tagged with: javascript
tagged with: kiosk
favorite count: 0

http://stackoverflow.com/comment/45598676
type: Comment
type: QuestionComment
has text: I will try that but why could not var work as global? According to this it should : http://stackoverflow.com/a/944288/365624
score: 0
comment on: http://stackoverflow.com/q/28650447

http://stackoverflow.com/q/28688171
answer count: 1
has answer: http://stackoverflow.com/a/28688267
type: UnansweredQuestion
has title: Random password generate
tagged with: passwords
has comment: http://stackoverflow.com/comment/45668730
has comment: http://stackoverflow.com/comment/45669660
type: Question
has comment: http://stackoverflow.com/comment/45668587
tagged with: javascript
has comment: http://stackoverflow.com/comment/45720938
score: 0
has body: I have requirement to generate a 8 digit random password which must contains letters (A-Z, a-z, 0-9). Am using following function to generate my password.It was working for me, once i noticed some passwords are letters only eg "WaIoGarQ". How to improve my code to make sure which include both letters and numbers. _makePwd = function () { var text = ""; var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; for (var i = 0; i &lt; 8; i++) { text += possible.charAt(Math.floor(Math.random() * possible.length)); } return text; } Your help is much appreciated. Thank you.

http://stackoverflow.com/q/28657729
has comment: http://stackoverflow.com/comment/45620102
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45633693
upvote count: 0
answer count: 1
favorite count: 0
type: UnansweredQuestion
has title: email validation for dot in the beginning of host name and 2 dots in the middle of host name
tagged with: regex
has body: I'm having trouble adding another filter to my email validator expression: Here it is: var fullEmailCheck = "((?=(^\..{1,64}@.{1,255}))([!#$%&amp;'*+\\-\\/=?\\^_`{|}~a-zA-Z0-9}]{1,64}(\\.[!#$%&amp;'*+\\-\\/=?\\^_`{|}~a-zA-Z0-9]{1,}){0,})@((\\[(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}\\])|([a-zA-Z0-9-]{1,63}(\\.[a-zA-Z0-9-]{1,63}){1,})))"; I want to add a check for: dot in the beginning of host name. a check for 2 consecutive dots in the middle of host name. Thanks for any help
has comment: http://stackoverflow.com/comment/45620156
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28670089
has comment: http://stackoverflow.com/comment/45620130

http://stackoverflow.com/a/28725230
type: Answer
has comment: http://stackoverflow.com/comment/45737451
answers question: http://stackoverflow.com/q/28724776
has body: You can do it all in onClick, like this: - +
score: 0

http://stackoverflow.com/q/28666374
has title: Angularjs pass function from Controller to Directive (or call controller function from directive) - with parameters
type: AnsweredQuestion
score: 2
linked to: http://stackoverflow.com/q/18378520
type: Question
has answer: http://stackoverflow.com/a/28666418
downvote count: 0
tagged with: javascript
has body: My question is very simple, I just want to pass a controller function to directive. In other terms, I just want to call a controller function from directive. var myapp =angular.module('myapp',[]); myapp.controller('myCtrl',['$scope','$timeout',function($scope,$timeout){ $scope.fnItemsOnAdded = function(itms){ alert('Hi, I am in controller add. Here are your Items: '+JSON.stringify(itms)); } $scope.fnItemsOnCancel = function(itms){ alert('Hi, I am in controller cancel. Here are your Items: '+JSON.stringify(itms)); } }]); myapp.directive('myPicker',['$timeout',function($timeout){ var dtv={}; dtv.template = ' {{itm.Name}} '; dtv.template += 'add items'; dtv.template += 'cancel'; dtv.scope = { postUrl: '@', jsonadd: '&', jsoncancel: '&' }; dtv.restrict = 'A'; dtv.link = function($scope,elm,attrs){ $scope.ngModel={}; $scope.ngModel.SelectedKeys=[]; $timeout(function(){ $scope.ngModel.ItemsList = [ {Name:"Item1",IsSelected:false}, {Name:"Item2",IsSelected:false}, {Name:"Item3",IsSelected:false}, {Name:"Item4",IsSelected:true}, {Name:"Item4",IsSelected:false}, ]; },100); $scope.addItems = function(){ //Dummy logic to update SelectedKeys for(var idx =0;idx<$scope.ngModel.ItemsList.length;idx++){ if($scope.ngModel.ItemsList[idx].IsSelected){ $scope.ngModel.SelectedKeys.push($scope.ngModel.ItemsList[idx]); } } alert("i'm in directive add. Lemme call parent controller"); $scope.jsonadd($scope.ngModel.SelectedKeys); } $scope.cancelItems = function(){ alert("i'm in directive cancel. Lemme call parent controller"); $scope.jsonadd($scope.ngModel.SelectedKeys); } } return(dtv); }]); I have tried this approach but it doesn't trigger the function, doesn't throw any error either. I tried this and this approach - it returns an error $apply is already in progress. Can anybody please help me where I'm going wrong here. I believe it has got something to do with $scope inheritance or convention. I know I am doing some petty mistake here, just that I am can't figure it in the rush I am. Tha…
answer count: 1
accepted answer: http://stackoverflow.com/a/28666418
favorite count: 0
tagged with: angularjs
upvote count: 2
linked to: http://stackoverflow.com/q/17583004

http://stackoverflow.com/comment/91210917
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28634106
has text: well that's one way to do it :P
type: AnswerComment

http://stackoverflow.com/comment/45756117
type: AnswerComment
score: 0
type: Comment
has text: i want the id of check box in check function.
comment on: http://stackoverflow.com/a/28735177

http://stackoverflow.com/q/28739098
type: Question
tagged with: phantomjs
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/8049520
has comment: http://stackoverflow.com/comment/45764591
tagged with: web-crawler
has comment: http://stackoverflow.com/comment/131794593
has title: How can I scrape pages with dynamic content using node.js?
upvote count: 35
tagged with: javascript
answer count: 6
possible better answer: http://stackoverflow.com/a/47202431
has answer: http://stackoverflow.com/a/31059035
has comment: http://stackoverflow.com/comment/45791527
has answer: http://stackoverflow.com/a/47202431
has answer: http://stackoverflow.com/a/58216061
has answer: http://stackoverflow.com/a/77365256
tagged with: node.js
has answer: http://stackoverflow.com/a/74985800
favorite count: 0
has answer: http://stackoverflow.com/a/28758687
has body: I am trying to scrape a website but I don't get some of the elements, because these elements are dynamically created. I use the cheerio in node.js and My code is below. var request = require('request'); var cheerio = require('cheerio'); var url = "http://www.bdtong.co.kr/index.php?c_category=C02"; request(url, function (err, res, html) { var $ = cheerio.load(html); $('.listMain &gt; li').each(function () { console.log($(this).find('a').attr('href')); }); }); This code returns empty response, because when the page is loaded, the &lt;ul id="store_list" class="listMain"&gt; is empty. The content has not been appended yet. How can I get these elements using node.js? How can I scrape pages with dynamic content?
accepted answer: http://stackoverflow.com/a/28758687
score: 34
downvote count: 1

http://stackoverflow.com/comment/45634281
comment on: http://stackoverflow.com/q/28670131
score: 0
type: Comment
type: QuestionComment
has text: if an attrib value needs to use attrib invalid chars (like >), a space, an equal, a quote or an apos, then you need to quote the attrib value. in your case, you use spaces, =, and apos, so you need quotes (") around the attrib value

http://stackoverflow.com/a/29288389
has comment: http://stackoverflow.com/comment/46775031
has comment: http://stackoverflow.com/comment/46787702
has comment: http://stackoverflow.com/comment/46774017
type: Answer
has comment: http://stackoverflow.com/comment/46775123
upvote count: 0
has body: The comparator for the filter can be an object that mirrors the objects in your array. If this is the case, it will only filter based on the exiting properties. That is to say if newVal is an object of the following form: { name: someVal, emails: otherVal } You will only filter on name and emails, not id. Having an id field which is blank is also fine (that just means you wont search by id). Here is an example: angular.module("app", []).controller("ctrl", ["$scope", "$filter", function($scope, $filter){ $scope.data = [ {"id":"1a", "name": "aaa", "emails": ["123@123.com", "123@123.info"]}, {"id":"2a", "name": "aba", "emails": ["23@123.com", "3@123.info"]}, {"id":"3a", "name": "aab", "emails": ["3@123.com", "3@123.info"]} ]; }]); &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"&gt;&lt;/script&gt; &lt;div ng-app="app"&gt; &lt;div ng-controller="ctrl"&gt; Name: &lt;input type="text" ng-model="filter.name"&gt;&lt;br&gt; Email: &lt;input type="text" ng-model="filter.emails"&gt; &lt;div ng-repeat="x in data | filter:filter"&gt; {{x}} &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; Note how entering a value in the emails input will search the array properly. if you want you can also set both inputs to the same model, and then set that model to filter.name and filter.email. //html Search Query: &lt;input type="text" ng-model="query"&gt; //js $scope.$watch('query', function(newVal, oldVal){ $scope.filter.name=newVal; $scope.filter.emails=newVal; }
has comment: http://stackoverflow.com/comment/46775053
score: -1
downvote count: 1
has comment: http://stackoverflow.com/comment/46774054
answers question: http://stackoverflow.com/q/28745387
has comment: http://stackoverflow.com/comment/46774981

http://stackoverflow.com/comment/45587098
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28644413
has text: The solution I provided will work for onfocus if you add the `contenteditable="true"` attribute. But @Mouser also has provided a correct solution

http://stackoverflow.com/comment/62556092
has text: http://stackoverflow.com/questions/23295168/how-do-i-fire-a-new-ajax-on-select2-new-remove-tag-event
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28656977
type: Comment

http://stackoverflow.com/comment/45523849
type: Comment
type: QuestionComment
has text: you never update `x` inside your loop, so it stays at the same value. Try `x--;` after the `console.log` line
score: 6
comment on: http://stackoverflow.com/q/28610062

http://stackoverflow.com/q/28655903
score: 0
answer count: 2
linked to: http://stackoverflow.com/q/9873197
has body: I have searched in SO and did not find my answer. Here is my query , In javascript we generally generate time stamp like below Date.now() which outputs something like 1424592736769 But this value changes each time , since time is associated with it. For example Suppose I generate timestamp today and store in database....after few days If I enter date in format like 2012, 01, 1 , I should be able to get the same time stamp. What I tried //got time stamp var a = Date.now() / 1000000 | 0 var d = Date(a); console.log(d); // and now based on the var a , I can be generate the timestamp based on specifying dateformat I know its wrong , some one guide me please. P.S : I do this operation because I wanted to store a data on particular date as time stamp in database and modify those data later based on that particular date via timestamp. For example my db should look like this DAY DATA ------------------ 432324234 - 1000 rs //day1 data 767677657 - 2000 rs //day2 data P.s : no one understood my question , To be more clear I need to get todays date for example (feb 22 2015) as time stamp , After few days if I use Date(2015,01,22) , I must get the same time stamp generated on feb 22 2015
possible better answer: http://stackoverflow.com/a/28655932
type: AnsweredQuestion
has title: Get time stamp only for date and vice versa
tagged with: mysql
accepted answer: http://stackoverflow.com/a/28655916
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28655932
tagged with: date
has answer: http://stackoverflow.com/a/28655916

rsvp.js
type: Tag
tag name: rsvp.js
tags question: http://stackoverflow.com/q/28662333
tags question: http://stackoverflow.com/q/28686906

http://stackoverflow.com/comment/45625478
type: Comment
has text: But when I set value like this : $_SESSION['name'] = $sizeOfSearch; The value is still changing on each page. How can that be if it should store the first time only? @Lea Tano
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28665283

http://stackoverflow.com/comment/62588631
comment on: http://stackoverflow.com/a/28718403
score: 0
type: Comment
has text: Hi, have you got a link to documentation? I gave this a try in IE 11 and it worked.
type: AnswerComment

http://stackoverflow.com/comment/45698650
has text: @Oriol: Right below the cited section there is used the annotation "*… if x is negative (less than zero) …*". I would indeed conclude that `-0` and `+0` are neither negative nor positive, if they were concerned the spec used the explicit term "nonnegative" instead of "positive".
type: Comment
comment on: http://stackoverflow.com/a/28704134
type: AnswerComment
score: 0

http://stackoverflow.com/a/28749457
type: Answer
downvote count: 0
score: 1
has body: Looks like you're expecting people to input HEX, why not be more strict and remove &amp; re-add the spaces each time, then limit the input var str = 'A1B'; str.replace(/0x|[^0-9a-zA-Z]/g, '').replace(/(..)(?!$)/g, '$1 ').slice(0, 14); // "A1 B" // and possibly set cursor position // (do the char removal on [0..old_pos] to figure out char difference to new_pos) This will also solve pasting or typing in the middle of the input etc as the spaces will always move to where they should be // or e.g. str = 'A1B2C3D4E5F6'; // longer than expected // becomes // "A1 B2 C3 D4 E5" Extra notes I strip 0x because it's a common hex prefix which you don't need but could be pasted in The (?!$) prevents a trailing space Your maximum length should always be 3x - 1 for some positive integer x (this is true for 14)
has comment: http://stackoverflow.com/comment/45781171
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28749301
answers question: http://stackoverflow.com/q/28749301

http://stackoverflow.com/comment/45656853
comment on: http://stackoverflow.com/a/28681404
has text: Your tick function is also referencing the `node` variable, which because it's assigned to the enter() behavior isn't updating to deal with the newly created nodes.
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/45616146
type: QuestionComment
type: Comment
has text: Can you add a fiddle of your code
comment on: http://stackoverflow.com/q/28659678
score: 0

http://stackoverflow.com/a/28608901
answers question: http://stackoverflow.com/q/28608460
score: 3
has body: I've implemented a way to do this (it should work even if the values overlap): And i've made a js fiddle to see it working. var str = '0123456789'; var matches = [{ offset: 2, length: 3 }, { offset: 6, length: 2 }]; var insertionPoints = []; for (var i in matches){ insertionPoints.push({location:matches[i].offset,val:'&lt;span class="red"&gt;'}); insertionPoints.push({ location: matches[i].offset+matches[i].length, val:'&lt;/span&gt;'}); } insertionPoints.sort(function(a,b){ return b.location- a.location; }); console.log(insertionPoints); for(var i in insertionPoints){ str=str.substring(0, insertionPoints[i].location) +insertionPoints[i].val +str.substring(insertionPoints[i].location); } console.log(str);
has comment: http://stackoverflow.com/comment/45548915
upvote count: 3
type: Answer
downvote count: 0

http://stackoverflow.com/comment/45660477
has text: Edit Im trying to get it so when i click 1 it puts "1" in the input box, someone recommended using Javascript.
score: 0
comment on: http://stackoverflow.com/q/28683822
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28676750
has answer: http://stackoverflow.com/a/28677878
tagged with: css
has comment: http://stackoverflow.com/comment/45647462
has comment: http://stackoverflow.com/comment/45647334
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45646753
has answer: http://stackoverflow.com/a/28677621
has comment: http://stackoverflow.com/comment/45647577
has comment: http://stackoverflow.com/comment/45646939
has comment: http://stackoverflow.com/comment/45647700
type: Question
has comment: http://stackoverflow.com/comment/45646858
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28676860
has comment: http://stackoverflow.com/comment/45647023
accepted answer: http://stackoverflow.com/a/28677621
has answer: http://stackoverflow.com/a/28676860
score: 0
has comment: http://stackoverflow.com/comment/45646882
answer count: 3
has comment: http://stackoverflow.com/comment/45646815
has body: This is my button code: .info_button { width: 220px; height: 300px; position: absolute; overflow: hidden; margin-right: 0; border-radius: 10px; -o-border-radius: 10px; -ms-border-radius: 10px; -webkit-border-radius: 10px; background: url(http://i.imgur.com/DkdX4Ci.jpg); background-repeat: no-repeat; background-position: 0 0; box-shadow: 3px 3px 20px #363024; } .info_button > header { position: absolute; bottom: 0; left: 0; width: 100%; padding: 20px 10px; background: inherit; background-attachment: fixed; overflow: hidden; } .info_button > header::before { content: ""; position: absolute; top: -20px; left: 0; width: 100%; background: inherit; background-attachment: fixed; -webkit-filter: blur(4px); filter: blur(4px); } .info_button > header::after { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5) } .info_button > header p a { margin: 0; color: white; position: relative; z-index: 0; } .info_button:hover{ box-shadow: 1px 1px 5px #363024; -webkit-box-shadow: 1px 1px 5px #363024; -moz-box-shadow: 1px 1px 5px #363024; position:relative; top:7px; margin: 0; } This is my html: BoilerPlate of my Mansion This is fiddle for my work: http://jsfiddle.net/veniarya/ygosqouh/ The button functions exactly like I want it to be, but does not link to hyperlink when clicked. Please let me know if I am missing on something or need to add something. Thanks.
has comment: http://stackoverflow.com/comment/45647075
has comment: http://stackoverflow.com/comment/45647552
has comment: http://stackoverflow.com/comment/45647096
has title: I made a image look like a clickable button, but now when I click on it, does not act as hyperlink?
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45754457
comment on: http://stackoverflow.com/q/28732397
has text: You must understand if you share example.com/foo and then later change the og-tags everyone that shared that url will have the data updated. So keep unique data per url
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45655982
score: 1
comment on: http://stackoverflow.com/q/28681480
has text: reconfigure your htaccess so any non asset or api requests are pointed to app entry point
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45699231
type: Comment
has text: you have to include jQuery in the header or footer if you want to use it.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28690189

http://stackoverflow.com/a/28729370
downvote count: 0
type: Answer
has body: As neither the ES5 nor the ES6 spec uses the word "deprecated" anywhere, that leads me to believe that none of the methods are deprecated. Whether they should be is an entirely different matter... They may produce tags that have been deprecated by the working group in charge of HTML or the DOM API, but the ECMAScript spec does not seem to recognize (or at least use) the concept of deprecated methods or classes. Javascript in general doesn't have a concept of deprecation, even within the language, as discussed in this question. Some language features largely considered ambiguous or poor practice, such as the with statement, are not marked as "deprecated" in any official reference I can find. Methods like unescape are marked as deprecated in their MDN docs, but not the spec.
upvote count: 3
answers question: http://stackoverflow.com/q/28729085
score: 3

http://stackoverflow.com/comment/45615217
score: 0
type: Comment
type: QuestionComment
has text: its an input feld with an id with user
comment on: http://stackoverflow.com/q/28659854

http://stackoverflow.com/q/28704835
has answer: http://stackoverflow.com/a/28705384
type: Question
has body: I am not able to call the Java function inside JavaScript. I guess ,I am doing it wrong when I am passing paramters like Var to a string method. Please give me your suggestions. function calculateTotalAmount() { var formFldAreaCode = eval("document.AccountsSummaryListing.&lt;%=SWPAppConstants.AREA_CODE%&gt;"); alert("area code "+formFldAreaCode.value); var formFldExchange = eval("document.AccountsSummaryListing.&lt;%=SWPAppConstants.EXCHANGE%&gt;"); alert("formFldExchange "+formFldExchange.value); var formFldConnector = eval("document.AccountsSummaryListing.&lt;%=SWPAppConstants.CONNECTOR%&gt;"); alert("formFldConnector code "+formFldConnector.value); var formFldConnectorSuffix = eval("document.AccountsSummaryListing.&lt;%=SWPAppConstants.CONNECTOR_SUFFIX%&gt;"); alert("formFldConnectorSuffix code "+formFldConnectorSuffix.value); //getting error here var installmentAmount = '&lt;%=smPage.getFreeDomTerminationFee(formFldAreaCode.value,formFldExchange.value,"'formFldConnector.value,formFldConnectorSuffix.value)%&gt;'; alert("Alert "+installmentAmount); } Java Method() public String getFreeDomTerminationFee(String areaCode,String exchange,String connector,String suffix) throws Exception { System.out.println("Ramesh areaCode "+areaCode); m_logMgr.logMessage(LogManager.LOG_EVENT,"AccountsSummaryListing "+areaCode+"exchange "+exchange+"connector "+connector+" suffix "+suffix, m_FTCuserContext.getCurrentUserId(), 10, 1); /* Connection origConn = m_bussContext.getConnection(); Connection sosConn = getSOSConnection(); m_bussContext.setConnection(sosConn);*/ FreedomPlnManager frdmPlnMngr = new FreedomPlnManager(this.m_bussContext, this.m_FTCuserContext); String installmentAmount = "0"; FreedomPlnDS freedomPlnDS = frdmPlnMngr.getFreedomPlanDetails(areaCode,exchange ,connector ,suffix); //m_bussContext.setConnection(origConn); if(freedomPlnDS!= null){ installmentAmount = freedomPlnDS.getInstallmentAmount(); } m_logMgr.logMessage(LogManager.LOG_EVENT,"AccountsSummaryListing:etfV…
answer count: 1
has title: How to pass a string parameter to a Java method in a JavaScript function
tagged with: jsp
tagged with: javascript
score: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/45733181
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28723210
type: Comment
has text: geez, of course! I read that in the docs and did it correctly with `site-name`. Thanks!

http://stackoverflow.com/comment/45909635
comment on: http://stackoverflow.com/a/28755681
type: Comment
score: 0
type: AnswerComment
has text: Thanks again! Really strange - I used the correct id (which is the profile ID) before changing it to "UA - xxxx" - and now just changed back to the correct id. Still, it doesn't work. Could you do my a great favor and post (part) of your code here? I have no clue why the chart isn't rendered since my code above seems correct (as you said, too). Many thanks again for your help!

source-maps
type: Tag
tag name: source-maps
tags question: http://stackoverflow.com/q/28736022

http://stackoverflow.com/q/28718114
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45723203
upvote count: 3
has title: JQuery AJAX HTML response in error function
answer count: 1
has body: var id = 45; $.ajax({ url :'url', // This URL response some HTML content type: 'POST', dataType: 'json', data :{ID:id}, success:function(data) { console.log(data); // No Response here }, error : function (error){ console.log(error); // error.responseText contain html content } }); I render HTML content by JQuery AJAX. The HTML response comes from error function instead of success function. is any mistake from my side?
has comment: http://stackoverflow.com/comment/45723231
has answer: http://stackoverflow.com/a/28718212
has comment: http://stackoverflow.com/comment/45723183
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
type: Question
accepted answer: http://stackoverflow.com/a/28718212
score: 3

http://stackoverflow.com/q/28702184
type: Question
has title: instagram API 'Access-Control-Allow-Origin' issue
tagged with: javascript
score: 0
tagged with: jquery
tagged with: html-framework-7
tagged with: instagram-api
type: UnansweredQuestion
tagged with: curl
answer count: 0
has comment: http://stackoverflow.com/comment/45696340
has comment: http://stackoverflow.com/comment/45694467
has body: I have been searching a loooot for some good answers and havent been so lucky. I will explain for you my issue. I have made an web-app API with Instagram and it works fine. But then I wanted to take it further and started making an "ios app" with it based on the Framework7. But now I have an issue that I havent been able to solve and I dont know what to do. The problem is that when I get a response from instagram it works, but when I want to click on a link or picture that comes from instagram I have an issue. And the issue is this: ---> XMLHttpRequest cannot load https... No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http...' is therefore not allowed access. I have been searching I have found some things like cURL and then that Instagram has something called "X-Insta-Forwarded-For header". My app is made on javascript/jquery. Please help me. I know I havent give you enough information but tell me what you might need so I can give you that and help me out to get through this issue that is huge pain. Thanks in advance!

http://stackoverflow.com/a/28611193
has comment: http://stackoverflow.com/comment/45526152
has comment: http://stackoverflow.com/comment/45526125
has comment: http://stackoverflow.com/comment/45526239
has body: I would use Function.prototype.bind which allows to pass additional parameters: jQuery("#target").click(onTargetClick.bind(null, "myCoolParam"));
downvote count: 0
has comment: http://stackoverflow.com/comment/45526338
answers question: http://stackoverflow.com/q/28611122
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/q/28699267
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: appear image selecte div one by one
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: UnansweredQuestion
downvote count: 1
has answer: http://stackoverflow.com/a/28755269
type: Question
has body: I have InsertProduct.aspx page that user can upload 6 image in this page for their product... I want at first in page be 1 div that I define on it fileupload control when users click on Selectimage they can upload their first image when they upload their first image then appear second DIV that they can upload their second image when they upload second image third div will appear and they can select third image it will goes up to 6 image users can upload 6 image and they can delete their uploaded image... how I can do it? Best regards Neda
score: -1

http://stackoverflow.com/q/28634618
has comment: http://stackoverflow.com/comment/45569165
tagged with: css
type: AnsweredQuestion
score: 2
downvote count: 0
type: Question
possible better answer: http://stackoverflow.com/a/28634663
accepted answer: http://stackoverflow.com/a/28634651
tagged with: javascript
tagged with: jquery
upvote count: 2
answer count: 2
has body: In a Sharepoint site I need to hide a dropdown list that appears on the ribbon, the following code does not throw any error but the dropdown is not hidden, I also tried .hide A screenshot: http://screencast.com/t/c8JXLH03 My code: $( document ).ready(function() { $("span#Ribbon.Tabs.InfoPathListTab.Views.ddViews-Medium").css('display', 'none'); }); The html generated of that elemnt. Nuevo Vistas
has answer: http://stackoverflow.com/a/28634651
tagged with: http://stackoverflow.com/tag/html
has title: Hiding dropdown with jquery is not working
favorite count: 0
has answer: http://stackoverflow.com/a/28634663

http://stackoverflow.com/a/28896096
has body: I took a look on Turbolinks, and it does what I thought it did: It loads the HTML content of a link inside a container on the main page. Problem is, anything it loads is agnostic of whatever events and functions you have declared when the main page loaded, so indeed, after the first click, the selector on the HTML it has just loaded won't have the click event attributed to it (it was not on the DOM when you did the binding). Possible solution: I did a little research on the .live() method, but is has been deprecated, so I recommend doing something like this: $('body').on('click','a.saveButton', saveHandler) Binding closer to the element you need will, it seems, will assure that whatever Turbolinks loads inside the body will get the bindings you have declared. There is a more detailed answer here: Javascript event binding persistence The documentation for the .live hook is here: http://api.jquery.com/live/#typefn I used to have the same architecture on my web pages back in the day, and I did run on a problem similar to yours. Hope it helps.
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28619731
upvote count: 1

http://stackoverflow.com/a/28619178
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28617606
type: Answer
has body: I changed your javascript to the following. It may not work exactly how you'd like. Currently it continues to average all values passed changeText. For example, if you select "Hat" and keep on changing your mind on whether you're a beginner of intermediate, the average keeps moving closer to 0.7 since it starts off averaging just {0.67, 0.7} but then starts averaging {0.67, 0.7, 0.7, 0.7, ... } the more times you click around. var aggregate = 0; var times = 0; function changeText(value) { aggregate += value; times++; if (times == 0) { document.getElementById('count').value = 1 * value; } else { document.getElementById('count').value = aggregate / times; } } The basic key point is that you'll need to keep track of what was passed to you. You could change it, for example, to just store the previous value instead of accumulating an aggregate and always divide by 2 to just get the average of the last two values. var previousValue = null; function changeText(value) { if (!previousValue) document.getElementById('count').value = 1 * value; else document.getElementById('count').value = (previousValue + value) / 2; previousValue = value; } Depending on what you want, you may need to write two functions, one to report the value associated with the level and one associated with the equipment (maybe call them ReportGearRisk() and ReportAbilityRisk()). Each one could store the value provided into separate fields (maybe gearRisk and abilityRisk) and call another function (maybe UpdateUI()) that would check those fields and decide how to update the UI.
score: 0
answers question: http://stackoverflow.com/q/28617606

http://stackoverflow.com/comment/45576671
type: QuestionComment
comment on: http://stackoverflow.com/q/28638566
score: 1
has text: what do you mean by 'array name'?
type: Comment

http://stackoverflow.com/comment/45676425
score: 0
type: AnswerComment
has text: No worries, I finally got it! Needed to add 'return false` right after the ajax call. Thanks for sticking it out with me.
comment on: http://stackoverflow.com/a/28690987
type: Comment

http://stackoverflow.com/a/28629411
upvote count: 1
has comment: http://stackoverflow.com/comment/45564712
answers question: http://stackoverflow.com/q/28629230
score: 1
downvote count: 0
type: Answer
has body: try this http://jsfiddle.net/wTMv3/695/ messages object was overriding attachment message, I removed it messages: { message_new: "enter message", name_new: "enter name", email_new: "enter email", phone_new: "enter phone" }

http://stackoverflow.com/comment/45772100
comment on: http://stackoverflow.com/q/28744541
has text: I need a solution that includes a taphold, I don't care if it is jQuery or pure Javascript ;) I'm working on a project that has to prevent from people touching the screen (tapping) and executing a function. So the taphold would prevent this, except for the fact it is acting like a single tap at this moment.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28705031
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28704727
accepted answer of: http://stackoverflow.com/q/28704727
type: Answer
score: 3
upvote count: 3
has body: The problem is that you rely on result of css("border") while it's not what you expect: e.g. Chrome will retrieve border styles as "4px solid rgb(128, 128, 128)". Instead set CSS class selected and check if the card has this class or not: $(".card").click(function () { if ($(this).hasClass('selected')) { var cardname = $(this).attr('src'); $(".picks").append(cardname); if (pick &lt; 15) { pick++; } else { booster++; pick = 1; } } else { $(this).addClass('selected'); } }); Demo: http://jsfiddle.net/1o7tgs5j/13/ In general as the rule of thumb, avoid using $.fn.css method for styling, not only this is very obtrusive but also error prone approach. In most cases usage of addClass/removeClass brings much more flexibility.

http://stackoverflow.com/q/28648468
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45594615
has comment: http://stackoverflow.com/comment/45595475
has comment: http://stackoverflow.com/comment/45595794
has comment: http://stackoverflow.com/comment/45594718
has comment: http://stackoverflow.com/comment/45594616
has comment: http://stackoverflow.com/comment/45594780
has comment: http://stackoverflow.com/comment/45594623
has comment: http://stackoverflow.com/comment/45594675
favorite count: 0
has comment: http://stackoverflow.com/comment/45594626
has comment: http://stackoverflow.com/comment/45594773
upvote count: 2
has comment: http://stackoverflow.com/comment/45594563
has comment: http://stackoverflow.com/comment/45595077
has comment: http://stackoverflow.com/comment/45596086
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45594998
has comment: http://stackoverflow.com/comment/45595707
has comment: http://stackoverflow.com/comment/45594842
has title: jQuery context is undefined
has comment: http://stackoverflow.com/comment/45594546
answer count: 0
has body: I'm new to JQuery and this error is beyond me. I upgraded from JQuery 1.2 to 1.11 and am now getting "context is undefined" errors. I read that using createElement may be the cause of this. In the portion of the code that has stopped working after the upgrade, I have $(document.createElement('tr')). Is there another way to write this so that these errors will stop? I have tried: $("tr")... but the element is no longer where it needs to be on the page. How do I resolve this? EDIT: $myElement = $(document.createElement('tr')) .addClass('jqgrow') .attr('_boggy_call', this) .click( function( ) { boggy.editCall($this); }) .append ( $(document.createElement('td')).text($myProperties.CallNo) ) .append ( $(document.createElement('td')).text($myProperties.ClientAddress) ) .append ( $(document.createElement('td')) .text ( boggy.UtilityValues.CallTypes[$myProperties.CodeId] ) ) .append ( $(document.createElement('td')) .text ( boggy.UtilityValues.Dispositions[$myProperties.DispoId] ) ) .appendTo('#openAir-content tbody')
has comment: http://stackoverflow.com/comment/45594527
has comment: http://stackoverflow.com/comment/45596220
type: Question
score: 2
has comment: http://stackoverflow.com/comment/45594778
has comment: http://stackoverflow.com/comment/45596027

http://stackoverflow.com/comment/45649186
has text: @FelixKling overlooked the `+=` it's gone now.
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28677903

http://stackoverflow.com/q/28670350
has comment: http://stackoverflow.com/comment/45635378
tagged with: javascript
has comment: http://stackoverflow.com/comment/45634714
has comment: http://stackoverflow.com/comment/45635586
score: 0
answer count: 2
has title: If Statement Only Executing Else Part
has body: I have a simple program that validates a sign up form. Basically I reach a problem when one of my "if" statements can only execute the "else" part. If I change the form so that "if" is executed, nothing happens. Below is my code: function verifyprocedure() { var originalpassword = document.getElementById("password").value; var checkpassword = document.getElementById("verifypassword").value; var emailcheck = document.getElementById("email").value; var male = document.getElementById("gendermale"); var female = document.getElementById("genderfemale"); var form = document.getElementById("signup"); var emailexist = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; if (originalpassword == checkpassword) { if (originalpassword.length &lt; 9) { if (emailexist.test(emailcheck)) //this is the statement that does not work { alert("Hello World!"); //this is whats supposed to be executed } else { //this is successfully executed $("#email").notify("Please enter a valid email address."); } } else { $("#password").notify("Passwords must have at least 9 characters."); } } else { $("#verifypassword").notify("Passwords do not match."); } }
has comment: http://stackoverflow.com/comment/45635424
type: UnansweredQuestion
tagged with: regex
has answer: http://stackoverflow.com/a/28670730
has answer: http://stackoverflow.com/a/28670557
has comment: http://stackoverflow.com/comment/45634700
type: Question
tagged with: if-statement

http://stackoverflow.com/comment/45519813
score: 0
type: AnswerComment
has text: thank you sir i got answer..
type: Comment
comment on: http://stackoverflow.com/a/28607747

http://stackoverflow.com/q/28732214
has comment: http://stackoverflow.com/comment/45750739
type: Question
has title: Duplicate image when hovering with jQuery
has comment: http://stackoverflow.com/comment/45750814
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: image
has answer: http://stackoverflow.com/a/28732565
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45750345
has comment: http://stackoverflow.com/comment/45751156
favorite count: 0
has comment: http://stackoverflow.com/comment/45751302
has body: what I want to achieve is that when the cursor is hovering over an image (img), this image gets displayed a second time at mouse position. It should disappear when the mouse leaves the original image. And it should work with multiple images on the page. For this I've written the following page: Unfortunately, the result in Chrome is that the cloned image "blinks" for some reason. It appears and disappears about once per second. Any clue what's wrong? Big thanks in advance! EDIT: Think I've found out the cause: When the image is being cloned, it is placed right under the cursor, therefore this apparently means for the browser that the mouse is not hovering over the original image anymore and therefore triggers the mouseout event! Is there a way to make an object invisible for the mouse(-events)?
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/45750578
score: 1
linked to: http://stackoverflow.com/q/18813299
has comment: http://stackoverflow.com/comment/45751046

http://stackoverflow.com/q/28658927
favorite count: 0
accepted answer: http://stackoverflow.com/a/28674485
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45622431
type: AnsweredQuestion
has title: The scroll detection doesn't work after calling a new page Javascript
has comment: http://stackoverflow.com/comment/45622458
upvote count: 2
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45635893
has comment: http://stackoverflow.com/comment/45613647
has body: I'm developing an app using phonegap , everything work fine except the scroll detection! it works fine until I move to another page using the jQueryMobile data transition , after that it doesn't work at all though everything else work just fine! here's the code that I use for the scroll detection // to check if I reached the bottom of the slide if($(window).scrollTop() + $(window).height() == $(document).height()) { // my code goes here } // to check if I'm at the top of the slide if(document.body.scrollTop == 0 ) { // my code goes here }
has answer: http://stackoverflow.com/a/28674485
has comment: http://stackoverflow.com/comment/45613816
answer count: 2
possible better answer: http://stackoverflow.com/a/28661519
tagged with: jquery-mobile
has answer: http://stackoverflow.com/a/28661519
tagged with: javascript
tagged with: jquery
score: 1

http://stackoverflow.com/a/28696895
score: 4
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45695759
answers question: http://stackoverflow.com/q/28696744
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/45693897
accepted answer of: http://stackoverflow.com/q/28696744
downvote count: 0
has body: Preamble: Yours is called a function declaration. His is called a named function expression (NFE). These are discussed in some detail in this question and its answers, but addressing your specific questions: ...he says it's best practice according to airbnb... If he's talking about these Airbnb style guidelines, I don't see anything there to support that claim. I do see a couple of things you could misread that way, but it would be misreading. It says not to declare functions inside control flow blocks, e.g.: // bad if (currentUser) { function test() { console.log('Nope.'); } } And that's quite true, that's not just bad, it's invalid according to the current specification. You can only declare functions at the top level of a scope (e.g., at global scope outside of all control flow structures like if, while, for, and so on; or at the top level of a function outside of all control flow structures). The example above is invalid because it's within the block connected to the if. (In ES6, for web engines only, it's tolerated in a very specific subset of situations&nbsp;&mdash; TL;DR: Don't do it.) But that's not a blanket "don't use function declations," not remotely. What is the fundamental/practical difference between the two? Your form is processed upon entry to the scope in which the function is declared, before any step-by-step code is executed (sometimes this is called "hoisting"). His form is executed later, when the function expression is encountered in the step-by-step execution of the code. Is there danger of him breaking my code by doing this? Yes, this working code: foo(); function foo() { // ... } ...would break if rewritten as: foo(); // &lt;== Fails var foo = function foo() { // ... } ...because the function declaration hoisting is gone (var hoisting is still there), so the foo variable has the value undefined when you try to call it. Separately, some browsers get NFEs wrong, creating two functions instead of one. IE8 does, for instance, as did older versi…
has comment: http://stackoverflow.com/comment/45684342

http://stackoverflow.com/q/28636830
has answer: http://stackoverflow.com/a/28637049
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28637049
has comment: http://stackoverflow.com/comment/45573354
has title: How can I check if two keys are pressed at once?
type: AnsweredQuestion
tagged with: hotkeys
score: 0
has body: window.onkeydown = function(e) { //enter key adds a task var code = e.keyCode || e.which; if(code === 13) { var taskName = document.getElementById("task_name").value; var dueDate = document.getElementById("due_date").value; $("#list").append("&lt;div class='task'&gt;" + taskName + "&lt;textarea class='note_input' placeholder='Notes' rows='2'&gt;&lt;/textarea&gt;" + "&lt;br&gt;" + "&lt;div class='due'&gt;" + "Due: " + dueDate + "&lt;/div&gt;" + "&lt;/div&gt;"); $("h1").effect("pulsate", 1000); } //checking if alt and c keys are both pressed var clearKeys = { alt: false, c: false, }; if (code === 18) { clearKeys.alt = true; } else if (code === 67) { clearKeys.c = true; } if (clearKeys.alt === true &amp;&amp; clearKeys.c === true) { $(".task").fadeOut("slow"); } //resetting the values of clearKeys.alt and clearKeys.c window.onkeyup = function(e) { var code = e.keyCode || e.which; if (code === 18) { clearKeys.alt = false; } else if (code === 67) { clearKeys.c = false; } }; }; I made this project in JS Bin. You can check it out here. When I press the enter key, it works fine. But when I want to clear the list (alt + c) it won't work. The code looks fine to me, and the editor didn't show any errors, so I can't figure out where went wrong.
type: Question

http://stackoverflow.com/comment/45589899
has text: Okay, but how do I do that for multiple images? Sorry if this is a very n00b question but I don't know much about js... would you mind editing the jsfiddle so I can see how that works? thanks!
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28645952

http://stackoverflow.com/comment/45712707
type: AnswerComment
type: Comment
has text: Add paddingtop and padding bottom to td.. It will imcrease the height
comment on: http://stackoverflow.com/a/28696728
score: 0

c#-3.0
type: Tag
tag name: c#-3.0
tags question: http://stackoverflow.com/q/28599512

http://stackoverflow.com/comment/101394498
comment on: http://stackoverflow.com/a/28713146
type: AnswerComment
score: 0
type: Comment
has text: Until Js get some new functions to do this quickly, this is the fastest way in which you can do it.

http://stackoverflow.com/q/28722238
has comment: http://stackoverflow.com/comment/45732686
has answer: http://stackoverflow.com/a/28722624
tagged with: greasemonkey
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45735318
has comment: http://stackoverflow.com/comment/45731165
has title: How to find out parameters of a native Javascript function
type: UnansweredQuestion
has body: I want a generic way to find out the required parameters by a any javascript function including natives ones, but I'm unable to find one. I've seen this stackoverflow link, but it works only for functions that we define. toString() doesn't tell us about the function parameters of native functions like window.setTimeout() : How to get function parameter names/values dynamically from javascript I'm specifically interested in the GreaseMonkey methods like GM_setValue etc. , which behave similarly and don't show there parameters when used with toString() (I want to validate that a method passed to me has two parameters)
linked to: http://stackoverflow.com/q/1007981
type: Question
score: 0

http://stackoverflow.com/comment/45494189
type: QuestionComment
comment on: http://stackoverflow.com/q/28593750
has text: is your javascript in the same domain as `www.socialorra.com`? If not you are violating the same-origin policy which will not let you get data from another domain (unless it uses cors). You will need to do the same thing facebook and other sites do, let a server side script scrape the page and return it
score: 1
type: Comment

http://stackoverflow.com/comment/45752070
score: 0
type: AnswerComment
has text: it doesn't do the Linux Service itself but this is helpful
type: Comment
comment on: http://stackoverflow.com/a/28696974

http://stackoverflow.com/a/28675211
has comment: http://stackoverflow.com/comment/45661677
has comment: http://stackoverflow.com/comment/45661876
has comment: http://stackoverflow.com/comment/45653251
has comment: http://stackoverflow.com/comment/45720173
has comment: http://stackoverflow.com/comment/45653941
downvote count: 0
has comment: http://stackoverflow.com/comment/45697812
type: Answer
has comment: http://stackoverflow.com/comment/45678497
answers question: http://stackoverflow.com/q/28675016
score: 1
has comment: http://stackoverflow.com/comment/45663630
upvote count: 1
has body: adding verticalAlign: 'top' fixes the issue dataLabels: { enabled: true, color: 'white', verticalAlign: 'top' } fiddle amended http://jsfiddle.net/cbf74c1d/2/
has comment: http://stackoverflow.com/comment/45658878

http://stackoverflow.com/q/28635398
has comment: http://stackoverflow.com/comment/45572205
upvote count: 2
answer count: 2
tagged with: css
has answer: http://stackoverflow.com/a/28636171
has comment: http://stackoverflow.com/comment/45571982
score: 2
downvote count: 0
tagged with: ios
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has body: I have a modal that uses jQuery to popup on (document).ready. $(document).ready(function() { $("#openModal").toggleClass("target"); }); $(window).one( "click", function() { $( "#openModal" ).toggleClass("target"); }); It works fine on desktop, but on iOS Safari it doesn't close on tap. I read about the cursor:pointer fix, but it doesn't want to work in this scenario. I'm guessing this is because the event is binded to the window while the cursor is binded to the element. And I obviously can't put body{cursor:pointer;} What could this be caused by ?
has title: jQuery window.one("click") Not Working on Mobile
linked to: http://stackoverflow.com/q/3025348
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28643815

http://stackoverflow.com/comment/45643365
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28674946
has text: you should request that on your backend server. it wouldn't be very safe for the browser to do it alone.
score: 0

http://stackoverflow.com/a/60679178
has comment: http://stackoverflow.com/comment/107357012
has body: strip_tags() function may help. For example: $str = 'index.php?id= '; echo " "; echo strip_tags($str), "\n"; The above will output: index.php?id=alert(1)
type: Answer
answers question: http://stackoverflow.com/q/28610732
score: 0

http://stackoverflow.com/q/28691760
has answer: http://stackoverflow.com/a/28692381
type: AnsweredQuestion
downvote count: 0
has title: How to install extension directly without visiting chrome store
tagged with: google-chrome
has body: I have an extension https://chrome.google.com/webstore/detail/myextenstion/lkdklkkflkfedlbfpl like this. i created a menu item on my website like Click here to Download Extesnion which is working fine' Now i want user just click and extension popup appear directly . Any idea ? Thanks
has comment: http://stackoverflow.com/comment/45675783
type: Question
score: 3
tagged with: javascript
upvote count: 3
answer count: 1
linked to: http://stackoverflow.com/q/7936277
accepted answer: http://stackoverflow.com/a/28692381
favorite count: 0

http://stackoverflow.com/a/28726881
upvote count: 4
has comment: http://stackoverflow.com/comment/72846275
has body: It's weird that it's expecting a promise only and could not handle a webdriver element... I had the same HUGE stacktrace as you. Anyway, would you accept this kind of solution: send a "dumb" promise with a nice comment to justify why you had to do that. It's more a workaround than a semantic solution I admit. expect(page.element.getInnerHtml()) .toEqual(browser.driver.switchTo().activeElement().getInnerHtml()); It's working for me ;) EDIT: Bonus answer The reason you can't call expect with a WebElement comes from the Webdriver Control Flow Principle (I'm sure you already know about) and this line in jasminewd, the adapter for jasmine to Webdriver developped and used by Protractor ;)
has comment: http://stackoverflow.com/comment/78472993
has comment: http://stackoverflow.com/comment/45740719
has comment: http://stackoverflow.com/comment/45813721
type: Answer
has comment: http://stackoverflow.com/comment/45787331
has comment: http://stackoverflow.com/comment/45740229
has comment: http://stackoverflow.com/comment/45776664
has comment: http://stackoverflow.com/comment/45778688
has comment: http://stackoverflow.com/comment/45773788
answers question: http://stackoverflow.com/q/28679364
downvote count: 1
has comment: http://stackoverflow.com/comment/45765402
has comment: http://stackoverflow.com/comment/45773887
score: 3

http://stackoverflow.com/a/28675939
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/94735760
type: Answer
has comment: http://stackoverflow.com/comment/95100217
accepted answer of: http://stackoverflow.com/q/28631520
has body: After seaching I found that to unbind events attached with .live() the proper way is using .die() Here is the documentation: http://api.jquery.com/die/ It solved my problem.
answers question: http://stackoverflow.com/q/28631520
score: 0

http://stackoverflow.com/q/28710210
has title: Conditional Statements II
tagged with: conditional-statements
tagged with: if-statement
tagged with: java
has comment: http://stackoverflow.com/comment/45709465
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28710301
upvote count: 0
tagged with: javascript
has body: Those are the fields that I have that I want to write a conditional statement for in a PDF form that I am creating in Adobe Acrobat Pro X. In the form if I tick the checkbox I would like FP1 to get the value from QxHxW1. If the checkbox is not ticked I want FP1 to register as "0". I have been trying to do this with different tutorials that I have found online and each time I get some sort of SyntaxError. is there anything I can do to fix this? Am I way off with the way that this is written? FrenchPane1 is a checkbox FP1 is a text box QxHxW1 is a text box
answer count: 1
tagged with: acrobat
favorite count: 0
score: -1
type: UnansweredQuestion

http://stackoverflow.com/comment/45728354
has text: I basically need $location.path('/stuff/after/hash');, except I need to get the URL as a string -- this method causes the browser to immediately navigate to another page (because I want to put the url in an tag)
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28708428

http://stackoverflow.com/comment/45731943
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28722615
has text: So you believe that `addEventListener` only works if the element is in the document? Why? And why shouldn't that apply to `onclick` as well?

http://stackoverflow.com/comment/45735882
type: Comment
has text: If I use var frame = document.getelementbyID("myframe"); then var body = window.document.frames("myframe").document.body; \\ getting undefined
comment on: http://stackoverflow.com/a/28724502
score: 0
type: AnswerComment

http://stackoverflow.com/a/28636180
answers question: http://stackoverflow.com/q/28636004
score: 0
has body: If you don't want to use the class to target the element, then slightly change the select: $("#mydiv").find("table div&gt;tr&gt;td&gt;font").html()
type: Answer

http://stackoverflow.com/q/28694026
has comment: http://stackoverflow.com/comment/45679187
has body: Here is my index.php: &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Voting Page&lt;/title&gt; &lt;script type="text/javascript" src="js/jquery-1.9.0.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { //####### on page load, retrive votes for each content $.each( $('.voting_wrapper'), function(){ //retrive unique id from this voting_wrapper element var unique_id = $(this).attr("id"); //prepare post content post_data = {'unique_id':unique_id, 'vote':'fetch'}; //send our data to "vote_process.php" using jQuery $.post() $.post('vote_process.php', post_data, function(response) { //retrive votes from server, replace each vote count text $('#'+unique_id+' .up_votes').text(response.vote_up +' user has voted'); },'json'); }); //####### on button click, get user vote and send it to vote_process.php using jQuery $.post(). $(".voting_wrapper .voting_btn").click(function (e) { //get class name (down_button / up_button) of clicked element var clicked_button = $(this).children().attr('class'); //get unique ID from voted parent element var unique_id = $(this).parent().attr("id"); if(clicked_button==='up_button') //user liked the content { //prepare post content post_data = {'unique_id':unique_id, 'vote':'up'}; //send our data to "vote_process.php" using jQuery $.post() $.post('vote_process.php', post_data, function(data) { //replace vote up count text with new values $('#'+unique_id+' .up_votes').text(data); //thank user for liking the content dataModified = data+' users has voting including you'; $('#message-status').hide().html(dataModified).fadeIn('slow').delay(5000).hide(1); }).fail(function(err) { //alert user about the HTTP server error alert(err.statusText); }); } }); //end }); &lt;/script&gt; &lt;style type="text/css"&gt; &lt;!-- .content_wrapper{width:500px;margin-right:auto;margin-left:auto;} h3{color: #979797;border-bottom: 1px dotted #D…
favorite count: 0
has comment: http://stackoverflow.com/comment/45678883
type: UnansweredQuestion
upvote count: 1
tagged with: php
has answer: http://stackoverflow.com/a/28694143
has comment: http://stackoverflow.com/comment/45678888
has answer: http://stackoverflow.com/a/28694129
has answer: http://stackoverflow.com/a/28694738
score: 1
has comment: http://stackoverflow.com/comment/45678972
type: Question
linked to: http://stackoverflow.com/q/20105029
has title: How to include php file into my html file?
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 3
linked to: http://stackoverflow.com/q/11312316
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45512217
score: 0
comment on: http://stackoverflow.com/a/28602223
type: AnswerComment
type: Comment
has text: I try it, but does not help anything. Details description https://github.com/Swiip/generator-gulp-angular/issues/364#issuecomment-75015636

http://stackoverflow.com/comment/91849294
type: AnswerComment
comment on: http://stackoverflow.com/a/29085111
has text: This answer needs an edit: "callbacks: " needs to be a js object, so requires some curly braces. e.g.: callbacks: { beforeInsert: function(....){...} };
type: Comment
score: 1

http://stackoverflow.com/comment/90354859
has text: Note: Node.js allows for [os] system uptime as well `os.uptime()`
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28706630

http://stackoverflow.com/comment/45625305
type: AnswerComment
has text: @UncleSlug In the console, don't use `console.log(translate2(..))`, try simply `translate2(..)`. The `console.log` function call doesn't return anything, so `undefined` will be returned by default. That is why you are getting an extra `undefined` in the console.
comment on: http://stackoverflow.com/a/28665179
type: Comment
score: 0

http://stackoverflow.com/comment/45513997
score: 0
comment on: http://stackoverflow.com/q/28604238
type: Comment
type: QuestionComment
has text: The smallest is 512MB I guess, I couldn't find a way to make it less.

http://stackoverflow.com/q/28682790
tagged with: angularjs
has answer: http://stackoverflow.com/a/28682877
accepted answer: http://stackoverflow.com/a/28682877
has answer: http://stackoverflow.com/a/28682939
answer count: 4
has body: I 'm a bit worried If I am asking a noob question or if it is a javascript feature that I haven't been able to locate despite plenty of googling I am adding a simple directive programmatically using $compile and all is working fine. My question is this line var el = $compile(newElement)($scope); How do the double parenthesis work/ what do they do? Complete code below for reference but its just the parenthesis which I am not sure about. var myApp = angular.module('myApp', []); myApp.directive('myDirective', function() { return { template: 'Hello', restrict: 'E' } }); myApp.controller('mainController', [ '$scope', '$compile', function($scope, $compile) { $scope.addDirective = function() { var newElement = angular.element(document.createElement('my-directive')); var el = $compile(newElement)($scope); angular.element(document.body).append(el); }; } ]);
type: AnsweredQuestion
has title: What is angularjs $compile double parenthesis
score: 1
type: Question
possible better answer: http://stackoverflow.com/a/28682882
tagged with: javascript
has comment: http://stackoverflow.com/comment/45658489
upvote count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28682976
favorite count: 0
has answer: http://stackoverflow.com/a/28682882

http://stackoverflow.com/comment/45516473
score: 0
has text: Can we see your fnAddData function and your SQL?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28605806

http://stackoverflow.com/q/28639951
has answer: http://stackoverflow.com/a/28640044
has title: Passing Javascript Parameters and Assigning to Variables
type: Question
has comment: http://stackoverflow.com/comment/45579326
downvote count: 4
answer count: 1
tagged with: javascript
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: i want to pass one function generated value to another function. example : function mainFunc(){ var x = 1; } function doMatch(){ var tot = x + 1; } only if doMath() Function calls it will calculate total. it shouldn't call mainFunc() Again. not like this function mainFunc(){ var x = 1; return x; } function doMatch(){ var tot = mainFunc() + 1; } How can i do this. i think if we can make it global variable after it generated from the mainFunc() then every other function can access it. we cant edit global variable value from function right?
score: -3
upvote count: 1

http://stackoverflow.com/comment/45745783
type: QuestionComment
comment on: http://stackoverflow.com/q/28728162
has text: I'd rather avoid the use of an interval, as suggested in the answer, seeing as it can get off sync if the machine is slow or if the page is blurred
score: 0
type: Comment

http://stackoverflow.com/a/28684828
has comment: http://stackoverflow.com/comment/45666482
answers question: http://stackoverflow.com/q/28683818
has comment: http://stackoverflow.com/comment/45687024
has comment: http://stackoverflow.com/comment/45687275
upvote count: 1
has body: The browser leaves the page before the tracking hit actually fires. You need to delay the form submission slightly to account for this: jQuery.noConflict(); (function( $ ) { $('form').on('submit', function(evt) { evt.preventDefault(); if (formIsValid) { try{ __pixel({"name": "tracker"}); } catch (err) {} var form = this; setTimeout(function() { form.submit(); }, 50); } }); })(jQuery);
score: 1
has comment: http://stackoverflow.com/comment/45688342
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45687125
accepted answer of: http://stackoverflow.com/q/28683818
type: Answer

http://stackoverflow.com/comment/45729922
has text: please have a look below, i posted it in an answer
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28719691

http://stackoverflow.com/comment/45553239
type: AnswerComment
has text: All this is doing is making an ajax call and immediately redirecting - what would be the point?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28626177

http://stackoverflow.com/comment/132877375
type: Comment
comment on: http://stackoverflow.com/a/75295691
has text: As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
score: 0
type: AnswerComment

http://stackoverflow.com/q/28742292
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28742403
has body: I am trying to receive the URL of a mpeg live stream. Because the url of streams might change, but a site rarely does, I am using onResourceReceived to listen for the url of the stream. So far, I have not been getting anything (not even errors). Here is my code: var page = require('webpage').create(), system = require('system'), address; if (system.args.length === 1) { console.log('Usage: netlog.js &lt;some URL&gt;'); phantom.exit(1); } else { address = system.args[1]; page.onResourceRequested = function (req) { console.log('requested: ' + JSON.stringify(req, undefined, 4)); }; page.onConsoleMessage = function(msg) { system.stdout.writeLine('console: ' + msg); }; page.onResourceReceived = function (res) { console.log('received: ' + JSON.stringify(res, undefined, 4)); }; page.open(address, function (status) { if (status !== 'success') { console.log('FAIL to load the address'); } var radio = page.evaluate(function() { return document.getElementById('button_playpause'); }); console.log('Radio variable: '); console.log(radio); console.log('Clicking button: '); $(radio).click(); phantom.exit(); }); } I adapted the code found here: http://phantomjs.org/network-monitoring.html The website I am trying this code on is the following: http://radioplayer.npo.nl/mini-player/radio4/ Why does the url not show up when PhantomJS clicks the button?
tagged with: network-monitoring
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28742403
tagged with: phantomjs
score: 0
has title: PhantomJS onResourceReceived no stream

http://stackoverflow.com/a/28717731
type: AcceptedAnswer
downvote count: 0
has body: I tried a request via Postman, using GET and (only!) the URL you provide in your code snippet: 200/OK, no flaws. Try it without 'data'. Its only supposed to be used in POST-requests, not in GET-requests! But since you need to pass along your 'within_circle' dataset, you should either consider using POST, which gives you access to usage of the data-attribute, or make a GET-request with passing your data-params inside the URL. Since I dont know the API, I cant make that choice for you.
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/28716476
has comment: http://stackoverflow.com/comment/45723709
answers question: http://stackoverflow.com/q/28716476

http://stackoverflow.com/a/28675384
accepted answer of: http://stackoverflow.com/q/28674246
type: Answer
upvote count: 4
answers question: http://stackoverflow.com/q/28674246
has body: I don't know bcrypt really well, but it appears that Twin-Bcrypt expects the salt parameter to include the full type-tag (2a/2y/2x), cost parameter, and actual cryptographic salt value. (I believe this is done to match the expectations of other libraries.) The cryptographic salt value is only the final 22 characters of the salt parameter string, which represent a 128-bit value. To actually solve your problem, you'll need to do two things: Prefix your salt with $2y$10$ so that it has a type-tag and a cost parameter. Map your PHP base64_encode result onto bcrypt's nonstandard base64 values. For reference, the values are: Standard: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ bcrypt: ./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 If you simply want to make a standard base64 into a brcypt-base64 string, you can replace all + with ., but that will result in a different value (because standard + is a 62 while . is a 0, and all of the other values are offset as well). If you want a brypt string with the same value as the original, you'll need to replace each character with its bcrypt equivalent. You may also need to eliminate trailing = from the standard string, if any exist. Extra information: Why must the salt end with [.Oeu]? A salt in bcrypt is 128 bits. Each base64 character communicates 6 bits of information. That means that 21 base64 characters can evenly communicate 126 bits. The final 2 bits must be encoded in a final 22nd character. Since that character is defined by only 2 bits, it can only have 4 possible values. When we examine the base64 character pool for brypt, we see: ./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 Counting from zero, we see that those values appear at indicies: . =&gt; 0 = 000000 O =&gt; 16 = 010000 e =&gt; 32 = 100000 u =&gt; 48 = 110000 So those final two bits are setting the high-end bits of the final character.
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/45644258
type: AcceptedAnswer

http://stackoverflow.com/q/28609312
tagged with: jquery
favorite count: 0
tagged with: regex
type: AnsweredQuestion
score: 1
upvote count: 1
has body: I have different rules for password validation. Most of them are working fine but the one for special characters is kind of tricky. The rule says: The password must contain at least one special character (from a list of special characters). I created the additional method for jquery validate to handle this but for some reason characters outside of the list are treated as valid. For example: 654321Ab/ is valid as / is an accepted special character 654321Ab/° must not be valid as ° is not a valid special character but now it is treated as correct This is my jsfiddle: http://jsfiddle.net/o6L3s14c/ My script for the additional method: $.validator.addMethod("pwcheckspechars", function (value) { return /[!@#$%^&amp;*()_=\[\]{};':"\\|,.&lt;&gt;\/?+-]/.test(value) }, "The password must contain at least one special character");
type: Question
has answer: http://stackoverflow.com/a/28609939
tagged with: javascript
has answer: http://stackoverflow.com/a/39800239
tagged with: jquery-validate
accepted answer: http://stackoverflow.com/a/28609939
answer count: 2
has title: Issue with regex for special characters in additional method jquery validate
downvote count: 0
possible better answer: http://stackoverflow.com/a/39800239

http://stackoverflow.com/comment/45744084
type: QuestionComment
has text: This is where i use a plugin. https://blueimp.github.io/jQuery-File-Upload/
score: 0
comment on: http://stackoverflow.com/q/28728724
type: Comment

http://stackoverflow.com/comment/45554020
has text: If you open your console, you will notice that jQuery is not found on the second page.
comment on: http://stackoverflow.com/q/28626513
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28686253
type: Answer
has comment: http://stackoverflow.com/comment/45687527
has comment: http://stackoverflow.com/comment/45687155
has body: You have to split your get_rows function into multiple functions. The first one would retrieve the number of .rows elements. casper.getElementsInfo() provides an html property for every matching element and is callable outside of the page context. var nodes; var x = require('casper').selectXPath; casper.then(function(){ nodes = { rows: {} }; var elements = this.getElementsInfo(".rows"); for(var i = 0; i &lt; elements.length; i++) { nodes.rows[i] = { html: elements[i].html }; (function(i){ // TODO: click on the correct link casper.thenClick(x("(//*[contains(@class,'rows')])["+(i+1)+"]//a")); casper.then(function(){ nodes.rows[i].data = this.evaluate(function(){ return { stuff: "whatever" }; // scrape here }); }); casper.back(); // assumes this works for your page })(i); } }).then(function(){ this.echo(JSON.stringify(nodes.rows, undefined, 4)); }); The IIFE ((function(i){...})(i);) is important otherwise only the last i would be populated. This happens because JavaScript has function level scope and CasperJS' then* functions are asynchronous. If casper.back() doesn't work for you, you will need to load the main page anew with casper.thenOpen().
has comment: http://stackoverflow.com/comment/45684140
has comment: http://stackoverflow.com/comment/45678916
has comment: http://stackoverflow.com/comment/45686073
has comment: http://stackoverflow.com/comment/45687579
has comment: http://stackoverflow.com/comment/45686536
has comment: http://stackoverflow.com/comment/45686807
answers question: http://stackoverflow.com/q/28686045
score: 0
has comment: http://stackoverflow.com/comment/45686742
has comment: http://stackoverflow.com/comment/45679051

http://stackoverflow.com/a/28706988
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/28702986
has body: When event handlers attached manually by for example addEventListener() or by the jqLite/jQuery methods onand bind execute you need to manually trigger the digest loop to let Angular know that something has changed. You can use $apply (like for example ng-click does internally): $document.bind('scroll', function() { scope.$apply(function() { if ($document.scrollTop() &gt; 80) { console.log("this is fired1"); $animate.addClass(element, "fade"); } else { console.log("this is fired2"); $animate.removeClass(element, "fade"); } }); }); Also note that when you attach event listeners to the document you should manually remove them when the scope is destroyed: var onScroll = function() { scope.$apply(function() { if ($document.scrollTop() &gt; 80) { console.log("this is fired1"); $animate.addClass(element, "fade"); } else { console.log("this is fired2"); $animate.removeClass(element, "fade"); } }); }; $document.bind('scroll', onScroll); scope.$on('$destroy', function() { $document.unbind('scroll', onScroll); }); Demo: http://plnkr.co/edit/wl0vujSnBcb24FHGQ4il?p=preview
answers question: http://stackoverflow.com/q/28702986
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45718838
score: 0
has text: I have edit the post with some codes. I don't care if someone is going to edit the code, it doesn't make any terrible damage.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28715195

http://stackoverflow.com/a/28634715
downvote count: 0
has comment: http://stackoverflow.com/comment/45589470
score: 10
has body: The modal dialog definitely needs to be initiated on some later event than document.ready. It's just a question of deciding which is the best event. window.load is the most obvious event to try but is not a particularly "Angular" approach. The earliest reliable event would be the completion of loading of the dialog div, and Angular provides for this with a $includeContentLoaded event. To demonstrate the principle, here's a demo with content loaded from a local template and with jQueryUI's .dialog() : HTML Note that the ng-include and ng-controller directives work in consortium to achieve the objective of triggering an action when the content (determined by the the src attribute) has loaded Javascript var demo = angular.module('demo', []); demo.controller('AppController', ['$rootScope', function ($rootScope) { $rootScope.templates = { modal: 'modal.html' }; }]); demo.controller('ModalCtrl', ['$scope', function ($scope) { $scope.$on('$includeContentLoaded', function(event) { $('#termsAndConditionsPopover').dialog({ autoOpen: true }); }); }]); jsFiddle There's still some work to do though not a lot. Your final code should be largely a simplification of the above as you don't need the local template or the associated $rootScope.templates map.
upvote count: 10
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28624363
accepted answer of: http://stackoverflow.com/q/28624363
type: Answer

http://stackoverflow.com/comment/45656091
score: 0
type: Comment
type: QuestionComment
has text: look at ngDialog for a nice implementation of what you are trying to do ... https://github.com/likeastore/ngDialog
comment on: http://stackoverflow.com/q/28680987

http://stackoverflow.com/comment/45676864
comment on: http://stackoverflow.com/a/28692547
type: Comment
has text: @MarkShakespeare event.preventDefault(). prevent the default nature of event, so here submit
score: 0
type: AnswerComment

http://stackoverflow.com/q/28664050
answer count: 1
has comment: http://stackoverflow.com/comment/45624851
has comment: http://stackoverflow.com/comment/45627116
has answer: http://stackoverflow.com/a/28676025
has comment: http://stackoverflow.com/comment/45625455
tagged with: entity-framework-6
has comment: http://stackoverflow.com/comment/45648436
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45626748
has comment: http://stackoverflow.com/comment/45623454
has comment: http://stackoverflow.com/comment/45648527
has comment: http://stackoverflow.com/comment/45625977
has comment: http://stackoverflow.com/comment/45623165
has comment: http://stackoverflow.com/comment/45626890
has comment: http://stackoverflow.com/comment/45626249
has comment: http://stackoverflow.com/comment/45623362
has comment: http://stackoverflow.com/comment/45626973
has comment: http://stackoverflow.com/comment/45644920
type: Question
has comment: http://stackoverflow.com/comment/45625881
has comment: http://stackoverflow.com/comment/45625213
has comment: http://stackoverflow.com/comment/45626265
has title: How to send one model with several classes in Ajax to update a database
has comment: http://stackoverflow.com/comment/45625592
has comment: http://stackoverflow.com/comment/45625400
has body: I have this issue that I'm sure more experienced folks probably know how to resolve. I have a class called CustomerProject. Inside this class, there are two other classes containing respective properties for each. One is Customer; the other is Project. See code. using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; namespace YeagerTechDB.ViewModels.Customers { [Serializable, DataContract(IsReference = true)] public class CustomerProjectDTO { public class Customer { [ScaffoldColumn(true)] [Display(Name = "ID")] [DataMember] public short CustomerID { get; set; } [Required] [StringLength(256)] [DataMember] public string UserName { get; set; } [Required] [StringLength(50)] [EmailAddress] [DataMember] public string Email { get; set; } [StringLength(50)] [DataMember] public string Company { get; set; } [StringLength(50)] [DataMember] public string FirstName { get; set; } [StringLength(50)] [DataMember] public string LastName { get; set; } [StringLength(50)] [DataMember] public string Address1 { get; set; } [StringLength(50)] [DataMember] public string Address2 { get; set; } [StringLength(50)] [DataMember] public string City { get; set; } [StringLength(2)] [DataMember] public string State { get; set; } [StringLength(10)] [DataType(DataType.PostalCode)] [RegularExpression(@"^\d{5}(-\d{4})?$", ErrorMessage = "Must match 99999 or 99999-9999 format")] [DataMember] public string Zip { get; set; } [StringLength(12)] [DataType(DataType.PhoneNumber)] [RegularExpression(@"^\s*([\(]?)\[?\s*\d{3}\s*\]?[\)]?\s*[\-]?[\.]?\s*\d{3}\s*[\-]?[\.]?\s*\d{4}$", ErrorMessage = "Must match 999-999-9999 format")] [DataMember] public string HomePhone { get; set; } [StringLength(12)] [DataType(DataType.PhoneNumber)] [RegularExpression(@"^\s*([\(]?)\[?\s*\d{3}\s*\]?[\)]?\s*[\-]?[\.]?\s*\d{3}\s*[\-]?[\.]?\s*\d{4}$", ErrorMessage = "Must match 999-999-9999 format")] [DataMember] public string CellPhone { get; set; } [StringLength(100)] [DataType(DataType.Url)] …
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/45625540
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/45626308

http://stackoverflow.com/q/28620900
type: Question
score: 0
has comment: http://stackoverflow.com/comment/45544335
has comment: http://stackoverflow.com/comment/45544610
answer count: 1
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45544505
has title: Conflicting jQuery with core Joomla scripts
has body: This two jQuery codes are conflicting with each other and i'm at lost as to how to go about it. I have tried many noConflict combinations to the first part of the script. &lt;script&gt; jQuery(function($) { $('.slider').sss(); }); &lt;/script&gt; Conflicting with this core joomla code that i don't want to change for various reasons. So any change must be done to the script mentioned above &lt;script type="text/javascript"&gt; jQuery(window).on('load', function() { new JCaption('img.caption'); }); &lt;/script&gt; Any thoughts on how to go about modifying the first script?
tagged with: joomla
has comment: http://stackoverflow.com/comment/45544536
has answer: http://stackoverflow.com/a/28621176

http://stackoverflow.com/a/28684868
answers question: http://stackoverflow.com/q/28683706
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28683706
type: Answer
has comment: http://stackoverflow.com/comment/45663484
has body: why not put this block into its own function such as var onClick = function() { var server = jstore.getServer(url); if(server &amp;&amp; server.loggedIn()) { server.logout(); } } and then you can just pass it in as such: e.click(onClick) and you can invoke it from somethere else by simply calling onClick()
score: 1
upvote count: 1
downvote count: 0

http://stackoverflow.com/a/28648123
type: Answer
answers question: http://stackoverflow.com/q/28648090
has comment: http://stackoverflow.com/comment/45593922
downvote count: 0
score: 2
has body: Property is that part of object named "name" with value 5. Key is a word "name".
has comment: http://stackoverflow.com/comment/45594150
upvote count: 2

http://stackoverflow.com/comment/45524730
score: 0
type: Comment
type: QuestionComment
has text: Can you share an example of the response that gives you the wiki articles, what property name in the response is used?
comment on: http://stackoverflow.com/q/28610240

http://stackoverflow.com/comment/45764659
type: Comment
has text: @aliiii try to add input element on page and get it with javascript, as an workaround on this, see my updated answer.
type: AnswerComment
comment on: http://stackoverflow.com/a/28726161
score: 0

http://stackoverflow.com/a/29450361
has comment: http://stackoverflow.com/comment/47415867
score: 6
has body: If you have an object like this one (similar to what you described): var obj= { user: "user", title: "title", content: "content", message: "message" }; all the following assertions should pass: obj.should.include.keys(["user", "title", "content"]); obj.should.includes.keys(["user", "title", "content"]); obj.should.contain.keys(["user", "title", "content"]); obj.should.includes.keys(["user", "title", "content"]); even if you pass the values as separated arguments: obj.should.include.keys("user", "title", "content"); obj.should.includes.keys("user", "title", "content"); obj.should.contain.keys("user", "title", "content"); obj.should.includes.keys("user", "title", "content"); So, assuming that you required chai's should style correctly: var should = require('chai').should(); , your problem may be just a typo in your body object or in your test suite. UPDATE: After you added more information about the way you required all testing modules, a couple things should be pointed out: First, you required chai two times, the second one when setting up should. You did: var chai = require( 'chai' ), should = require( 'chai' ).should(), ... when you should've done: var chai = require( 'chai' ), should = chai.should(), ... Second, if you're using chai-as-promised, you should assert body keys the way this module requires, like: Promise.resolve(body).should.eventually.include.keys([ "user", "title", "content" ]);
has comment: http://stackoverflow.com/comment/47316036
downvote count: 0
answers question: http://stackoverflow.com/q/28716363
type: Answer
upvote count: 6

http://stackoverflow.com/a/28722941
has comment: http://stackoverflow.com/comment/45733406
accepted answer of: http://stackoverflow.com/q/28722875
has comment: http://stackoverflow.com/comment/45734117
answers question: http://stackoverflow.com/q/28722875
score: 3
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 3
has body: You just need to store their responses into an array. You're currently storing it into the variable marks but you're not doing anything with it. Try just pushing the response straight into an array, then doing what you want with it. var userMarks = []; for (var counter = 0; counter &lt; 10; counter++) { userMarks.push(prompt("What is your mark?")); } console.log(userMarks); // Do averages or whatever

drupal
type: Tag
tags question: http://stackoverflow.com/q/28678235
tags question: http://stackoverflow.com/q/28676558
tag name: drupal

http://stackoverflow.com/a/28674695
has body: In my opinion something gone wrong in the definition of $(this), are you sure about the element you get with $(this)? however the .find() is better than children.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28674560

http://stackoverflow.com/comment/45727752
comment on: http://stackoverflow.com/q/28720370
score: 0
type: Comment
type: QuestionComment
has text: Is there a way to return these values so I can use them in another function??

http://stackoverflow.com/comment/45798167
has text: I haven't used GAE before so no. Did you try setting the userAgent? It's the only thing that I can think of.
comment on: http://stackoverflow.com/q/28747797
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28749343
has comment: http://stackoverflow.com/comment/45781028
favorite count: 0
has comment: http://stackoverflow.com/comment/45780723
has comment: http://stackoverflow.com/comment/45781966
has comment: http://stackoverflow.com/comment/45781386
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45782318
tagged with: php
accepted answer: http://stackoverflow.com/a/28754191
type: AnsweredQuestion
downvote count: 1
possible better answer: http://stackoverflow.com/a/28753309
type: Question
has answer: http://stackoverflow.com/a/28753309
has comment: http://stackoverflow.com/comment/45782167
has title: php code to return value based on array?
tagged with: javascript
score: -1
has body: Basically i have 2 pages; Page1.php and Page2.php... On page 1 the user can enter their Postcode and Property Value, Upon submit the page will POST to page2.php. I am looking for help to have a small script return (echo or print) a value back to the customer based on the property value, To make it simple i will have the property value set within ranges so for example: £0 =&gt; £100,000 --&gt; Return as £125 £101,000 =&gt; £200,000 --&gt; Return as £195 £201,000 =&gt; £300,000 --&gt; Return as £275 And so on... I was hoping to have the script return the output variable so i can use the echo function to show the default value set for the range entered by the user within a set css box on the page. So if i entered page1.php as a customer and i enter my postcode and enter my property value as £225,000 (This will not be used as a selected option it will be down to the user to enter this in manually same as Postcode box) When i submit this and get taken to page2.php the script will realize i have entered within the range of £201,000 - £300,000 and return the default value using the echo variable function. I hope i have explained the best I can as I really am learning the basics and still trying to get use to certain terms. Any help is greatly appreciated and would like to thank you for taking the time out to read this post including the time to comment and help.
has answer: http://stackoverflow.com/a/28754191
answer count: 2
upvote count: 0

http://stackoverflow.com/comment/45775865
comment on: http://stackoverflow.com/a/28746358
has text: @Chetan – You can leave the deep clone if you want. It's not necessary in your example, but nothing is going to break if it's in there.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28597241
has title: How to position a relative element in the same coordinates as his parent in the document?
score: 2
type: AnsweredQuestion
has body: I'm creating and element in JavaScript to append it as a child of another div: var a = document.querySelector(".a"); var b = document.createElement("div"); b.style.position = "relative"; b.style.height = a.offsetHeight+"px"; b.style.width = a.offsetWidth+"px"; b.style.background = "blue"; b.style.top="0px"; a.appendChild(b); But I want to position the "b" element completely over the "a" element. I know that I should do something like that to achieve the effect: b.style.top = -b.offsetTop+"px"; But there is no way I can find the offsetTop that will be taken by "b" since it has no been added to the document yet. This is what I have so far: http://jsfiddle.net/a36eLwu3/ How can I position a relative element in the same coordinates of his parent in the document?
upvote count: 2
type: Question
has answer: http://stackoverflow.com/a/28597291
answer count: 2
possible better answer: http://stackoverflow.com/a/28597294
accepted answer: http://stackoverflow.com/a/28597291
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28597294
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/a/28721861
downvote count: 0
answers question: http://stackoverflow.com/q/28721585
type: Answer
upvote count: 6
score: 6
has body: If you print the type of program.args or the program.args itself, you will know that its an Array. console.log(Object.prototype.toString.call(program.args), program.args); // [object Array] [ 'test.txt' ] So, you need to use the correct index to be used like this var filename = program.args[0]; I think the result of console.log('keys: ' + filename) is not helping you much. It is because when you use + operator, it will try to convert the filename object to a string and the String array converted to a string normally just has comma separated strings. You can check that like this console.log(['a'].toString(), ['a', 'b'].toString()); // a a,b

http://stackoverflow.com/comment/45629747
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28667094
has text: Calendar icon is loaded from font-awesome. include this in your html file.
type: AnswerComment

http://stackoverflow.com/comment/45711649
has text: Is their no way I can display this in a user friendly format?
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28711468

python
tags question: http://stackoverflow.com/q/28690901
tags question: http://stackoverflow.com/q/28689719
tags question: http://stackoverflow.com/q/28649211
tags question: http://stackoverflow.com/q/28716013
tags question: http://stackoverflow.com/q/28658589
tag name: python
tags question: http://stackoverflow.com/q/28678872
tags question: http://stackoverflow.com/q/28703697
tags question: http://stackoverflow.com/q/28692356
tags question: http://stackoverflow.com/q/28605338
tags question: http://stackoverflow.com/q/28722869
tags question: http://stackoverflow.com/q/28651549
type: Tag
tags question: http://stackoverflow.com/q/28658522
tags question: http://stackoverflow.com/q/28654621
tags question: http://stackoverflow.com/q/28713694
tags question: http://stackoverflow.com/q/28657974
tags question: http://stackoverflow.com/q/28643401
tags question: http://stackoverflow.com/q/28617115
tags question: http://stackoverflow.com/q/28602030
tags question: http://stackoverflow.com/q/28734828
tags question: http://stackoverflow.com/q/28620938
tags question: http://stackoverflow.com/q/28623094
tags question: http://stackoverflow.com/q/28643916
tags question: http://stackoverflow.com/q/28686150
tags question: http://stackoverflow.com/q/28629758
tags question: http://stackoverflow.com/q/28596309

http://stackoverflow.com/comment/45582846
type: QuestionComment
comment on: http://stackoverflow.com/q/28641958
has text: If you follow along the bulleted list / looking at the jsbin, it should start making sense. THX
score: 0
type: Comment

http://stackoverflow.com/q/28653949
tagged with: javascript
tagged with: jquery
score: 0
accepted answer: http://stackoverflow.com/a/29088922
tagged with: gallery
has title: blueimp Gallery JS initialization isuses
has body: I'm having trouble getting the gallery to display it's slides. The thumbnails work, just the actual images them selves do not and they come up as error slides. I have other galleries working fine, and it works great using the light box but when I'm trying to execute it via java-script I run into this problem of no actual slides. I'm trying to build a gallery via java-script and have some buttons launch each gallery. This is the java-script I'm running to build the gallery. function gallery01() { blueimp.Gallery([ { title: 'AR Ref[04-01]', href: './clients/liam_neeson/gallery/beijing_WV1_2008194_lrg.jpg', type: 'image/jpeg', thumbnail: './clients/liam_neeson/gallery/thumbnails/beijing_WV1_2008194_lrg.jpg' }, { title: 'AR Ref[04-02]', href: './clients/liam_neeson/gallery/iwm-q_107237.jpg', type: 'image/jpeg', thumbnail: './clients/liam_neeson/gallery/thumbnails/iwm-q_107237.jpg' }, { title: 'AR Ref[04-03]', href: './clients/liam_neeson/gallery/Mohne-dam-breached.jpg', type: 'image/jpeg', thumbnail: './clients/liam_neeson/gallery/thumbnails/Mohne-dam-breached.jpg' }, { title: 'AR Ref[04-04]', href: './clients/liam_neeson/gallery/Passchendaele1916.jpg', type: 'image/jpeg', thumbnail: './clients/liam_neeson/gallery/thumbnails/Passchendaele1916.jpg' } ]);} Here is my button that launches builds and launches the gallery. $(document).ready(function() { $("#gallery").click(gallery01); }); Then I'm using a simple button (to test) to ensure this works. &lt;button type="button" class="btn btn-primary btn-lg" id="gallery01"&gt; Launch demo gallery &lt;/button&gt; All help will be greatly appreciated.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29088922
type: Question
tagged with: blueimp
answer count: 1

http://stackoverflow.com/a/28738184
score: 3
has comment: http://stackoverflow.com/comment/45760305
answers question: http://stackoverflow.com/q/28738138
type: AcceptedAnswer
has body: Firstly, the id property in your HTML has no - in it. Secondly, children looks at direct descendants, whereas you need to use find(): $('#company' + currentTabIndex).find('.myTemplate').html() That said, you can use a single selector and remove the find() completely: $('#company' + currentTabIndex + ' .myTemplate').html()
upvote count: 3
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28738138

http://stackoverflow.com/a/28727570
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45742146
downvote count: 0
answers question: http://stackoverflow.com/q/28725785
has body: The behavior you are seeing is in line with what the docs claim. Attempts to destroy any objects passed to it by removing all event listeners, removing them from the DOM (if applicable) and calling their destroy functions (if available). This method is primarily intended for arguments of type Ext.Element and Ext.Component, but any subclass of Ext.util.Observable can be passed in. Any number of elements and/or components can be passed into this function in a single call as separate arguments. Source - http://docs.sencha.com/extjs/4.2.1/#!/api/Ext-method-destroy If you look at the source code, it does not delete the actual component anywhere. i.e. the component will be practically useless after a call to destroy but that's not the same thing as that object being garbage collected.
type: Answer

http://stackoverflow.com/a/28730839
type: Answer
has body: Javascript will automaticlly convert any number to a string, so toString() is not necessary. You should be aware that if num is null NaN string is return.
score: 0
answers question: http://stackoverflow.com/q/28730665

http://stackoverflow.com/q/28620310
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/45543768
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28685333
has body: My code is in PHP and I would want to change the image button1.png to button2.png on hover. The image should still be clickable. $link = "". " " ."";
tagged with: php
has comment: http://stackoverflow.com/comment/45543170
has answer: http://stackoverflow.com/a/28620521
has comment: http://stackoverflow.com/comment/45543090
has title: Change img src on hover with javascript
type: Question
has comment: http://stackoverflow.com/comment/45543153
has answer: http://stackoverflow.com/a/28620803
tagged with: javascript

http://stackoverflow.com/comment/45898647
score: 0
has text: What's not working in the JavaScript, exactly?
comment on: http://stackoverflow.com/q/28624701
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28636197
has title: Using Tabletop.js, trying to fetch data from array
type: UnansweredQuestion
tagged with: object
type: Question
has body: Problem Trying to fetch data from this array, which currently contains two objects. I'm using Tabletop.js to fetch the data from a public Google Spreadsheet, getting an error in the console that says ReferenceError: object is not defined Console [Object, Object]/* */0: Object citation1url: "http://brandonsun.com" citation2url: "" citation3url: "" datesaid: "2/20/2015" explanation: "" politicianname: "First Name, Last Name" rowNumber: 1 statement: "This is my statement" validity: "True, False, Unconfirmed" *1: Object citation1url: "http://andrewnguyen.ca" citation2url: "" citation3url: "" datesaid: "2/20/2015" explanation: "" politicianname: "Andrew Nguyen" rowNumber: 2 statement: "I work as a newsroom developer" validity: "TRUE" scripts.js $(function() { window.onload = function() { init() }; var public_spreadsheet_url = "https://docs.google.com/spreadsheets/d/1glFIExkcuDvhyu5GPMaOesB2SlJNJrSPdBZQxxzMMc4/pubhtml"; function init() { Tabletop.init( { key: public_spreadsheet_url, callback: showInfo, simpleSheet: true } ) } function showInfo(data, tabletop) { // alert("Successfully processed!") console.log(data); } });
tagged with: tabletop.js
tagged with: arrays
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/30489213

http://stackoverflow.com/a/28744252
accepted answer of: http://stackoverflow.com/q/28744178
type: Answer
downvote count: 0
score: 5
type: AcceptedAnswer
has body: Try use .innerText instead of .innerHTML, like so var myDiv = document.getElementById('myDiv'); var text = myDiv.innerText || myDiv.textContent || ''; myDiv.innerHTML = text.replace(/g/g, 'a'); // or without variable // myDiv.innerHTML = (myDiv.innerText || myDiv.textContent || '').replace(/g/g, 'a'); aaa>aga
answers question: http://stackoverflow.com/q/28744178
upvote count: 5

http://stackoverflow.com/comment/45593271
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28647545
has text: @Ed Heal why did you think I'm forgetting the types. Stackoverflow is a knowledge sharing site. People can exchange their knowledge here. My questions was intent to knowing - whether it is possible from the id to determine the element type. My last portion of the question show a proper indication that I know about the other way. Please don't get it wrong.
score: 0

http://stackoverflow.com/q/28694621
has body: I'm trying to delete an element from the DB.... i have created this Action Method in my MVC Controller....... [HttpPost] public ActionResult RemoveDoctor(DoctorModel doctor) { //confirming whether element is removed from DB bool confirmationResult = repo.RemoveDoctor(doctor.Id); string str = null; if (confirmationResult == true) str = "You have successfully Removed your record!!"; else str = "Error!! Some Thing Went Wrong, Please Try Again!!"; return Json(str); } I need to see whether it s deleted or not and give a notification to the user saying it has successfully deleted or not............ but the issue is when i return this as Json the string will not move to my jQuery POST function, it will just displays my string in the browser....................... Just for Example it will just output this message: "You have successfully Removed your record!!"..................... This is how my fuction looks like: $('#submit').click(function () { var modelDataJSON = @Model; $.ajax({ type: "POST", url: "../Doctor/RemoveDoctor", data: {"doctor" : modelDataJSON}, success: function (data) { alert(data); }, dataType: "json", error: function () { alert("Error!!!"); } }); }); this is how my html form looks like: @using (Html.BeginForm("AddDoctor", "Doctor")) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) @*@Html.LabelFor(model => model.UserId, new { @class = "col-sm-2 control-label" })*@ User ID @Html.TextBoxFor(model => model.UserId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.UserId) @Html.LabelFor(model => model.Name, new { @class = "col-sm-2 control-label" }) @Html.TextBoxFor(model => model.Name, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Name) @*@Html.LabelFor(model => model.DoctorSpecialityId, new { @class = "col-sm-2 control-label" })*@ Doctor Speciality ID @Html.TextBoxFor(model => model.DoctorSpecialityId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.DoctorSpecialityId) …
has answer: http://stackoverflow.com/a/28695517
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28695517
has comment: http://stackoverflow.com/comment/45680458
type: Question
score: 0
answer count: 1
tagged with: jquery-mobile
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/45680324
has title: Ajax POST jQuery issue

http://stackoverflow.com/a/28702156
answers question: http://stackoverflow.com/q/28697807
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/45697924
has comment: http://stackoverflow.com/comment/45698947
has body: I believe the issue is with the WITH clause referencing the next node to be created, rather than referencing the previous node to be created. Additionally, the code is trying to create undirected relationships. Try this: MATCH (user:User) WHERE ID(user) = {uid} CREATE (recipe:Recipe {name:"receta 4"}) WITH recipe MATCH (ingredient:Ingredient) WHERE id(ingredient) = 7 CREATE (recipe)-[ri:HAS {unit: "vasos", cant: 1}]->(ingredient) WITH recipe MATCH (ingredient:Ingredient) WHERE ID(ingredient) = 6 CREATE (recipe)-[ri:HAS {unit: "cditas", cant: 2}]->(ingredient) CREATE (user)-[:PREPARE]->(recipe) RETURN recipe
has comment: http://stackoverflow.com/comment/45750495
score: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28697807

http://stackoverflow.com/a/28656338
accepted answer of: http://stackoverflow.com/q/28629099
answers question: http://stackoverflow.com/q/28629099
type: AcceptedAnswer
upvote count: 1
type: Answer
has body: Eventually the problem went like this: when Node opens a process, it's opened as if the exe were in the node folder. the EXE writes to the directory it's located when it's on , which the node folder. the node module, on the other hand . had absolute path to the original EXE file , and when it tries to open the log file - it's not there , it's in the node folder. the solution is to pass 'cwd' argument to the child_process.exec : var test = child.exec(programPath+'\\Scanner.exe', { cwd: programPath }, validate);
downvote count: 0
score: 1

http://stackoverflow.com/q/28636588
type: AnsweredQuestion
has body: I see this has been asked couple of times here, but none of them work for me. So i'm positing it again to see if someone faced something like this. I have a select2 inside a Model, and was able to populate it by making an ajax call to the Api. It works like a charm until here, problem is i'm not able to select any value into the 'Code'. Below is my code for the ajax and html /HTML/ &lt;div class="col-lg-8 col-sm-7"&gt; &lt;input id="procedureSelect" name="SelectProcedure" class="form-control"&gt; &lt;/div&gt; /*Ajax Call */ $('#procedureSelect').select2({ placeholder: 'Select Procedure', allowClear: true, quietMillis: 1000, ajax: { url: '@Url.Action("GetProcedures", "Procedure")', dataType: 'json', data: function (term, page) { return { searchTerm: term, page: page }; }, results: function (data, page) { var more = (page * 25) &lt; data.total; return { results: data.procedureData, more: more }; } }, formatResult: function (data) { return '&lt;div&gt;' + data.procedure_code + " - " + data.short_description + '&lt;/div&gt;'; }, formatSelection: function (data) { var result = data.procedureData; return result.procedure_code; } });
tagged with: .net
tagged with: ajax
tagged with: jquery-select2
accepted answer: http://stackoverflow.com/a/28638483
type: Question
score: 0
has title: Not able to select values from dropdown in select2 - #.Net
answer count: 1
has answer: http://stackoverflow.com/a/28638483
tagged with: javascript

http://stackoverflow.com/comment/45618509
has text: So I would do like a htmspecialchars as the last filter when outputting from php?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28661305
type: QuestionComment

http://stackoverflow.com/comment/45668510
has text: `height: "0px",` not `height: "0px"` - missing a comma
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28688131

http://stackoverflow.com/comment/47211493
score: 0
comment on: http://stackoverflow.com/a/28677952
type: Comment
has text: Are these actions being attached to the button via jQuery or something similar?
type: AnswerComment

http://stackoverflow.com/comment/45692002
score: 0
comment on: http://stackoverflow.com/q/28700919
type: Comment
type: QuestionComment
has text: You can't directly pass a jquery or javascript variable to a php variable, you have to make the php script on another page, and then use ajax to post to that page, and get the result.

http://stackoverflow.com/a/28604039
has comment: http://stackoverflow.com/comment/53493717
upvote count: 2
answers question: http://stackoverflow.com/q/28602794
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28602794
has body: ng-repeat creates new scope from current scope, so If you are using selected inside a inner ng-repeat will cause to create new scope variable for inner ng-repeat. If you want to refer the parent scope from ng-repeat then use $parent.selected that will refer the outer scope variable of ng-repeat. HTML List {{$index + 1}} {{item}} Working Fiddle For more information here is link
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/comment/45586628
type: Comment
has text: I ran all 3 options, but nothing helped. I couldn't put the other outputs, because stackoverflow has a simbol limit of 30000. :(
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28633021

http://stackoverflow.com/comment/45799880
has text: I can't find any documentation on accessing MySQL directly from Cordova. All results use MySQL on a server and Cordova accesses that server. If they want to store data within the application (without a server), they use `localStorage`. See [Storage@Phonegap](http://docs.phonegap.com/en/2.0.0/cordova_storage_storage.md.html)
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28749667

http://stackoverflow.com/a/73347933
score: 2
has body: Using event object: handleChange(e) { let selectedOptions = e.target.selectedOptions // selectedOptions looks like this: // { // '0': &lt;1st selected HTMLOptionElement&gt;, // '1': &lt;2nd selected HTMLOptionElement&gt;, // '2': &lt;3rd selected HTMLOptionElement&gt; // } let newArrayOfSelectedOptionValues = Object.values(selectedOptions).map( opt =&gt; opt.value ) this.props.someCallbackFromParent(newArrayOfSelectedOptionValues); } So the full ??? looks like this: Object.values(e.target.selectedOptions).map( opt =&gt; opt.value )
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28624763
upvote count: 2

http://stackoverflow.com/a/28691542
has body: Alternatively, you could do all the maths using a separate math library. For example math.js comes with an expression parser and supports bignumbers (powered by decimal.js): math.config({number: 'BigNumber'}); // using a parser to manage variables for you in an internal scope: var parser = math.parser(); parser.evaluate('a = 0.1'); // BigNumber, 0.1 parser.evaluate('b = 0.2'); // BigNumber, 0.2 parser.evaluate('c = a + b'); // BigNumber, 0.3 // or without a parser: var scope = {}; math.evaluate('a = 0.1', scope); // BigNumber, 0.1 math.evaluate('b = 0.2', scope); // BigNumber, 0.2 math.evaluate('c = a + b', scope); // BigNumber, 0.3 // scope now contains properties a, b, and c I don't know if this would be feasible and handy for your application, but at least that would allow you to write your equations in "readable" expressions.
answers question: http://stackoverflow.com/q/28682199
upvote count: 2
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/comment/46041977
score: 0
comment on: http://stackoverflow.com/q/28710853
type: QuestionComment
type: Comment
has text: Nevermind I just did some research on setTimeout() and found this works perfectly $('#buttonone').addClass('liteup'); setTimeout(function() { $('#buttonone').removeClass('liteup'); }, 3000); Thanks for the help!

http://stackoverflow.com/q/28677149
tagged with: javascript
tagged with: jquery
tagged with: jquery-plugins
answer count: 1
downvote count: 0
tagged with: asp.net
favorite count: 0
has title: JQuery loads after F5
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/28677290
has body: I have used the following script in my asp.net project. All is working fine but after releasing my prject to IIS, some users are complaining about rendering issues. If they press F5 then all works fine, and they don't have to press F5 again to see controls rendering properly. Is it normal behaviour or there is a workaround? .js file var prm = Sys.WebForms.PageRequestManager.getInstance(); $(function () { $("#uc_DDiscipline select").multiselect({ header: false, multiple: false, selectedList: 1, minWidth: 265 }); }); prm.add_endRequest(function () { $('.ui-multiselect-menu').each(function () { $(this).remove(); }); $("#uc_DDiscipline select").multiselect({ header: "-- View All --", multiple: false, noneSelectedText: "-- View All --", selectedList: 1, minWidth: 265 }); });
type: Question
has comment: http://stackoverflow.com/comment/45647587
tagged with: jquery-ui
accepted answer: http://stackoverflow.com/a/28677290

http://stackoverflow.com/comment/45540221
type: QuestionComment
has text: The data is sent as `POST`, but it does't really matter, I can get both with `$_REQUEST` for example.
comment on: http://stackoverflow.com/q/28617900
score: 0
type: Comment

http://stackoverflow.com/q/28696708
possible better answer: http://stackoverflow.com/a/28696930
has answer: http://stackoverflow.com/a/28698070
tagged with: selenium
has title: Create the Xpath for the following href for Selenium Webdriver
type: AnsweredQuestion
has body: Please help me to create the Xpath for the following href. I am using Selenium webdriver and have only IE browser. Following is the HTML: Need Xpath for : a href="javascript:OnEventQueue();">. I can use only IE browser and need to click on this link. Event Queue
tagged with: javascript
has answer: http://stackoverflow.com/a/28696930
accepted answer: http://stackoverflow.com/a/28698070
type: Question
score: 0
answer count: 2

http://stackoverflow.com/comment/46600821
type: QuestionComment
comment on: http://stackoverflow.com/q/28697966
has text: [fiddle, please](http://jsfiddle.net)
score: 0
type: Comment

http://stackoverflow.com/comment/45630630
type: AnswerComment
comment on: http://stackoverflow.com/a/28601606
has text: Also works on Safari. Could you update your answer so I would accept it?
type: Comment
score: 0

http://stackoverflow.com/comment/45683499
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28696578
has text: Are you using the `cordova-CLI` to build this?
score: 0

http://stackoverflow.com/q/28748684
accepted answer: http://stackoverflow.com/a/28749225
tagged with: css
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/28749225
possible better answer: http://stackoverflow.com/a/28749100
type: Question
answer count: 2
has title: bootstrap carousel autoplay with JS is giving a trouble
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45780161
downvote count: 1
has answer: http://stackoverflow.com/a/28749100
favorite count: 0
tagged with: twitter-bootstrap
has body: $('.carousel').carousel({ interval: 5000 }); this code is working but this one doesnt works $('#main-slider.carousel').carousel({ interval: 5000 }); but the 1st code is making a slightly jumping when it transit from last slide to 1st.( if u look at carousel indicator(the dots) u will see) Why is it happening? Plz help me linkenter link description here

http://stackoverflow.com/a/28837762
has body: Instead of binding directly to the element's onclick which needs careful handling of Turbolinks events, you can use an event handler on the document, try changing the direct event toggleSidebar.on("click", function(){ to the delegated event $(document).on("click", ".togglesidebar", function(){ When you modify the DOM dynamically (as when Turbolinks replaces it) if you use a direct event then you would need to re-assign it. For a detailed explanation see http://api.jquery.com/on/#direct-and-delegated-events The same that goes for the first function stands for the second. Also, with delegated events the "ready" check becomes unnecessary. With this in mind, your code would become: $(document).on("click", ".togglesidebar", function(){ var primary = $("#primary"); var secondary = $("#secondary"); if(primary.hasClass("col-sm-9")){ primary.removeClass("col-sm-9"); primary.addClass("col-sm-12"); secondary.css('display', 'none'); } else { primary.removeClass("col-sm-12"); primary.addClass("col-sm-9"); secondary.css('display', 'inline-block'); } }); $(document).on('change keyup paste', '#post_title, #body-field', function () { var fieldValue = $(this).val(); var wc = fieldValue.trim().replace(regex, ' ').split(' ').length; var regex = /\s+/gi; var $wcField; var maxWc; if ($(this)[0] === $('#post_title')[0]) { $wcField = $('#wordCountTitle'); maxWc = 7; } else { $wcField = $('#wordCountBody'); maxWc = 150; } $wcField.html(wc); $wcField.toggleClass('over-limit', wc &gt; maxWc); });
upvote count: 7
type: Answer
has comment: http://stackoverflow.com/comment/46103772
has comment: http://stackoverflow.com/comment/46032676
score: 7
answers question: http://stackoverflow.com/q/28619731
downvote count: 0

http://stackoverflow.com/comment/45611661
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28657826
has text: Your code is always `html`, probably you mean opening the file without a webserver `file:///...` and with a webserver `http://localhost/`. Anyway `.close()` will only work for windows/tabs that where opened using javascript (`window.open`). What error message do you see in the developer console of your browser.
score: 0

http://stackoverflow.com/a/28638676
answers question: http://stackoverflow.com/q/28638273
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28638273
type: AcceptedAnswer
downvote count: 0
has body: It's .css('width') that rounds. There's a lot to .css in jQuery beyond getComputedStyle. Comparison. For .css('width'), jQuery uses offsetWidth [source]: val = name === "width" ? elem.offsetWidth : elem.offsetHeight, In CSS, pixels are just another unit, defined to be 1/96 of an inch. There's nothing inherently integral about them. In high-DPI displays, such as mobile screens, newer laptops, and printed media, it makes sense to have fractions of "pixels." But offsetWidth is defined to be an integer value [CSSOM]: readonly attribute long offsetWidth; In this case, where you explicitly set a width in the inline style, and you want to get it, one thing you could do is just use plain DOM to get it: $("#the_box")[0].style.width.replace('px', '') example You can also try using getBoundingClientRect [CSSOM] and working backwards through the changes introduced by borders and padding. This method returns a DOMRect object with information represented as floating-point numbers [geometry]. $("#the_box")[0].getBoundingClientRect().width - ...
has comment: http://stackoverflow.com/comment/45577165
has comment: http://stackoverflow.com/comment/45577221
type: Answer
score: 2

http://stackoverflow.com/comment/45716927
score: 0
type: AnswerComment
has text: @ZetaAI: Tijmen is absolutely right. Try unsetting any of the CSS attributes using in Chrome's dev console - disabling body{ height: 100% } clinches it.
comment on: http://stackoverflow.com/a/28714498
type: Comment

http://stackoverflow.com/a/28984137
score: 0
has body: When you want to remember your function the best way to to that, is to save it in a var when you call it. You could give it an index or save the string and if it is not empty when you recall the function you can call your function.
accepted answer of: http://stackoverflow.com/q/28618425
type: Answer
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28618425

http://stackoverflow.com/q/28689462
possible better answer: http://stackoverflow.com/a/28690042
has answer: http://stackoverflow.com/a/28690042
type: Question
has answer: http://stackoverflow.com/a/28693239
has title: Reusable functions in D3
tagged with: javascript
answer count: 2
has body: I'm new to d3 and a pretty average javascript programmer. I've got some code to create a circle, and a function to get the x and y co-ordinates of a point on a circle: var innerCircle = svg.append('circle') .attr({ cx: 100, cy: 100, r: 50, 'stroke': 'white', 'fill': 'transparent', }); var pointOnCircle = function(circle, radians){ var cx = parseInt(circle.attr('cx')); var cy = parseInt(circle.attr('cy')); var r = parseInt(circle.attr('r')); var x = cx + Math.sin(radians) * r; var y = cy + Math.cos(radians) * r; return {x: x, y: y}; } It works. But I feel like continuing with this approach will make my code a messy grab bag of global functions, and that I should be able to make it object-oriented, so rather than calling: var point = pointOnCircle(circle, Math.PI); I can instead call: var point = circle.pointAt(Math.PI); But this would involve me either attaching a pointAt function to a d3 object somehow, or creating my own Circle object that has a pointAt function, and wraps a d3 object. Is either of these a good idea? There's other points where I feel like I'd want something similar - kind of like I want to be mapping 'objects' to documents, as opposed to plain old data to documents. Is this a common requirement, or am I missing something conceptually? What's the best way to approach my pointOnCircle issue that I'm having above? Most of the d3 examples are small, self-contained, and written in one single script. Are there any examples showing how to build something with more reusable functions?
downvote count: 0
accepted answer: http://stackoverflow.com/a/28693239
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
upvote count: 2
tagged with: d3.js
score: 2
type: AnsweredQuestion

http://stackoverflow.com/comment/45529700
type: QuestionComment
has text: @Pshemo yes ".12" is valid .
comment on: http://stackoverflow.com/q/28612649
score: 0
type: Comment

http://stackoverflow.com/q/28746462
type: Question
tagged with: google-sheets
has title: Google Sheets - create range (rows) with script?
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28755848
type: UnansweredQuestion
has body: absolutely no experience with JS but some with C, Excel VB and PHP. I have Google Sheets situation as follows: one document, 20 sheets need to insert range/rows into one Sheet (17th) and want the same action in all of the other sheets or every other sheet The way I see it: manually load document activate needed sheet (say #17) start script from the menu Pseudo code // read user input, where to insert and how many rows var startPosition = prompt ("Where do you wish to insert range/rows?"); var numRows = prompt ("How many rows do you wish to insert?"); parse both inputs with some method (?); convert first to cell name (e.g. A15); convert the second to int; // loop through all (or some) sheets for (test condition, increment) { activate other sheet(s); insert row(s); loop again; } ANY help greatly appreciated. I need to finish an assignment and don't have time to learn JavaScript properly

http://stackoverflow.com/comment/45632712
score: 0
has text: if you want to make a rule stronger, just add `html ` and/or `body ` to the front of the selector. i always give body an id of "body" so that i can bust out the super-powerful `html>#body ` prefix if needed...
type: Comment
comment on: http://stackoverflow.com/a/28669113
type: AnswerComment

http://stackoverflow.com/comment/45775213
type: QuestionComment
has text: "when we try to open a modal dialog box from a parent page", what does that mean? And why all the complication with `window.parent`?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28746348

http://stackoverflow.com/comment/45555218
has text: Why do you want to do that? If you really want to do that, you need to rethink why you are using angular in the first place.
comment on: http://stackoverflow.com/q/28627250
score: 1
type: QuestionComment
type: Comment

c#
tags question: http://stackoverflow.com/q/28656982
tags question: http://stackoverflow.com/q/28707487
tags question: http://stackoverflow.com/q/28670840
tags question: http://stackoverflow.com/q/28618425
tags question: http://stackoverflow.com/q/28738572
tags question: http://stackoverflow.com/q/28666676
tags question: http://stackoverflow.com/q/28695087
tags question: http://stackoverflow.com/q/28649587
tags question: http://stackoverflow.com/q/28632618
tags question: http://stackoverflow.com/q/28627387
tags question: http://stackoverflow.com/q/28647286
tags question: http://stackoverflow.com/q/28725791
tags question: http://stackoverflow.com/q/28629999
tags question: http://stackoverflow.com/q/28744030
tags question: http://stackoverflow.com/q/28645763
tag name: c#
tags question: http://stackoverflow.com/q/28718954
tags question: http://stackoverflow.com/q/28699887
tags question: http://stackoverflow.com/q/28613361
tags question: http://stackoverflow.com/q/28678467
tags question: http://stackoverflow.com/q/28622701
tags question: http://stackoverflow.com/q/28604353
tags question: http://stackoverflow.com/q/28647196
tags question: http://stackoverflow.com/q/28608409
tags question: http://stackoverflow.com/q/28659148
tags question: http://stackoverflow.com/q/28609745
tags question: http://stackoverflow.com/q/28642352
tags question: http://stackoverflow.com/q/28660255
tags question: http://stackoverflow.com/q/28695587
tags question: http://stackoverflow.com/q/28623840
tags question: http://stackoverflow.com/q/28712469
tags question: http://stackoverflow.com/q/28678008
tags question: http://stackoverflow.com/q/28741089
tags question: http://stackoverflow.com/q/28599512
tags question: http://stackoverflow.com/q/28643513
tags question: http://stackoverflow.com/q/28654466
tags question: http://stackoverflow.com/q/28724960
tags question: http://stackoverflow.com/q/28728732
tags question: http://stackoverflow.com/q/28608659
tags question: http://stackoverflow.com/q/28606833
tags question: http://stackoverflow.com/q/28706485
tags question: http://stackoverflow.com/q/28633161
tags question: http://stackoverflow.com/q/28640395
tags question: http://stackoverflow.com/q/28695172
tags question: http://stackoverflow.com/q/28694205
tags question: http://stackoverflow.com/q/28732641
tags question: http://stackoverflow.com/q/28594468
tags question: http://stackoverflow.com/q/28683633
tags question: http://stackoverflow.com/q/28604444
tags question: http://stackoverflow.com/q/28624550
tags question: http://stackoverflow.com/q/28733526
tags question: http://stackoverflow.com/q/28618689
tags question: http://stackoverflow.com/q/28657664
tags question: http://stackoverflow.com/q/28731595
tags question: http://stackoverflow.com/q/28735543
tags question: http://stackoverflow.com/q/28693418
tags question: http://stackoverflow.com/q/28716193
type: Tag
tags question: http://stackoverflow.com/q/28612938
tags question: http://stackoverflow.com/q/28734700
tags question: http://stackoverflow.com/q/28718633
tags question: http://stackoverflow.com/q/28688115
tags question: http://stackoverflow.com/q/28634864
tags question: http://stackoverflow.com/q/28607560
tags question: http://stackoverflow.com/q/28746490
tags question: http://stackoverflow.com/q/28625267
tags question: http://stackoverflow.com/q/28646418
tags question: http://stackoverflow.com/q/28597820
tags question: http://stackoverflow.com/q/28710984
tags question: http://stackoverflow.com/q/28636920
tags question: http://stackoverflow.com/q/28621535
tags question: http://stackoverflow.com/q/28674704
tags question: http://stackoverflow.com/q/28636309
tags question: http://stackoverflow.com/q/28677109
tags question: http://stackoverflow.com/q/28715776
tags question: http://stackoverflow.com/q/28681067
tags question: http://stackoverflow.com/q/28732721
tags question: http://stackoverflow.com/q/28721409

http://stackoverflow.com/a/28631525
score: 2
accepted answer of: http://stackoverflow.com/q/28621624
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28621624
has body: on app/views/layouts/application.html In the middle of head tags. Sometimes is hard to identify something in the many things you need to learn about Rails.
upvote count: 2
type: Answer

http://stackoverflow.com/comment/45780251
type: Comment
type: QuestionComment
has text: They are all executed on the same onclick event. so its like this, onclick="buildYearsTable();rebuiltYearSelects(); etc.." I experience problems in IE because they aren't called in order or something.
score: 0
comment on: http://stackoverflow.com/q/28748910

http://stackoverflow.com/q/28615875
tagged with: javascript
score: 0
tagged with: netty
has answer: http://stackoverflow.com/a/28631112
has answer: http://stackoverflow.com/a/28616049
has title: socket.io, netty-socketio, nginx disconnecting every minute
tagged with: socket.io
type: AnsweredQuestion
tagged with: nginx
possible better answer: http://stackoverflow.com/a/28616049
accepted answer: http://stackoverflow.com/a/28631112
type: Question
has body: I have a netty-socketio server running on port 9092. nginx is configured to listen on port 9093 and proxy requests to the netty-socketio server (both are currently running on the same server but will be separate once in production). If I connect directly to the socket server everything works as expected, however when connecting via nginx connections drop and reconnect every one minute. Extremely simplified client example: &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script src="https://cdn.socket.io/socket.io-1.3.4.js"&gt;&lt;/script&gt; &lt;script&gt; var socket = io.connect('http://1.1.1.1:9093'); socket.on('connect', function () { console.log('connected to socket server'); }); socket.on('disconnect', function () { console.log('lost connection to socket server'); }); &lt;/script&gt; &lt;/head&gt; &lt;/html&gt; nginx config: upstream socketserver { server 127.0.0.1:9092; } server { listen 9093; location / { proxy_pass http://socketserver; proxy_http_version 1.1; proxy_pass_header Server; proxy_pass_header Connection; proxy_pass_header Date; } } The only difference I could find was the Connection: Upgrade header was set with an uppercase "U" when connecting directly and all lowercase ("upgrade") when using nginx. I went as far as recompiling nginx from the source but having uppercase "U" didn't make a difference. Any help would be greatly appreciated. Thanks.
answer count: 2
tagged with: websocket

http://stackoverflow.com/comment/45664323
type: Comment
comment on: http://stackoverflow.com/a/28685618
score: 0
type: AnswerComment
has text: Thank you! Also one last thing. So I want to say if the number is less then 18 I want to display you (there number) and you are under weight. I tried adding a If statement using the calculate variable. Is that the right way to go?

http://stackoverflow.com/comment/45495443
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28594269
has text: Try selecting Toyota, then Tacoma. Then select Chevrolet and notice that the model value is still Tacoma. It should clear as there isn't a valid selection. Screenshot: http://cl.ly/image/081B0l1e1G0h

http://stackoverflow.com/comment/46259631
type: AnswerComment
comment on: http://stackoverflow.com/a/28751626
type: Comment
score: 0
has text: I have another question on this if you want to get in on it http://stackoverflow.com/questions/29006996/angularjs-apostrophe-in-checkbox-ng-true-value

http://stackoverflow.com/q/28619911
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45542462
tagged with: logging
score: 2
has comment: http://stackoverflow.com/comment/45542509
type: Question
tagged with: function
downvote count: 0
has title: javascript adding code at the beginning and at the end of every function
tagged with: javascript
has body: for logging purpose i would like to launch a method at the beginning and at the end of every function. function myFunction1(){ //log.start() automatically doStaff(); //log.stop() automatically } is there any way to do that? Cheers
favorite count: 0
answer count: 0
has comment: http://stackoverflow.com/comment/45542470
upvote count: 2

http://stackoverflow.com/comment/45574538
type: AnswerComment
has text: In that case my answer was doing exactly what you need. You will get `[12, 4]` in `result` variable – providing the `array` from your original question.
type: Comment
comment on: http://stackoverflow.com/a/28635565
score: 0

http://stackoverflow.com/comment/45735444
has text: nothing wrong with using `date` as an object property name
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28723999

http://stackoverflow.com/a/28667595
has comment: http://stackoverflow.com/comment/45668503
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45674073
answers question: http://stackoverflow.com/q/28663517
has body: Check whether _DialogLayout.cshtml includes jQuery a second time (typically at the bottom). If so, you need to remove it. It replaces the current jQuery version, and as a result, the data cache you're accessing with .data("kendoWindow") is empty.

http://stackoverflow.com/q/28676345
accepted answer: http://stackoverflow.com/a/28676949
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45646440
has comment: http://stackoverflow.com/comment/45646416
possible better answer: http://stackoverflow.com/a/28676881
has answer: http://stackoverflow.com/a/28676881
type: AnsweredQuestion
has title: Gulp + JS libraries + JSON data
has comment: http://stackoverflow.com/comment/45646316
tagged with: javascript
has comment: http://stackoverflow.com/comment/45646250
tagged with: gulp
has body: I have a single-page webapp, for which I'm using various external JS files: libraries found via bower other libraries not shipped as bower packages (i.e. some other js scripts i have locally) A JSON file with some data My main.js file that integrates all the JS code Now, I'm trying to wrap my head around the best way to build and ship the JS component of such app. Normally I would just call such files via the &lt;script&gt;&lt;/script&gt; tag in the index.html, but in Gulp I'm kinda lost on what could actually be the best way. Should I bundle every JS file in a single file PLUS the JSON? If not, what is the best way to include a JSON file via gulp?
has comment: http://stackoverflow.com/comment/45646348
has answer: http://stackoverflow.com/a/28676949
type: Question
has comment: http://stackoverflow.com/comment/45646514
score: 0
has answer: http://stackoverflow.com/a/28857225
answer count: 3

http://stackoverflow.com/comment/45494662
score: 0
type: Comment
has text: Not really, sorry. And there is another issue. I have for sure links like abc.net/somesubsite/somesite but now this is not Ajax on page loaded anymore. It's now completely reloading the page, maybe that's the reason?
comment on: http://stackoverflow.com/a/28593765
type: AnswerComment

http://stackoverflow.com/a/28728919
type: Answer
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28726938
score: 3
has comment: http://stackoverflow.com/comment/45747042
has body: //Considering that you might have more than one pair of table-chart, //get the list of tables, and iterate over the charts. var tables = $('table'); $.each(Highcharts.charts, function(chartIdx, chartElement) { //Get the current chart var chart = Highcharts.charts[chartIdx]; //Get the current rows var rows = $(tables[chartIdx]).find('tr'); //Iterate over each row rows.each(function(idx, element) { //Get the chart serie (assuming there is only one) var serie = chart.series[0]; //Get the chart data corresponding to this row var data = serie.data[idx]; //Attach mouseover event to it $(this).on('mouseover', function(event) { //Simulates the hover event on it, as a way to highlight it //Credits to http://stackoverflow.com/a/11318136/1064325 data.setState('hover'); //Makes the tooltip for the simulated hover //Credits to http://stackoverflow.com/a/14650436/1064325 chart.tooltip.refresh(data); }); //Attach mouseleave event to it $(this).on('mouseleave', function(event) { //Removes the hover event simulation on it //Credits to http://stackoverflow.com/a/11318136/1064325 data.setState(); //Makes the tooltip for the simulated hover //Credits to http://stackoverflow.com/a/20988150/1064325 chart.tooltip.hide(); }); }); }); Make sure to execute this code after the creation of the charts. You can see a working fiddle here!
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45775033
downvote count: 0
answers question: http://stackoverflow.com/q/28726938
has comment: http://stackoverflow.com/comment/45747183

http://stackoverflow.com/q/28639314
has comment: http://stackoverflow.com/comment/45578215
has comment: http://stackoverflow.com/comment/45578189
accepted answer: http://stackoverflow.com/a/28639549
tagged with: javascript
favorite count: 0
has body: I'm doing an exercise and I'm having some issues with the code. I spend some time figuring out the rock paper scissors formula using differentials instead of typing each scenario with an if. But I'm having some issues trying to make it work in www.repl.it var rock = 0 var paper = 1 var scissors = 2 var computerMove = rock; var playerMove = paper; function getWinner(playerMove,computerMove) { var winner; if (computerMove == playerMove){ console.log("draw") } else if ((playerMove - computerMove + 3) % 3 == 1){ var winner = "player" } else { winner = "computer" } return winner; } I've never used functions before, I know the formula is right to determine the winner, but I can't get anything assigned to the variable "winner". I don't get any errors here but winner seems to contain nothing. Any help?
has title: Rock Paper Scissors function not returning an appropriate result
score: -2
possible better answer: http://stackoverflow.com/a/28639430
answer count: 4
has answer: http://stackoverflow.com/a/28639434
has answer: http://stackoverflow.com/a/28639430
upvote count: 2
has comment: http://stackoverflow.com/comment/45578098
has comment: http://stackoverflow.com/comment/45578092
type: Question
has comment: http://stackoverflow.com/comment/45599429
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28639516
has answer: http://stackoverflow.com/a/28639549
has comment: http://stackoverflow.com/comment/45578093
has comment: http://stackoverflow.com/comment/45578163
downvote count: 4

http://stackoverflow.com/q/28612675
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28618164
tagged with: momentjs
type: Question
has title: Moment.js run on server time
tagged with: javascript
score: 0
answer count: 1
has body: Ok so I'm using Moment.s js and it works just as it should except I don't know how to make it run on server time. Right now it runs based on local time. Took me a while to even find the script which displays server time and that's where my journey ends. I tried what made sense to me but no luck. I have no idea on how to "incorporate" this moment.js code that I got earlier today to be able to run on server time. As I said, it works as it should, all except I want it to run on server time(hostgator) instead of local time. <script"> // use Moment.js to display current date in a div (.displayMoment) var inputDiv = document.getElementsByClassName('inputDiv'); var eDisplayMoment = document.getElementsByClassName('displayMoment'); for(i=0;i<=inputDiv.length;i++) { eDisplayMoment[i].innerHTML = moment(inputDiv[i].innerHTML, "YYYY-MM-DD hh:mm:ss").fromNow(); } 2015-02-17 15:31:00 serverDate.js Code which displays server time, got from Link Your time is appreciated

http://stackoverflow.com/comment/45702044
score: 0
has text: Agreed - if you're trying to show a series of documents that have all been filtered for the search, that definitely wouldn't work.
comment on: http://stackoverflow.com/a/28703266
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45715649
has text: Do you seriously think the first dropdown has an option with ` Some text `?
type: Comment
comment on: http://stackoverflow.com/a/28713223
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45729378
has text: @JohnAndrews Ok, well it looks like you're getting the values out at the end, so it's probably an issue of the way your view HTML is set up. Could you show me the `ng-repeat` part of your view that's for the images, and everything inside it?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28720318

http://stackoverflow.com/comment/45730566
comment on: http://stackoverflow.com/q/28721631
type: Comment
score: 0
has text: @dowomenfart I try this but you can see. If i use `.image_container a:nth-child(n+2){display:none;}` and if .image_container div has 1 image then that image automatically `display:none;`
type: QuestionComment

http://stackoverflow.com/a/28622783
answers question: http://stackoverflow.com/q/28622668
has comment: http://stackoverflow.com/comment/45547619
has comment: http://stackoverflow.com/comment/45547345
has body: The problem is the escaping of " in the stringified json data. $('.usr').click(function () { var user = $(this).text(); $.post("three.htm", { user: user }, function (data) { console.log(JSON.stringify(data)); //window.location.replace('five.htm'); var $form = $('&lt;form action="five.htm" method="post" /&gt;'); $('&lt;input/&gt;', { type: 'hidden', name: 'usrData', value: JSON.stringify(data) }).appendTo($form) $('body').append($form); $form.submit(); }); }); For example, if your data is {test:3}, then the string you are constructing will be &lt;form action="five.htm" method="post"&gt;&lt;input type="hidden" name="usrData" id="usrData" value="{"test":3}" /&gt;&lt;/form&gt;, now if you look at the value attribute you can see that the " of the value o prematurely terminated. But really, do you need a form submit like that, why don't use use a simple ajax post request?
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28622668
type: Answer
upvote count: 1

http://stackoverflow.com/comment/45544020
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28620766
type: Comment
has text: I tried removing the action and using $http.post instead but then the files parameter in form.parse returns an empty object. So I'm assuming when I use the action attribute, the action attribute manually populates the files object. I also thought of using res.redirect so I guess I could use req.headers.host + '/path'. I was hoping someone knew of another way unless this is the optimal method. Thanks for your answer, I'm going to wait a while before choosing this

http://stackoverflow.com/q/28641430
answer count: 1
has title: JavaScript For Loop - execution termination condition
tagged with: javascript
has body: I was looking at source code of Ext object in ExtJs docs here and I noticed this for loop: for (j = enumerables.length; j--;) { k = enumerables[j]; if (config.hasOwnProperty(k)) { object[k] = config[k]; } } So, normally in a for loop, we have do initialization, specify condition and then increment/decrement the counter. I do see an initial condition and j-- which decrements the counter after each iteration. However, what I can't figure out is how is the loop going to be terminated? I neither see any condition nor a break keyword that will terminate the loop. What am I missing here?
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28641453
accepted answer: http://stackoverflow.com/a/28641453
score: 0

http://stackoverflow.com/comment/45620932
comment on: http://stackoverflow.com/a/28659328
has text: @Cameron may why you don't use a comment restriction. Its a simple solution.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28660605
has answer: http://stackoverflow.com/a/28680440
type: Question
has title: Why I can't access component state in render in reactjs
tagged with: reactjs
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: reactjs-flux
favorite count: 0
has comment: http://stackoverflow.com/comment/45617005
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45616857
upvote count: 1
has comment: http://stackoverflow.com/comment/45616897
has body: Trying to learn react.js I was trying to set the state of the component in getInitialState and access it in render using this.state.myproperty but seems I am doing something silly wrong .Here is what I have done so far. app.jsx this is my entry point var React = require('react'); var App = require('./components/App'); React.render( &lt;App /&gt;, document.getElementById('content') ); /components/App.jsx var React = require('react'); var UserStore = require('../stores/UserStore'); var ActionCreator = require('../actions/Actions'); var UserApp = require('./UserApp'); var App = React.createClass({ propTypes: { users: React.PropTypes.array, }, getInitialState: function() { ActionCreator.loadUsers(); return UserStore.getState(); }, render: function(){ var users = this.state.users; console.log(this.state);// see what is in the state console.log(users); // see what is in users return( &lt;UserApp users = {users}/&gt; ); }, }); module.exports = App; Action creator var AppDispatcher = require('../dispatcher/AppDispatcher'); var Constants = require('../constants/Constants'); var ApiClient = require('../clients/ApiClient'); var ActionTypes = Constants.ActionTypes; var Actions = { loadUsers: function(){ ApiClient.getUsers(function(usersObj) { AppDispatcher.handleServerAction({actionType:ActionTypes.LOAD_USERS_SUCCESS, usersObj: usersObj}); }.bind(this), function(error) { AppDispatcher.handleServerAction({actionType:ActionTypes.LOAD_USERS_FAIL, error: error}); }.bind(this)); }, }; module.exports = Actions; Here is what I see in console Why I can't access users from state or am I doing it in wrong way ?
score: 1

http://stackoverflow.com/a/28620072
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28619894
score: 3
upvote count: 3
has body: First you need to add an app and a controller where you will implement your logic. The aplication logic goes in the controllers. Aviod putting it in the templates. Example: template Save update controller var myApp = angular.module('myApp',[]); function MyCtrl($scope) { $scope.btn_save = function(){ alert("Button save clicked!") } } Is here, in the controller where you will implement the btn_save logic. In this case, the function throw an alert dialog when user clicks on button. Here is the fiddle https://jsfiddle.net/xeq23e19/ Hope that helps.

http://stackoverflow.com/a/28648658
answers question: http://stackoverflow.com/q/28645486
type: Answer
has comment: http://stackoverflow.com/comment/45596307
has body: For each image, create a javascript object containing the image url and its x,y position and push those objects into an array. var images=[]; images.push({x:10,y:20,url:{'myImage1.png'}); images.push({x:10,y:20,url:{'myImage2.png'}); Then turn that array into a string using JSON.stringify and save that string to your database. var imageDefinitions = JSON.stringify(images); // now push the imageDefinitions string into your database (maybe use AJAX) jquery.post(...url to post the imageDefinitions string...); When you want to recreate your scene by drawing the images, fetch the imageDefinitions from your database and recreate the images array using JSON.parse. // now pull the imageDefinitions from your database (maybe use AJAX) var imageDefinitions=jQuery.get(...url to GET the imageDefinitions string...); var images=JSON.parse(imageDefinitions); And use this array to create your new Image() objects and then create your Kinetic objects.
score: 0
has comment: http://stackoverflow.com/comment/45596244
accepted answer of: http://stackoverflow.com/q/28645486
type: AcceptedAnswer

http://stackoverflow.com/q/28651243
has answer: http://stackoverflow.com/a/28651274
has title: How do I add xml in HTML 5 document?
score: 0
has answer: http://stackoverflow.com/a/28652120
tagged with: javascript
tagged with: jquery
has body: Is it possible to add xml data in a html document? like &lt;xml&gt; &lt;fruits&gt; &lt;apple color="red" /&gt; &lt;peach color="link" /&gt; &lt;/fruits&gt; &lt;/xml&gt; and access it with jQuery?
has answer: http://stackoverflow.com/a/28651364
answer count: 3
possible better answer: http://stackoverflow.com/a/28652120
tagged with: http://stackoverflow.com/tag/xml
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/28651364

http://stackoverflow.com/q/28612403
has comment: http://stackoverflow.com/comment/45529679
has title: D3.js How to dynamically assign years in javascript functions using drop down box
tagged with: d3.js
type: UnansweredQuestion
answer count: 0
has body: I had developed D3.js line chart using javascript functions,i had selected dropdown box in years but first one will be shown but remaining was unable shown,i had wrote given data. var data=[{"key":[2000,0],"value":100},{"key":[2000,1],"value":200},{"key":[2001,0],"value":300},{"key":[2001,1],"value":400}]; Choose a year 2000 2001 var years=2000; function funMonths(){ var arr=[]; for(i in data){ var obj={}; obj.key=new Date(data[i].key[0],data[i].key[1]) obj.value=data[i].value; if(data[i].key[0]==years){ arr.push(obj) } } return arr; } var funName=funMonths(); console.log(funName); How to dynamically assign years in javascript functions when click in the drop down box. function line2ChartFun(){ d3.select("#year") .call(funMonths()) }
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45529502
score: 0

http://stackoverflow.com/comment/45572957
has text: The Caprica org chart plugin uses jquery to turn a list into a html table. This is great, but a nested li (a node with lots of children can mean the chart gets very wide) I want to stack the 3rd level like the image.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28636365
score: 0

http://stackoverflow.com/q/28732670
tagged with: package
tagged with: node.js
score: 2
type: AnsweredQuestion
tagged with: npm
upvote count: 3
downvote count: 1
has answer: http://stackoverflow.com/a/29132999
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28744915
has answer: http://stackoverflow.com/a/28744915
answer count: 3
has title: Getting recently updated packages
accepted answer: http://stackoverflow.com/a/29132999
has body: Use case: Imagine there is the following package.json: { "version": "0.0.1", "private": true, "name": "my-app", "devDependencies": { "connect-modrewrite": "*", "csslint": "~0.10.0", "eslint": "*", ... } And eslint maintainers issued a new package update, which my daily build task has installed via npm install among other packages. And suddenly the build task fails. Now, while researching the reasons for a build failure, I want to know if there was a dependency package update that could be a culprit of a daily build failure. Desired result/output: eslint 0.15.0 02/15/2015 connect-modrewrite 0.2.0 01/15/2015 ... Basically, I need a list of my project dependencies with a version date. Is it possible to get this kind of meta information with npm or a third-party tool like npm-check? There is a Recently updated packages page which is exactly what I'm looking for, but in the context of my package.json list of dependencies. I'm aware about the "avoid surprises" best practices that suggest to list an exact version number for every dependency and upgrade packages cautiously and on-demand.
has answer: http://stackoverflow.com/a/29104122
favorite count: 0

http://stackoverflow.com/comment/45507921
score: 0
has text: Please don't suggest setting async to false. That's just a lazy workaround.
type: AnswerComment
comment on: http://stackoverflow.com/a/28601191
type: Comment

http://stackoverflow.com/q/28644326
downvote count: 0
has title: Javascript _.reduce() exercise
score: 1
has answer: http://stackoverflow.com/a/28644427
has answer: http://stackoverflow.com/a/41231377
type: Question
has body: Please help; I'm trying to solve this problem: Write a function that takes an array of names and congratulates them. Make sure to use _.reduce as part of the function. input: ['Steve', 'Sally', 'George', 'Gina'] output: 'Congratulations Steve, Sally, George, Gina!' Here's what I have so far, but doesn't work: var myArray = _.reduce(['Steve', 'Sally', 'George', 'Gina'], function(current, end) { return 'Congratulations' + current + end; });
has answer: http://stackoverflow.com/a/28644368
tagged with: javascript
has comment: http://stackoverflow.com/comment/45586714
has answer: http://stackoverflow.com/a/39098377
upvote count: 1
has comment: http://stackoverflow.com/comment/45586736
favorite count: 0
answer count: 5
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/56508022
tagged with: reduce

http://stackoverflow.com/a/28717530
upvote count: 1
score: 1
has body: Solution1 : scope.$watch('stage', function(condition){ var templateUrl; if(stage === 'welcome'){ templateUrl = "hello.html"; } else{ templateUrl = "someothertemplate.html"; }; //load the template; $http.get(templateUrl) .then(function (response) { // template is loaded. // add it and compile it. angular.element(element).html(response.data); $compile(element.contents())(scope); }); }); Solution2: Use ng-include &lt;div test stage="dynamicstage"&gt; &lt;div ng-include="templateUrl"&gt;&lt;/div&gt; &lt;/div&gt; Inside directive: scope.$watch('stage', function(condition){ var templateUrl; if(stage === 'welcome'){ templateUrl = "hello.html"; } else{ templateUrl = "someothertemplate.html"; }; scope.$parent.templateUrl = templateUrl; // make sure that templateUrl is updated in proper scope })
downvote count: 0
answers question: http://stackoverflow.com/q/28717328
type: Answer

http://stackoverflow.com/a/28877942
has body: I did solve it by changing the handsontable.full.js "this.sort" function I have 1 fixed row, so before start sorting I spliced the first row and saved it in variable. I let the original sort to run and sort my data , then before return from sort function I did add the saved first row to my data array My Solution : // handsontable.full.js -- built in sort function this.sort = function () { var instance = this; if (typeof instance.sortOrder == 'undefined') { return; } instance.sortingEnabled = false; //this is required by translateRow plugin hook instance.sortIndex.length = 0; var colOffset = this.colOffset(); for (var i = 0, ilen = this.countRows() - instance.getSettings()['minSpareRows']; i &lt; ilen; i++) { this.sortIndex.push([i, instance.getDataAtCell(i, this.sortColumn + colOffset)]); } // Custom Sorting - Saving First Row var firstRow = this.sortIndex[0]; // Remove first Row from data this.sortIndex.shift(); /////// Original Sort Begin///////// var colMeta = instance.getCellMeta(0, instance.sortColumn); var sortFunction; switch (colMeta.type) { case 'date': sortFunction = dateSort; break; default: sortFunction = defaultSort; } this.sortIndex.sort(sortFunction(instance.sortOrder)); ////// Original Sort END ///////// // Custom Sorting - Adding the fixed row to the TOP this.sortIndex.unshift(firstRow); //Append spareRows for(var i = this.sortIndex.length; i &lt; instance.countRows(); i++){ this.sortIndex.push([i, instance.getDataAtCell(i, this.sortColumn + colOffset)]); } instance.sortingEnabled = true; };
downvote count: 1
score: 2
upvote count: 3
has comment: http://stackoverflow.com/comment/64297893
accepted answer of: http://stackoverflow.com/q/28718223
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46986046
answers question: http://stackoverflow.com/q/28718223
type: Answer

http://stackoverflow.com/comment/45754456
comment on: http://stackoverflow.com/q/28734023
has text: @HogRider. The real question is how your data (table) generated. The table you are talking about is generated by same project or using some third party tool or data?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45612182
comment on: http://stackoverflow.com/q/28656583
score: 0
type: Comment
type: QuestionComment
has text: Why would you want to do that?

http://stackoverflow.com/a/28720834
has comment: http://stackoverflow.com/comment/45729209
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28720337
score: 7
accepted answer of: http://stackoverflow.com/q/28720337
upvote count: 7
has comment: http://stackoverflow.com/comment/45729129
has body: use moment.js: var date = moment("13.02.2015 12:55", "DD.MM.YYYY HH.mm").toDate(); Update 2022-05-28: Meanwhile the project status of moment.js has changed. Therefore I strongly suggest to read https://momentjs.com/docs/#/-project-status/ and observe the recommendations.

http://stackoverflow.com/comment/45683321
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28692914
has text: I don't know Qunit, but assuming that it registers its own `then` handler to be notified of resolution, promises would guarantee to execute the assertion before that.
score: 0

http://stackoverflow.com/comment/45705552
type: Comment
comment on: http://stackoverflow.com/a/28699272
type: AnswerComment
score: 0
has text: ahh, in chart options it works. Is there no chance on series level? And it is possible to display "Diff" just under Hamburg?

http://stackoverflow.com/q/28666380
accepted answer: http://stackoverflow.com/a/28751019
tagged with: javascript
score: 0
tagged with: key-value
tagged with: expressionengine
has title: JS and ExpressionEngine - Remove KV pairs by duplicate values only?
has answer: http://stackoverflow.com/a/28751019
has answer: http://stackoverflow.com/a/28666476
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28666476
type: Question
answer count: 2
has body: We're building a site with ExpressionEngine. We are running a SQL query to gather up all member IDs for a specific member group. After that, we are using EE tags to get data from a custom member field for each member ID. The ID and field data need to stay paired, as we will be populating a drop-down so that the ID is the value and the field data is the text, so we are currently putting them into a JS array as key/value pairs. The call is as follows: var array= [ {exp:query sql="SELECT * FROM exp_members WHERE group_id = 5"} {exp:member:custom_profile_data member_id="{member_id}"} {if company != ''} {{member_id}:"{company}"}, {/if} {/exp:member:custom_profile_data} {/exp:query} }; This gives us the output: var array = [ {1:"name01"}, {2:"name02"}, {3:"name01"}, {4:"name03"} ]; Now, our problem. We need to remove objects based on duplicate field data (values) only, so the above array would look like this: var array = [ {1:"name01"}, {2:"name02"}, {4:"name03"} ]; None of these IDs (keys) will ever be the same, but the field data (values) can be. So we want to keep the first KV pair that comes through with a unique value, but remove any subsequent dupes of that value - despite the fact that they will not be true "duplicate values" due to a different ID (key). Keeping in mind that the KV pairs are all dynamic, is there any possible way to do this via JS so we can create a new array for the cleaned data to pass to the drop-down?
tagged with: arrays

http://stackoverflow.com/comment/45721767
type: Comment
has text: Yeah I know, But the client really wants that the right click to be disabled. I have managed to add the attribute to the iframe but this does not disable it. However if i add the oncontextmenu on the img tag in google inspector i get the result I am looking for. So i am trying to add it to the img tag in the iframe rather then on the iframe itself because that is not working
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28716346

http://stackoverflow.com/a/52079048
has comment: http://stackoverflow.com/comment/105745522
score: 0
has body: The other answers don't clarify the issue. The YouTube api is confusing for sure! This is because the YT.Player constructer returns a dom reference to the iframe of the youtube player not to the YT player object. In order to get a reference to the YT player we need to listen to the onReady event. var ytPlayer; var videoIframe = new YT.Player('player', { videoId: 'xxxxxxx', // youtube video id playerVars: { 'autoplay': 0, 'rel': 0, 'showinfo': 0 }, events: { 'onStateChange': onPlayerStateChange, 'onReady': function (ev) { ytPlayer = ev.target; } } });
type: Answer
answers question: http://stackoverflow.com/q/28633421

http://stackoverflow.com/comment/45623663
type: QuestionComment
comment on: http://stackoverflow.com/q/28664217
score: 0
has text: Its a strange layout choice (having the scrollbar on the opposite side of the page than the thing you are scrolling) but essentially you want to 'position:fixed' the _right_ side of your page, and remove fixed from the left hand side. Then, the body scroll bar will end up controlling the left side while the right section stays still. You'll run into problems fast though if you make it responsive...
type: Comment

http://stackoverflow.com/comment/45779529
comment on: http://stackoverflow.com/q/28748568
type: QuestionComment
has text: I believe he means the relevant jQuery that you attempted that did not work.
score: 0
type: Comment

http://stackoverflow.com/q/28718225
tagged with: internet-explorer-8
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45727864
has title: jquery append not workign in IE8
has comment: http://stackoverflow.com/comment/45727312
has comment: http://stackoverflow.com/comment/45724140
has comment: http://stackoverflow.com/comment/45727727
answer count: 0
has comment: http://stackoverflow.com/comment/45727814
tagged with: javascript
tagged with: jquery
type: Question
has comment: http://stackoverflow.com/comment/45727159
tagged with: append
score: 0
tagged with: wordpress
has body: Im using Fullscreen Galleria Wordpress Plugin and on IE8 It does not work. Does not generate the images thumbnails. After some searching I figure out the problem is the "append" function. Here is the part of code with problem: var size = Math.floor(box * BOX - 2 * BORDER); var img = fsg_json[ID][photo]['image']; var imgid = fsg_json[ID][photo]['id']; var w = fsg_json[ID][photo]['full'][1]; var h = fsg_json[ID][photo]['full'][2]; //console.log(size, y, x, y * BOX, x * BOX); var $div = $('&lt;div style="width: ' + size + 'px; height: ' + size + 'px; top: ' + y * BOX + 'px; left: ' + x * BOX + 'px; margin: ' + BORDER + 'px;"&gt;'); var $a = $('&lt;a data-postid="' + ID + '" data-imgid="' + imgid + '" href="' + img + '"&gt;'); $($a).click(fsg_show_galleria); // - Find best img var a = ["thumbnail", "medium", "large", "full"]; for (var s in a) { min = Math.min(fsg_json[ID][photo][a[s]][1], fsg_json[ID][photo][a[s]][2]); if (min &gt; size) { img = fsg_json[ID][photo][a[s]][0]; w = fsg_json[ID][photo][a[s]][1]; h = fsg_json[ID][photo][a[s]][2]; break; } } var min = Math.min(w, h); var m = size / min; w = w * m; h = h * m; var imgx = -Math.floor((w - size) / 2.0); var imgy = -Math.floor((h - size) / 2.0); var $img = $('&lt;img style="left: ' + imgx + 'px; top: ' + imgy + 'px;" width="' + w + '" height="' + h + '" src="' + img + '"&gt;'); $a.append($img); $div.append($a); $(this).append($div); ++d; As you can see the code uses append to build the output HTML. Im not a javascript skilled programer so can you please help me out. Can I use other function other then append? Thank you.

http://stackoverflow.com/a/28670105
upvote count: 2
has comment: http://stackoverflow.com/comment/45639139
has comment: http://stackoverflow.com/comment/45642764
has comment: http://stackoverflow.com/comment/45639307
has comment: http://stackoverflow.com/comment/45642699
accepted answer of: http://stackoverflow.com/q/28669830
has comment: http://stackoverflow.com/comment/45634278
answers question: http://stackoverflow.com/q/28669830
has comment: http://stackoverflow.com/comment/45649724
has body: It seems that jQuery addClass/removeClass/toggleClass do not work with SVG elements. There is a ticket on jQuery but it is closed and it 'won't fixed'. You can use d3.selectAll('#familytreecontentsvg.node').classed('fixed', false) or the good old jQuery.attr. So your code should be like this: $("#familytreeUnfixallbutton").click(function() { $( "#familytreecontentsvg .node" ).css( "border", "3px solid red" ); d3.selectAll('#familytreecontentsvg.node').classed('fixed', false) }); Hope this helps.
has comment: http://stackoverflow.com/comment/45638352
score: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45649828
has comment: http://stackoverflow.com/comment/45651310
downvote count: 0
has comment: http://stackoverflow.com/comment/45639439
type: Answer
has comment: http://stackoverflow.com/comment/45642282

http://stackoverflow.com/comment/45733304
type: QuestionComment
has text: Ok the other once are: property X is a property of an Ember.Object which is set on the surrounding content in this case a controller. And propertyY is another property of that same object. Both are not set on init.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28722075

http://stackoverflow.com/a/28665837
answers question: http://stackoverflow.com/q/28665764
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 6
has body: This is a feature called destructuring assignment in ES6. This is what happens: // Imagine this is the object you require var reactRouter = { create: 'foo', HistoryLocation: 'bar', HashLocation: 'baz' } // Destructure var {create: createRouter, HistoryLocation, HashLocation} = reactRouter // Now the variables are in scope console.log(createRouter, HistoryLocation, HashLocation) //^ foo, bar, baz
accepted answer of: http://stackoverflow.com/q/28665764
upvote count: 6

http://stackoverflow.com/comment/45514971
comment on: http://stackoverflow.com/q/28605147
score: 3
type: Comment
type: QuestionComment
has text: By the way, ` ` is a self-closing element, so you should be referencing ` `...

http://stackoverflow.com/a/28687433
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28685398
answers question: http://stackoverflow.com/q/28685398
type: Answer
has body: solved!! this is the solution change this line &lt;script type="text/javascript"&gt; //called when user clicks login function login() { $("#main-pages").val($("#pages").val()); $("#main-sub-pages").val($("#sub-pages").text()); $(".category-modal").modal("hide"); } $('.category-modal').on('hidden', function() { console.log('page : '+$("#main-pages :selected").val()); console.log('sub-page : '+$("#main-sub-pages :selected").text()); }); &lt;/script&gt; to this &lt;script type="text/javascript"&gt; //called when user clicks login function login() { var subPagesSelect = document.getElementById("sub-pages"); var selectedText = subPagesSelect.options[subPagesSelect.selectedIndex].text; $("#main-pages").val($("#pages").val()); $("#main-sub-pages").val(selectedText); $(".category-modal").modal("hide"); } $('.category-modal').on('hidden', function() { console.log('page : '+$("#main-pages :selected").val()); console.log('sub-page : '+$("#main-sub-pages :selected").text()); }); &lt;/script&gt; why i got all dropdown content, because what i call was an object not content of that object Correct me if im wrong

http://stackoverflow.com/q/28603699
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45513145
type: Question
has comment: http://stackoverflow.com/comment/45512853
tagged with: encoding
has answer: http://stackoverflow.com/a/28604210
accepted answer: http://stackoverflow.com/a/28604210
tagged with: javascript
tagged with: gruntjs
score: 0
has title: AngularJS/Grunt encoding issue
answer count: 1
has body: I'm using grunt serve to serve my angular app, but I've got an encoding issue... I have a fake json which I read locally using $http service, this json contains strings with "special" characters (like "è", "ì"...) that are not rendered properly. In my html page I defined: &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt; &lt;meta charset="utf-8" /&gt; And I also configured explicitly angular to require that encoding: config(['$httpProvider', function($httpProvider) { $httpProvider.defaults.headers.common['Content-Type'] = 'application/json; charset=utf-8'; $httpProvider.defaults.headers.common['Accept'] = 'application/json; charset=utf-8'; }]); but the characters are still "broken"... what should I do? Is perhaps this issue something related to Grunt?
tagged with: angularjs

http://stackoverflow.com/a/28678477
answers question: http://stackoverflow.com/q/28678315
has body: You can do in in 2 ways: a) case sensitive if (a === b) { // the strings are the same text in the same case } Remember to use === operator, as it means that a and b are same type and value. Operator == will compare only values. b) case insensitive - check if both values are given if ( (a &amp;&amp; b) &amp;&amp; // optionally to ensure both values are defined:) (a.toLowerCase() === b.toLowerCase()) ) { // the strings are the same text but in a different case }
score: 0
type: Answer

http://stackoverflow.com/comment/45562125
comment on: http://stackoverflow.com/q/28631053
score: 0
has text: this is the html markup for remove button
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28730737
has answer: http://stackoverflow.com/a/28731201
type: AnsweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/45779103
possible better answer: http://stackoverflow.com/a/28731135
tagged with: express
accepted answer: http://stackoverflow.com/a/28731201
has answer: http://stackoverflow.com/a/28731135
tagged with: angularjs
type: Question
tagged with: node.js
has title: Attaching persistent active classes to navigation elements in navbar scope (AngularJS)
linked to: http://stackoverflow.com/q/20047489
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45748336
has comment: http://stackoverflow.com/comment/45778987
has body: So I have a navigation list element and I want AngularJS to store which tab is active, then add the 'active' class to that tab any time a reroute happens. I am trying to simply print the active tab's name to the log currently. I haven't linked a function in the 'link' option of a directive before, so my syntax may be wrong. My navigation directive: navigation.$inject = ['$modal', 'localStorageService', '$log'] function navigation ($modal, localStorageService, $log) { var vm = this; return { restrict: 'EA', templateUrl: '/common/directives/navigation/navigation.template.html', link : function ($scope, $log, localStorageService) { $scope.setActive = function (tab) { $scope.active = tab; $log.debug($scope.active); } } }; } My HTML (one of my 'pagination' navigation elements): Connect Wise At this point I'm just trying to access whats in link, and print the variable passed into my directive's 'link' function to the console in the browser. This seems like it should be very easy but I can't figure it out for the life of me. EDIT: I should add, my current approach is based on this: How to define a function inside Angular-js Directive
tagged with: dom
linked to: http://stackoverflow.com/q/22219315

http://stackoverflow.com/q/28696330
has comment: http://stackoverflow.com/comment/45684532
favorite count: 0
has comment: http://stackoverflow.com/comment/45683376
has title: AJAX/JavaScript search performance better than Java/Oracle
has answer: http://stackoverflow.com/a/28708387
accepted answer: http://stackoverflow.com/a/28708387
has comment: http://stackoverflow.com/comment/45683181
type: AnsweredQuestion
tagged with: performance
has comment: http://stackoverflow.com/comment/45683303
has comment: http://stackoverflow.com/comment/45684294
has comment: http://stackoverflow.com/comment/45684321
downvote count: 0
score: 1
tagged with: java
has comment: http://stackoverflow.com/comment/45684272
has comment: http://stackoverflow.com/comment/45683855
has body: I work with a very large, enterprise application written in Java which queries an Oracle SQL database. We use JavaScript on the front end, and are always looking for ways to improve upon the performance of the application with increased use. The issue we're having right now is that we are sending a query, via Java, that results in 39,000 records. This is putting a significant load on the server and causes the browser to hang. I should mention that the data is relatively static (only changes about once a year) and we could use an xml map or something similar (flat file) since we know the exact results that will be returned each time. The query, however, is still taking 1.5 - 2 minutes to load, which is unacceptable. I wanted to see if there were any suggestions as to how this scenario can be optimized, especially if it can be done any quicker with JavaScript (or jQuery) and using AJAX for the db connection. Or, are we going about this problem all wrong?
type: Question
has comment: http://stackoverflow.com/comment/45684853
tagged with: javascript
tagged with: ajax
tagged with: oracle-database
has comment: http://stackoverflow.com/comment/45684617
upvote count: 1
answer count: 1

http://stackoverflow.com/comment/45557047
score: 1
comment on: http://stackoverflow.com/q/28628313
has text: that is why chrome is better than IE browsers. Although they have their own implementations of specific methods.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28736965
downvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28736829
has comment: http://stackoverflow.com/comment/45758039
has body: Or you can try jQuery: $('#'menuArea a'); About class, try this: var d = document.getElementById('menuArea').getElementsByTagName('a') d.className = d.className + " otherclass"; This is pure JavaScript.
score: 0
upvote count: 1

http://stackoverflow.com/comment/45807296
comment on: http://stackoverflow.com/a/28733083
type: Comment
has text: Excellent, just exactly what I need. Now the site is very interactive.
score: 0
type: AnswerComment

sequelize.js
type: Tag
tags question: http://stackoverflow.com/q/28628564
tag name: sequelize.js
tags question: http://stackoverflow.com/q/28643775

http://stackoverflow.com/comment/46069522
has text: I must use dnn as cms. Dnn is web forms based. And I want to avoid usage of asp controls or use it as low as I can. I must build app to be very responsive that is why I want to avoid large viewstates. But if this is unnatural maybe I should try to force move to asp mvc. But my first thought is like in question: web forms for view + ajax to web api for backend.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28659622

http://stackoverflow.com/q/28680572
answer count: 1
tagged with: model-view-controller
has body: i am a newbie in Emberjs.. I am trying to set data content from Emberjs route to controller to display in template.. i followed the suggestions here.. Access content inside a controller function ember works perfect.. but now i am getting this error Uncaught Error: Assertion Failed: The value that #each loops over must be an Array. You passed {items: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object], title: current mood} edit: here is also my code.. http://screencast.com/t/4fXm5n5u9lpH and here is my template code http://screencast.com/t/horNlooKx8l any feedback would be appreciated thanks
has answer: http://stackoverflow.com/a/28681041
linked to: http://stackoverflow.com/q/15893833
downvote count: 0
has comment: http://stackoverflow.com/comment/45654750
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28681041
has title: setting data from route to controller error in Emberjs
has comment: http://stackoverflow.com/comment/45654033
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45654171
tagged with: ember.js
score: 1
favorite count: 0
type: Question
tagged with: frontend
upvote count: 1

http://stackoverflow.com/q/28736123
linked to: http://stackoverflow.com/q/750486
duplicate of: http://stackoverflow.com/q/750486
tagged with: javascript
type: UnansweredQuestion
answer count: 0
downvote count: 0
score: 1
favorite count: 0
type: Question
has body: Working with NodeJS calling to an HTTP API I encountered a weird behavior. I had an API call which returns an array of IDs, and on each of those IDs I needed to make another HTTP request with the ID as the parameter. I ended up with this code: http.get("/getPersons", function(persons) { for(var i = 0; i &lt; persons.length; i++) { var count = 0; http.get("/getPersonAddress?id=" + persons[i].id, function(address) { persons[i].address = address; count++; if(count == persons.length) { res.end(JSON.stringify(persons)); } }); } }); Now since the loop finishes before all of the HTTP requests received a response, i will be equal persons.length + 1, and it looks like that i variable passed to the callback function is passed by reference and not by value because when I run this code it complains that persons[i].address is undefined, and when I look at i at this moment I see it equals persons.length + 1 instead of the value of i in the moment http.get gets called. How would you normally solve this?
tagged with: asynchronous
tagged with: node.js
has title: Are JavaScript function "super-scope" variables passed by reference?
upvote count: 1

http://stackoverflow.com/a/28656826
answers question: http://stackoverflow.com/q/28603819
score: 0
type: Answer
has body: finally found a solution, I am sure not the most elegant but it works: function sendMail(tomail, subject, fill_cell, messageTemplate, EMAIL_SENT) { MailApp.sendEmail(tomail, subject,'', {htmlBody: messageTemplate}); fill_cell.setValue(EMAIL_SENT); SpreadsheetApp.flush(); } function sendMailwAtt(tomail, subject, fill_cell, messageTemplate, EMAIL_SENT, fileAttach) { MailApp.sendEmail(tomail, subject,'', {htmlBody: messageTemplate, attachments: [fileAttach.next()]}); fill_cell.setValue(EMAIL_SENT); SpreadsheetApp.flush(); }

http://stackoverflow.com/comment/45595378
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28647839
has text: Your added solution is similar to what I was going to suggest! If each item had an ID, you could add it to an array, then check to see if it already exists. For that, you'll need an "in_array" function: http://stackoverflow.com/questions/784012/javascript-equivalent-of-phps-in-array – If each item has a 'src' perhaps you could use that as an ersatz ID instead?

http://stackoverflow.com/q/28649023
type: Question
has comment: http://stackoverflow.com/comment/45595537
tagged with: object
has body: I am new to javascript and I am trying to parse and manipulate the data below but not too sure how to go about it. Can anyone help please? JSON Data { "2009-01": { "bbcfour": 324, "bbcnews24": 1075, "bbcone": 940, "bbcthree": 441, "bbctwo": 1040, "cbbc": 898, "cbeebies": 1343 }, "2009-02": { "bbcfour": 295, "bbcnews24": 958, "bbcone": 904, "bbcthree": 434, "bbctwo": 1038, "cbbc": 793, "cbeebies": 1246 }} JavaScript
has answer: http://stackoverflow.com/a/28649061
accepted answer: http://stackoverflow.com/a/28649061
tagged with: javascript
has comment: http://stackoverflow.com/comment/45595618
upvote count: 1
answer count: 1
tagged with: nested
tagged with: parsing
favorite count: 0
has comment: http://stackoverflow.com/comment/45595550
type: AnsweredQuestion
has title: Javascript parse nested JSON objects
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json

wookmark
type: Tag
tags question: http://stackoverflow.com/q/28616100
tag name: wookmark

http://stackoverflow.com/comment/45782895
type: Comment
comment on: http://stackoverflow.com/a/28750162
has text: So I've implemented it like you described. The callback function on sendmessage is being called (I have a console.log in there to notify me), but somehow, the code in the addlistener in background page isn't getting executed.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45678774
score: 0
type: Comment
has text: @DavidH Edited my answer. Incase your `.stickyside` margin ever changes, you'll need to edit the value in your javascript to fit this. Whenever you copy a function or script, do try to understand what exactly happens and how the code works. If you're having trouble with this, feel free to ask for explanations or quick help in one of the [SO Chatrooms](http://chat.stackoverflow.com/rooms/29074/html-css-webdesign), we'll be glad to help you learn.
comment on: http://stackoverflow.com/a/28693335
type: AnswerComment

http://stackoverflow.com/a/28622233
downvote count: 1
answers question: http://stackoverflow.com/q/28621958
score: 0
type: Answer
has body: Angular aims to teach the browser a few new things and in the process, making the browser a little smarter than it is without angular. When you start an angular application, angular transverses the DOM quickly, looking for directives (example ng-options, ng-if, etc). This DOM transversal is done by the $compile service. After traversing the DOM and identifying the directives, angular links them to their respective views and bind them to there scope. These directive encapsulate the HTML that the browser understands and they are exposed to the browser after the compilation process.
upvote count: 1

http://stackoverflow.com/comment/45578184
comment on: http://stackoverflow.com/a/28639438
score: 0
type: AnswerComment
type: Comment
has text: C'mon, that's not the case here ... Strings can be used instead of numbers in array indices, but in OP's case the referred indicies don't contain arrays.

http://stackoverflow.com/comment/45634442
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28667094
has text: so what we have to do inorder to overcome this issue
type: AnswerComment

http://stackoverflow.com/comment/45585072
type: QuestionComment
comment on: http://stackoverflow.com/q/28642996
has text: ok since I can't see any code I'm not sure the cause of problem..But I'would recommend you to use this css: html,body{height: auto !important};
score: 0
type: Comment

http://stackoverflow.com/comment/45763091
comment on: http://stackoverflow.com/q/28739403
has text: well i faced the similar issue while back but i sorted that out just making my ajax call `async:true` (default) . anything like that in your code . cheers
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45557242
comment on: http://stackoverflow.com/q/28628287
type: QuestionComment
has text: @Eddi I use Select2 dropdown menu. The shown options is: 2015 and 2014, it is listed in the JS.
score: 0
type: Comment

http://stackoverflow.com/a/28673417
answers question: http://stackoverflow.com/q/28671984
has body: Ahh!! And Finally this was done using Jquery $('.wpb_wrapper span').css({'color': 'red'}); Thanks Every One!! But how could this can done using JavaScript .. Any way Thanks !!
score: 0
type: Answer

http://stackoverflow.com/comment/45642238
type: AnswerComment
comment on: http://stackoverflow.com/a/28640421
type: Comment
has text: Thanks for your response, but I get the following error with your example: dojo/parser::parse() error TypeError: Cannot read property 'toString' of undefined {stack: (...), message: "Cannot read property 'toString' of undefined"}parser.js.uncompressed.js:89
score: 0

http://stackoverflow.com/comment/56108076
type: AnswerComment
comment on: http://stackoverflow.com/a/34118352
score: 0
type: Comment
has text: Hmm. Seemed to work for me when I set the above but looking at your answer it may have changed again.

http://stackoverflow.com/a/28638376
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28637589
answers question: http://stackoverflow.com/q/28637589
upvote count: 1
has body: Firefox 35.0.1 does not like th e long version of: $(document).ready(function(){ My code works using the shorthand version: $(function() { I don't know why, but it worked right away.
score: 1

http://stackoverflow.com/a/28720318
has comment: http://stackoverflow.com/comment/45729936
answers question: http://stackoverflow.com/q/28719923
has comment: http://stackoverflow.com/comment/45730654
has comment: http://stackoverflow.com/comment/45730067
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45728879
type: Answer
has comment: http://stackoverflow.com/comment/45727760
has comment: http://stackoverflow.com/comment/45730545
has comment: http://stackoverflow.com/comment/45729251
has body: First, define a function that draws an image to the canvas and returns a promise for the result: function drawToCanvas(nativeURL) { return $q(function (resolve) { var canvas = document.getElementById("canvas"); var ctx = canvas.getContext("2d"); var img = new Image(); img.src = nativeURL; img.onload = function () { ctx.drawImage(img, 0, 0, img.width, img.height); resolve(canvas.toDataURL()); }; }); } The solution then becomes: $scope.targetImages = []; function drawCanvas() { // pResults is an array of promises var pResults = $scope.targetImages.map(function (imageObj) { return drawToCanvas(imageObj.nativeURL); }); return $q.all(pResults); } drawCanvas().then(function(data) { // data is an array of imageUrls console.log("done: " + new Date()) console.log(data) $scope.outputImages = data; $scope.previewMode = false; // switch views, display canvas, remove preview }); To simplify, I have changed $scope.targetImages and $scope.outputImages to be arrays instead of objects, but it shouldn't be too hard to go back to using objects for them if that's what you need.
has comment: http://stackoverflow.com/comment/45728405
has comment: http://stackoverflow.com/comment/45728547
upvote count: 2
has comment: http://stackoverflow.com/comment/45729378
score: 2
accepted answer of: http://stackoverflow.com/q/28719923
has comment: http://stackoverflow.com/comment/45729660
has comment: http://stackoverflow.com/comment/45728789

http://stackoverflow.com/q/28715514
linked to: http://stackoverflow.com/q/24032279
has comment: http://stackoverflow.com/comment/45719460
tagged with: firefox-addon
has comment: http://stackoverflow.com/comment/45719907
downvote count: 1
has comment: http://stackoverflow.com/comment/45719071
tagged with: firefox-addon-sdk
upvote count: 5
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28718535
type: Question
has comment: http://stackoverflow.com/comment/45719985
answer count: 1
tagged with: javascript
has body: I'm creating (developing) a Firefox add-on and I need to find browser's user agent. The navigator.userAgent is not working. It shows that the navigator is not defined. What Firefox Add-on module do I need to get user agent or is there another way to find it out in an add-on?
has title: How to find out browser's user agent in Firefox Add On
score: 4
has comment: http://stackoverflow.com/comment/45722579
favorite count: 0

http://stackoverflow.com/a/28690149
score: 2
answers question: http://stackoverflow.com/q/28689873
upvote count: 2
has comment: http://stackoverflow.com/comment/45675414
has body: Here is documentation of different browser behavior: http://justinmarsan.com/hidden-elements-and-http-requests/ Which says: Chrome and Safari (WebKit) WebKit downloads the file every time except when a background is applied through a non-matching media-query. Firefox Firefox won’t download the image called with background image if the styles are hidden but they will still download assets from img tags. Opera Like Firefox does, Opera won’t load useless background-images. Internet Explorer IE, like WebKit will download background-images even if they have display: none; So to answer the question of why: A quick argument for either side: Firefox - Don't load until the content is visible: No reason to load something not being viewed, improve page load time. Webkit - Load the image on pageload: So, perhaps JavaScript decides to make the element visible later, the transition might be choppy if the image is not preloaded, and any other number of arguments for preloading images. And a brief discussion of the topic: http://robertnyman.com/2010/03/11/do-hidden-elements-load-background-images/
downvote count: 0
has comment: http://stackoverflow.com/comment/45672303
type: Answer
has comment: http://stackoverflow.com/comment/45672071
has comment: http://stackoverflow.com/comment/45672263

http://stackoverflow.com/q/28607292
tagged with: javascript
linked to: http://stackoverflow.com/q/27698009
has comment: http://stackoverflow.com/comment/45518583
has answer: http://stackoverflow.com/a/28607882
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45519212
has comment: http://stackoverflow.com/comment/45518803
has title: How to show the value from a dropdown toggle bootstrap based on a criteria?
accepted answer: http://stackoverflow.com/a/28607882
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/45518675
linked to: http://stackoverflow.com/q/25844992
has comment: http://stackoverflow.com/comment/45518654
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45518951
score: 1
has body: I have the following bootstrap dropdown. Using PHP I get the country of the visitor. So if the visitor comes from England or any other country not listed below, the English must be shown, on top and be removed from the list. as shown below. I can do the PHP side, but what about the javascript since this is not a select dropdown and there is not a selected ? Standard version: English Greek Italian Czech When a visitor from the UK comes in: English Greek Italian Czech Here is what the HTML will be when a Greek enters: Greek English Italian Czech
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45519250
has comment: http://stackoverflow.com/comment/45519109

http://stackoverflow.com/a/28718157
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28717856
has body: It seems that you are not calling function properly. getValue(); instead of getValue;
type: Answer
has comment: http://stackoverflow.com/comment/45726788
upvote count: 3
answers question: http://stackoverflow.com/q/28717856
score: 3
has comment: http://stackoverflow.com/comment/45723846
type: AcceptedAnswer

http://stackoverflow.com/comment/45593447
type: QuestionComment
has text: Perhaps the best solution is not to forget them in the first place
comment on: http://stackoverflow.com/q/28647545
score: 0
type: Comment

http://stackoverflow.com/comment/109727042
type: AnswerComment
comment on: http://stackoverflow.com/a/28799619
has text: I use this interactive example from time to time to get base64 encoded files if I need them quickly.
score: 0
type: Comment

http://stackoverflow.com/q/28622252
upvote count: 1
tagged with: web-scraping
has title: Scraping and External Resources
answer count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45590779
has comment: http://stackoverflow.com/comment/45549159
has comment: http://stackoverflow.com/comment/45611203
downvote count: 0
score: 1
has body: I've just started to learn about scraping and I just had a quick question. Scraping images and files through the DOM is no problem but I was curious if it was possible to scrape external resources linked to a document such as web fonts(sorry couldn't think of another example off the top of my head). Things like this are used within the page but not linked through typical means. If anyone could tell me if such things are possible? I only know Ruby and a bit of JS. Also if you can give me other examples of resources like web fonts that aren't linked normally that would be cool to. Thanks.
has comment: http://stackoverflow.com/comment/45585438
favorite count: 0
tagged with: ruby
linked to: http://stackoverflow.com/q/15037392
type: Question
has comment: http://stackoverflow.com/comment/45551395
has comment: http://stackoverflow.com/comment/45550833

http://stackoverflow.com/a/28715767
answers question: http://stackoverflow.com/q/28715650
type: Answer
downvote count: 0
has body: the alert should call after you typed in the values the Value is empty -> value="" try this: Show Inputs
score: 1
upvote count: 1

http://stackoverflow.com/comment/45753146
type: Comment
comment on: http://stackoverflow.com/a/28733803
has text: @TheMuffinMan Yea, I definitely see a lot of confusing around `this`. In this case, `this` in the global context. In the above example, it is within the `.each()` method which provides context.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45819309
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28765715
has text: http://jsfiddle.net/aGCFs/287/ - latest version - in reference to using ajax calls - how would one go about creating new input fields after listening to say a drop down change - I need to mimic it doing an ajax call, returning input field values and displaying it nicely on the form

http://stackoverflow.com/comment/45677942
score: 0
type: AnswerComment
has text: Depending on the range of your numbers, integers could be a good bet. The additional `scale` may be shared between numbers and the overhead reduced. What's the range ?
comment on: http://stackoverflow.com/a/28692636
type: Comment

http://stackoverflow.com/a/28633341
has comment: http://stackoverflow.com/comment/45568163
answers question: http://stackoverflow.com/q/28632637
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45567147
has comment: http://stackoverflow.com/comment/45567320
type: Answer
has comment: http://stackoverflow.com/comment/45579674
has comment: http://stackoverflow.com/comment/45567538
score: 3
has body: What if you try something like this: $id = $_GET['id']; $data = file_get_contents('__url'); parse_str($data); $array = explode(',', $url_encoded_fmt_stream_map); $final_arr = array(); foreach($array as $item) { parse_str($item); array_push($final_arr , $url); } $jsonp = json_encode($final_arr); if(isset($_GET['callback'])){ header("Content-Type: application/json"); echo $_GET['callback'] . '(' . $jsonp . ')'; }else{ echo $jsonp; } and your ajax: $.ajax({ url:"file.php", dataType: 'jsonp', data: {id: id}, success:function(response){ var obj = JSON.parse(response); $.each(obj, function(key,val){ console.log(key); console.log(val); //depending on your data, you might call val.url or whatever you may have }); $('body').append(response); } });
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28632637

http://stackoverflow.com/comment/45550763
type: Comment
comment on: http://stackoverflow.com/a/28624413
score: 0
type: AnswerComment
has text: I have Spring servlet on this project. This servlet run on localhost:8080/webapp/images/ and this is only the path for image var/webapp/photos/small/tuc.png when i access to this url, download for image will started

http://stackoverflow.com/comment/45746539
score: 1
comment on: http://stackoverflow.com/q/28730086
type: QuestionComment
has text: Try changing the properties type to `object` rather than `List<KVP<Guid, Bar>>`
type: Comment

http://stackoverflow.com/comment/45649644
comment on: http://stackoverflow.com/a/28677331
type: Comment
has text: I think that is the correct solution, but doesn't work for me...i just added in the body of the html page this Try it But when i click on the button, the focus goes on the last element...
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45896810
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28615535
has text: No, we're not using the pusher-angular library... That's probably why a $watch in one of our other controllers populates the table but this one doesn't.

http://stackoverflow.com/comment/45774041
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28707565
has text: It will be on the back end, but for now I am working on a prototype that needs to populated every day that is empty w/ "completed" notice.
type: Comment

http://stackoverflow.com/a/28614085
type: Answer
has body: I tried something like this $(document).ready(function () { var divs = $('.content').map(function (i, el) { return $(el).offset().top - $(el).parent().offset().top; }); $('#pageContent').scroll(function () { var index = findIndex($(this).scrollTop(), divs) - 1; if (index &gt; -1) { console.log($(this).children().eq(index).attr('id')); } else { console.log('outside'); } }); }); function findIndex(pos, divs) { return (divs.filter(function (el, et) { return et &lt;= pos }).length); } It's not super clean code because I had to do it quickly. DEMO I hope this helps
answers question: http://stackoverflow.com/q/28613343
score: 0

http://stackoverflow.com/a/28603677
downvote count: 0
type: Answer
has body: You have several options. Replace all the double quotes in your javascript with single quotes Escape all the quotes as Andreas mentioned Use heredoc Personally, I would go for #3
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28603505

http://stackoverflow.com/comment/45648917
type: Comment
type: QuestionComment
has text: It doesn't matter as long as the location where you run the compilation is the same you load your views from in your app.
comment on: http://stackoverflow.com/q/28634942
score: 0

gcal
type: Tag
tag name: gcal
tags question: http://stackoverflow.com/q/28639888

http://stackoverflow.com/comment/45517660
comment on: http://stackoverflow.com/q/28606379
score: 0
type: Comment
type: QuestionComment
has text: So `console.log("$context ", $context);` becomes `console.log('$context ', t.html());`? Where is the extra `.html()` call coming from? Do you get any errors logged in the console?

http://stackoverflow.com/q/28652632
has comment: http://stackoverflow.com/comment/45620780
type: Question
score: 3
linked to: http://stackoverflow.com/q/14656068
has comment: http://stackoverflow.com/comment/45615521
has comment: http://stackoverflow.com/comment/45612341
has answer: http://stackoverflow.com/a/28678162
has title: Marionette-Backbone how do I make a grid table with a dynamic row and column headers
linked to: http://stackoverflow.com/q/27417435
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/45624812
accepted answer: http://stackoverflow.com/a/28678162
tagged with: marionette
has comment: http://stackoverflow.com/comment/45634944
favorite count: 0
has body: I am trying to make a table grid with dynamic number of rows and column with headers using marionette. I want a grid that looks like: http://jsfiddle.net/zaphod013/c3w61gf6/ So there are columns = ['breakfast', 'lunch', 'dinner'] rows = ['carbs', 'proteins', 'fats'] and rest of the grid is checkboxes. I have made the Views for column and row, but I am fairly lost at how to put them in the table, and then how to add the checkbox views. Code I have is at http://jsfiddle.net/zaphod013/qkctrLxn/ html: script: FoodManager = new Backbone.Marionette.Application(); FoodManager.addRegions({ mainRegion: "#main-region", }); FoodManager.FoodLayout = Backbone.Marionette.Layout.extend({ template: "#food-table", regions: { colRegion:"#column-id", rowRegion:"#row-id" } }); FoodManager.Col = Backbone.Model.extend({}); FoodManager.ColCollection = Backbone.Collection.extend({ model: FoodManager.Col }); FoodManager.Row = Backbone.Model.extend({}); FoodManager.RowCollection = Backbone.Collection.extend({ model: FoodManager.Row }); FoodManager.ColItemView = Marionette.ItemView.extend({ template: "#food-col-item", tagName: "th", }); FoodManager.ColView = Marionette.CompositeView.extend({ template: "#food-table", tagName: "thead", itemView: FoodManager.ColItemView }); FoodManager.RowItemView = Marionette.ItemView.extend({ template: "#food-row-item", tagName: "th", }); FoodManager.RowView = Marionette.CompositeView.extend({ template: "#food-table", tagName: "table", itemView: FoodManager.RowItemView }); FoodManager.on("initialize:after", function(){ var columns = new FoodManager.ColCollection([ {col: 'Breakfast'}, {col: 'Lunch'}, {col: 'Dinner'} ]); var rows = new FoodManager.RowCollection([ {row: 'Carbs'}, {row: 'Protein'}, {row: 'Fats'} ]); var colListView = new FoodManager.ColView({ collection: columns }); var rowListView = new FoodManager.RowView({ collection: rows }); var foodLayout = new FoodManager.FoodLayout(); foodLayout.render(); FoodManager.colRegion.show(colListView); FoodManage…
type: AnsweredQuestion
upvote count: 3

http://stackoverflow.com/a/28748322
type: Answer
answers question: http://stackoverflow.com/q/28744805
has comment: http://stackoverflow.com/comment/45782759
score: 0
has body: The next() was placed improperly. It should be: router.use(function(req, res, next) { redisSessionStore.getAsync('active_session').then(function(data) { req.access_token = data.access_token; console.log('retrieved access_token: ' + req.access_token); next() }); });

http://stackoverflow.com/q/28652367
downvote count: 3
score: -3
has comment: http://stackoverflow.com/comment/45602057
possible better answer: http://stackoverflow.com/a/28652492
has answer: http://stackoverflow.com/a/28652492
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45602029
accepted answer: http://stackoverflow.com/a/28652562
type: Question
has body: Requirements: Clicking on the same radio button should not fire the event more than once. We can move between the radio buttons many times. $(function(){ function teacher(){ $(this).off('click'); console.log('teacher off'); } function student(){ $(this).off('click'); console.log('student off'); } $('#teacher').on('click', teacher); $('#teacher').click(function(){ $('#student').on('click', student); console.log('student on'); }); $('#student').on('click', student); $('#student').click(function(){ $('#teacher').on('click', teacher); console.log('teacher on'); }); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;input type="radio" id="student" name="school" value="student" checked&gt;Student &lt;input type="radio" id="teacher" name="school" value="teacher"&gt;Teacher The console log in this code doesn't give me the following pattern: teacher off, student on student off, teacher on See my question in the title.
answer count: 2
upvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45602008
has comment: http://stackoverflow.com/comment/45601978
has comment: http://stackoverflow.com/comment/45602005
has answer: http://stackoverflow.com/a/28652562
has title: How to activate each event once using on()/off()?

http://stackoverflow.com/comment/45501385
has text: I made a typo originally. My question is really, why would those two outputs be any different?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28597496
type: Comment

http://stackoverflow.com/q/28652495
type: AnsweredQuestion
upvote count: 3
tagged with: mysql
type: Question
score: 3
tagged with: chart.js
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28674568
answer count: 1
downvote count: 0
favorite count: 0
has title: Connecting Chart.js to MySQL database
has answer: http://stackoverflow.com/a/28674568
tagged with: php
has body: I have this script in my html document which creates a chart using Chart.js. The data in it are manualy inserted ( The labels and the data in datasets). The data in datasets are now randomly generated numbers. But I need to somehow connect it with my MySQL database. &lt;script&gt; var randomScalingFactor = function(){ return Math.round(Math.random()*100)}; var barChartData = { labels : ["January","February","March","April","May","June","July","January","February","March","April","May","June","July"], datasets : [ { fillColor : "rgba(23, 158, 3, 0.8)", strokeColor : "rgba(24, 107, 2, 0.8)", highlightFill: "rgba(24, 107, 2, 0.9)", highlightStroke: "rgba(24, 107, 2, 1)", data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()] } ] } window.onload = function(){ var ctx2 = document.getElementById("canvas2").getContext("2d"); ctx2.canvas.width = 1000; ctx2.canvas.height = 800; window.myBar = new Chart(ctx2).Bar(barChartData, { responsive : true }); } I call select query in Model and then send the result to my View. And then in my View I can get to my data like this. I used a table as an example. &lt;?php foreach ($this-&gt;list_excercise as $value) : ?&gt; &lt;td&gt;&lt;?= $value['data'] ?&gt;&lt;/td&gt; &lt;td&gt;&lt;?= $value['label'] ?&gt;&lt;/td&gt; &lt;?php endforeach; ?&gt; So the data can be inserted into html like this, but how can I insert it into chart.js javascript? So instead of labels: ["January", "February"] I would have something like labels: $array I cannot figure out a simple way of getting the data to the script. Can anyone help me out with this? Thank you in advance.

http://stackoverflow.com/q/28696664
type: Question
tagged with: asp.net-mvc
accepted answer: http://stackoverflow.com/a/28696874
tagged with: javascript
has title: Issue Getting Model object in MVC to jQuery variable
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28696874
tagged with: asp.net-mvc-4
type: AnsweredQuestion
score: 1
has body: I'm trying to pass my MVC Model object in the view to the Controller Action method To access to my DB.......... Where i'm going to add that element into the DB......... But i'm not sure how to get that model object into a jQuery variable........ I have tried two ways to do that....... var modelDataJSON = @Model; var modelDataJSON = @Html.Raw(Json.Encode(Model)); These both ways gives me a syntax errors.......... this is how my jQuery function looks like: $('#submit').click(function () { var modelDataJSON = @Model; @*var modelDataJSON = @Html.Raw(Json.Encode(Model));*@ $.ajax({ type: "POST", url: '@Url.Action("AddDoctor")', data: {"doctor" : modelDataJSON}, success: function (data) { alert(JSON.stringify(data.Message)); }, error: function () { alert("Error!!!"); } }); return false; }); this is how my form looks like: @using (Html.BeginForm("AddDoctor", "Doctor")) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) @*@Html.LabelFor(model => model.UserId, new { @class = "col-sm-2 control-label" })*@ User ID @Html.TextBoxFor(model => model.UserId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.UserId) @Html.LabelFor(model => model.Name, new { @class = "col-sm-2 control-label" }) @Html.TextBoxFor(model => model.Name, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Name) @*@Html.LabelFor(model => model.DoctorSpecialityId, new { @class = "col-sm-2 control-label" })*@ Doctor Speciality ID @Html.TextBoxFor(model => model.DoctorSpecialityId, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.DoctorSpecialityId) @Html.LabelFor(model => model.Charges, new { @class = "col-sm-2 control-label" }) @Html.TextBoxFor(model => model.Charges, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Charges) @Html.LabelFor(model => model.PhoneNo, new { @class = "col-sm-2 control-label" }) @Html.TextBoxFor(model => model.PhoneNo, new { @class = "form-control" }) @Html.ValidationMessageFor…
upvote count: 1

http://stackoverflow.com/a/28894028
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28609923
has body: can you please mention the lungo version you are using? also give a try with this version of lungo. it works for me. http://lungo.tapquo.com/microsites/lungo/package/quo.js http://lungo.tapquo.com/microsites/lungo/package/lungo.js
upvote count: 1
score: 1

http://stackoverflow.com/comment/45804905
comment on: http://stackoverflow.com/q/28714357
type: Comment
type: QuestionComment
score: 0
has text: I just read : http://docs.oracle.com/javase/7/docs/technotes/guides/scripting/programmer_guide/. Even though it is clearly stated how to invoke System.out.println() from Javascript, I still would like to know how to properly inject Java objects to AMD modules. I want my Javascript code to be independent of Java classes. What I'm trying to do here is just an experiment on the possible interactions between Java and Javascript.

http://stackoverflow.com/comment/45708301
type: QuestionComment
score: 0
has text: Here it is https://github.com/kripken/speak.js/blob/master/speakClient.js
comment on: http://stackoverflow.com/q/28709460
type: Comment

http://stackoverflow.com/comment/45721457
score: 1
type: Comment
has text: It's not a full CSS solution, it requires extra markup.
comment on: http://stackoverflow.com/a/28716776
type: AnswerComment

http://stackoverflow.com/q/28700697
favorite count: 0
has title: Empty div and reappend content strange behavior
upvote count: 1
type: AnsweredQuestion
score: 1
has body: I made this board where I append some boxes in a random order. When click the button I want to append the boxes in a new random order but apparently doesnt work (.board remains empty) http://jsbin.com/pedanobawe/2/edit?html,js,output makeBoard(); $('button').on('click', function() { $('.board').empty(); makeBoard(); });
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28700935
accepted answer: http://stackoverflow.com/a/28700935
answer count: 1
downvote count: 0

http://stackoverflow.com/q/28600329
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45506532
has body: I found a code online to pause and play a timer. When I used it in jsFiddle, it worked but when I copied the same code into my html page, it didn't work? Can anyone explain why did this happen? The code in my HTML : Play Pause 0
accepted answer: http://stackoverflow.com/a/28600608
has comment: http://stackoverflow.com/comment/45506429
upvote count: 1
answer count: 1
has title: When I try pause and play in jsFiddle, my code works but it doesn't work in my html page
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45506596
has answer: http://stackoverflow.com/a/28600608
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
type: Question

http://stackoverflow.com/q/28705795
has title: How to close pop-up form after successful submission
has comment: http://stackoverflow.com/comment/45702947
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28706035
tagged with: php
has comment: http://stackoverflow.com/comment/45702890
has answer: http://stackoverflow.com/a/28705956
answer count: 4
linked to: http://stackoverflow.com/q/5004233
has comment: http://stackoverflow.com/comment/45701336
has comment: http://stackoverflow.com/comment/45702605
tagged with: forms
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28706305
has comment: http://stackoverflow.com/comment/45703298
has comment: http://stackoverflow.com/comment/45703604
score: 0
has answer: http://stackoverflow.com/a/28706001
tagged with: jquery
has body: My website is simple, it has text saying "Click here" , that upon clicking will open a modal-type contact form in the center of the screen. Currently when this form is submitted, it delays 1 second, then calls on submit.php to send the data to my email. Instead of redirecting to submit.php, I'd like to remain on the same page and simply close the pop-up contact form. So it should go like this: Click "Click here" > Fill in details in pop-up form > Click submit > Form submits after 1 second and then closes completely. (No re-direct) You can view my demo site here. Here is the form HTML: On submit, this window should close Submit here You can see that the form id is "contactform" and the button id is "flybutton" The following scripts use this data to currently, delay 1 seccond, submit the form and then redirect to submit.php. Instead, I need it to delay 1 second, submit the form, and then close the popup window (and black background). Currently I have a script that will close the form via Escape key, so perhaps this could be implemented somehow? I feel that my scripts just need to be combined somehow. Here are the scripts I have: 1 second delay + submit form Close form box (#login-box) and black background (#mask) via escape key: Another user helped with this script so I don't know it's purpose: Can you please tell me which code to edit in order to get the functionality I need? I couldn't get jsFiddle working but here's my demo site again UPDATE: I've incorporated AJAX, but am having an issue. Specifically, the form submits but it STILL redirects. Included this underneath my form and here is the script.. how do I make NO re-direct? Thanks a lot!
has comment: http://stackoverflow.com/comment/45703441

http://stackoverflow.com/comment/45665014
type: Comment
comment on: http://stackoverflow.com/q/28686190
score: 0
type: QuestionComment
has text: Since your using a datapicker (assume this is jquery ui) then why not just set the `minDate: 0,`? (and why do you have `@id = "ClassDate", @type = "date", name = "ClassDate"` - all which are are bit pointless since thats what the helper renders anyway)

http://stackoverflow.com/q/28678305
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45692628
has answer: http://stackoverflow.com/a/28678404
has body: I have this simple issue that I can't figure out trying to find out the max from a string, yes it is a string, converting to a float. According to JS it can take an array... but everytime I try to find the max it is just printing the first value. In this case 13... not sure why? The expected result is 30. Please help. Thanks! function myFunction() { var str = "13, 24, 30, 4";//30 var res = str.split(","); var max = Math.max(parseFloat(res)); document.getElementById("demo").innerHTML = res+ " " + max;//test }
type: Question
has title: Math.max Function in Javascript
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45649702
has comment: http://stackoverflow.com/comment/45649922
accepted answer: http://stackoverflow.com/a/28678404
tagged with: max
answer count: 1

http://stackoverflow.com/q/28627145
has comment: http://stackoverflow.com/comment/45638923
answer count: 1
has comment: http://stackoverflow.com/comment/45652102
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/23635964
has comment: http://stackoverflow.com/comment/45651685
has comment: http://stackoverflow.com/comment/45556837
has body: My Store registers 2 actiontypes as follows: Dispatcher.register(function (action) { switch (action.type) { case 'loadCar': loadCar(); break; case 'loadTyres': loadTyres(); break; } }) how can I assure, that loadCaris executed before loadTyres? Is there a way to wait for this depending method without having to execute loadCar everytime I want to just loadTyres?
has comment: http://stackoverflow.com/comment/45631240
type: Question
tagged with: reactjs
has comment: http://stackoverflow.com/comment/45674463
tagged with: javascript
tagged with: reactjs-flux
has answer: http://stackoverflow.com/a/28702711
score: 0
has title: How to resolve dependency between actions within a Store

http://stackoverflow.com/a/28599267
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45505045
has comment: http://stackoverflow.com/comment/45504858
type: Answer
has comment: http://stackoverflow.com/comment/45505151
has comment: http://stackoverflow.com/comment/45507399
score: 2
has comment: http://stackoverflow.com/comment/45504807
downvote count: 0
has comment: http://stackoverflow.com/comment/45505057
has comment: http://stackoverflow.com/comment/45504793
accepted answer of: http://stackoverflow.com/q/28599220
has comment: http://stackoverflow.com/comment/45507360
has body: You could use a regular expression to replace all instances of the "_" pattern with a value. For example: var value = 7; // An arbitrary example number var element = $("#rolls"); element.html(element.html().replace(/_/g, value));
has comment: http://stackoverflow.com/comment/45504934
has comment: http://stackoverflow.com/comment/45507431
answers question: http://stackoverflow.com/q/28599220
has comment: http://stackoverflow.com/comment/45504918
has comment: http://stackoverflow.com/comment/45505015
upvote count: 2
has comment: http://stackoverflow.com/comment/45504893
has comment: http://stackoverflow.com/comment/45505016

http://stackoverflow.com/q/28744690
answer count: 1
downvote count: 0
tagged with: preload
score: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45773185
upvote count: 1
type: Question
tagged with: object
has title: How i can import a swf file into a canvas
tagged with: javascript
has body: i want to import a swf file into my canvas here is my cod i have i function were i preload my swf var canvas, stage, exportRoot, images; function init() { canvas = document.getElementById("canvas"); images = images||{}; var manifest = [ {src:"/...octo12.swf"}, ]; var loader = new createjs.LoadQueue(false); loader.addEventListener("fileload", handleFileLoad); loader.addEventListener("complete", handleComplete); loader.loadManifest(manifest); loader.onProgress = handleProgress; stage = new createjs.Stage(canvas); createjs.Ticker.setFPS(22); createjs.Ticker.addEventListener("tick", stage); var image = new createjs.Bitmap("/../logo.png"); image.x = 300; image.y = 150; stage.addChild(image); var progress = new createjs.Shape(); var progressBellow = new createjs.Shape(); progress.graphics.beginStroke("#FF00FF").drawRect(450,440,500,30); progressBellow.graphics.beginStroke("#FF00FF").drawRect(450,440,500,30); // progress.graphics.setStrokeStyle(8,"round").beginStroke("#FFF"); function handleProgress(event) { progress.graphics.clear(); // Draw the progress bar progress.graphics.beginFill("#FF00FF").drawRect(450,440,500*(event.loaded / event.total),30); } stage.addChild(progress,progressBellow); stage.update(); } function handleComplete() { //================================stage========================================================== stage = new createjs.Stage(canvas); //================================child========================================================== stage.addChild(exportRoot); stage.update(); stage.enableMouseOver(); //================================ticker========================================================= createjs.Ticker.setFPS(30); createjs.Ticker.addEventListener("tick", stage); . and i have home.html where i try to import them &lt;canvas id="canvas" width="1300" height="800" style="max-height: 100%;height: 25%;width: 20%;margin-left:40%;margin-top: 15%"&gt; &lt;object width="400" height="50" data="/..../swf/octo12.swf"&gt;&lt;/object&gt; &lt;/ca…
tagged with: createjs
has answer: http://stackoverflow.com/a/28779211
tagged with: canvas
has comment: http://stackoverflow.com/comment/45773023

http://stackoverflow.com/comment/45772583
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28744983
has text: try `console.log(userMarks[i])` inside your loop, it will show you why you've got NaN. NaN usually comes when you are trying to do calculation and you have a string in the mix
score: 0

http://stackoverflow.com/a/28692778
has body: There is an error in the parameters for your config definition, you have forgotten to add '$urlRouterProvider' to list of parameters in the list. angular.module('characters', ['djangular','ui.router', 'characters.filters', 'characters.services', 'characters.directives', 'characters.controllers']) .config(['$stateProvider','DjangoProperties', '$urlRouterProvider', function($stateProvider, DjangoProperties, $urlRouterProvider) { $urlRouterProvider.otherwise("/users"); // Now set up the states $stateProvider .state('users', { url: "/users", templateUrl: "partials/users.html" })
has comment: http://stackoverflow.com/comment/45678044
answers question: http://stackoverflow.com/q/28692356
score: 0
has comment: http://stackoverflow.com/comment/45677218
has comment: http://stackoverflow.com/comment/45677613
type: Answer

http://stackoverflow.com/q/28596141
has comment: http://stackoverflow.com/comment/45499074
has comment: http://stackoverflow.com/comment/45498818
has answer: http://stackoverflow.com/a/28596434
answer count: 5
has answer: http://stackoverflow.com/a/59994181
possible better answer: http://stackoverflow.com/a/28596299
has answer: http://stackoverflow.com/a/28596299
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/31562303
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28596279
tagged with: javascript
has body: Let's say I have the following; &lt;input type="text" id="1" name="1" value="" /&gt; &lt;input type="text" id="2" name="2" value="" /&gt; &lt;input type="text" id="3" name="3" value="" /&gt; &lt;input type="text" id="4" name="2" value="" /&gt; I am trying to have a function that will be able to figure out if there is an attribute with the same name. So for this example, a red flag will come up that id="4" has a duplicate name attribute. I know I have to do something like this, but I may be beating around the bush here. What do you guys think? function findDuplicates(name) { var found = 0; $("input").each(function() { if($(this).attr('name') == name) found++; }); return found; }
downvote count: 0
has title: Finding if there is a duplicate name attribute
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28596279
favorite count: 0
has comment: http://stackoverflow.com/comment/45499042

openstreetmap
tags question: http://stackoverflow.com/q/28665484
tag name: openstreetmap
type: Tag

http://stackoverflow.com/q/28639878
score: 9
type: Question
upvote count: 9
accepted answer: http://stackoverflow.com/a/28675499
tagged with: javascript
has body: I'm new to immutable.js and I'd like to understand better how to use records starting from a raw JS object. With Immutable.fromJS() I can create a map passing a raw object, for example: var images = { "1": { id: "1", urls: ["/medium/1.jpg", "/large/1.jpg"] }, "2": { id: "2", urls: ["/medium/1.jpg", "/large/1.jpg"] } } var imagesMap = Immutable.fromJS(images); imagesMap is now a map containing other maps, one for each image. I'd like instead to create a map containing records, for example using a Image record defined as: var ImageRecord = Immutable.Record({ id: undefined, urls: undefined }) How can I have imagesMap as map of ImageRecords? Is something I can do passing a reviver to fromJS, or should I go with the "old" approach? // old approach var imagesMap = Immutable.Map() for (key in images) { imagesMap.set(key, new ImageRecord(images[key])) }
downvote count: 0
answer count: 1
favorite count: 0
tagged with: reviver-function
tagged with: immutable.js
has title: How to create a map of records from a javascript raw object with Immutable.js?
tagged with: immutability
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28675499

http://stackoverflow.com/q/28614956
has body: This is my first experiment in WebGL: I am trying to add a cube, octahedron and tetrahedron to a single canvas. I programmed each shape separately and tested them: they each work when living inside their own canvases. When I tried adding them together, that's when things go wrong. At present I only see the octahedron spinning about (no, it is not obscuring the other shapes, I have checked). When I comment the octahedron out, I see the cube and tetrahedron spinning around, but their colour buffers have been mixed up and are not what I wanted (when I try to separate their colour buffers, nothing renders to the screen). I realise there are inconsistencies in how I coded these, but the present configuration was the only way I could get both those two objects to show. Now the recent addition of the octahedron made the previous two disappear. I sense the issue relates to vertex and colour buffers, but I don’t have enough experience and background to know what to amend. Do I instantiate a colour buffer for each of these? That would make sense. I tried and this but it did not go well for the first two shapes, hence the mixing of colour buffers. Would be much appreciated if anyone could advise / help me out on this. Have been spending countless hours trying to get to grips with this problem. var canvas; var gl; var NumVertices = 36; var points = []; var colors = []; var pointsT = []; var colorsT = []; var pointsO = []; var colorsO = []; var xAxis = 0; var yAxis = 1; var zAxis = 2; var axis = 0; var theta = [ 0, 0, 0 ]; var thetaLoc; window.onload = function init() { canvas = document.getElementById( "gl-canvas" ); gl = WebGLUtils.setupWebGL( canvas ); if ( !gl ) { alert( "WebGL is not available" ); } // --------------- Cube -------------------------- colorCube(); // --------------- Tetrahedron ------------------- colorTetra(); // --------------- Octohedron -------------------- colorOcto(); gl.viewport( 0, 0, canvas.width, canvas.height ); gl.clearColor( 0.1, 0.1, 0.1, 1.0 );…
tagged with: webgl
linked to: http://stackoverflow.com/q/25049058
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28641326
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: WebGl adding multiple objects to one canvas
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28641326
score: 0

http://stackoverflow.com/comment/45628237
comment on: http://stackoverflow.com/a/28666690
type: AnswerComment
has text: @shmuli Yes, in that case, a directive is probably more appropriate. Googling angular window resize directive will give you some quick examples.
score: 0
type: Comment

http://stackoverflow.com/q/28692898
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28693238
type: Question
answer count: 1
tagged with: javascript
score: 0
has body: I'm trying to draw a line of squares by using a for loop. When I say line I mean that I want one square standing next to other one but with a space between them. I tried the next code - The html part - &lt;canvas id="myCan" height="300px" width="300px"&gt;&lt;/canvas&gt; and the script part - $(document).ready(function () { var canvas = document.getElementById("myCan"); var ctx = canvas.getContext("2d"); var positionx = 50; var positiony = 50; var i = 0; for (i; i &lt; 20; i++) { ctx.fillStyle = "rgb(255, 0, 0)"; ctx.fillRect(positionx, positiony, 50, 50); positionx += 2; } }); The thing is that I'm getting a simple Line- meaning there's no space between the squares. How can i fix it? Thanks for any kind of help
has answer: http://stackoverflow.com/a/28693238
has title: JavaScript - How to draw few shapes with a space between them, by using a for loop and canvas

http://stackoverflow.com/comment/45619350
score: 0
type: QuestionComment
type: Comment
has text: Here are the instructions I was given: (Removing Negatives) Given an array X of multiple values (e.g. [-3,5,1,3,2,10]), write a program that removes any negative values in the array. Once your program is done X should be composed of just positive numbers. Do this without creating a temporary array and only using pop method to remove any values in the array.
comment on: http://stackoverflow.com/q/28653192

http://stackoverflow.com/comment/45722442
type: Comment
comment on: http://stackoverflow.com/q/28717609
has text: add some simple code to help you better.
score: 0
type: QuestionComment

http://stackoverflow.com/a/28600866
has comment: http://stackoverflow.com/comment/65954536
type: AcceptedAnswer
score: 39
has comment: http://stackoverflow.com/comment/81268794
type: Answer
upvote count: 41
has body: It is pretty hard to wrap your mind around this concept if you are used to the ease of extending objects in other OOP languages, but I'll do my best to explain the uses of those and what is what. I am going to assume you are familiar with other OOP languages. Correct me if I'm wrong. All functions have the prototype Function(). They are inheriting all base functionality from Function like toString() and valueOf(). Then there is a constructor. That is what you use to initialize an object with. p = new Foo(); So in this case we have two things. A function Foo with Function as prototype(Foo) A Function object with Foo() as constructor(p) (following me yet?) The Foo() constructor can override some base functionality of the Function constructor or leave it as it is and make good use of it. If you are familiar with OOP principles, The prototype is the base class, the constructor your current class. In OOP the above would be class Foo extends Function You can also start inheritance with this entire setup of prototype and constructor making more complex objects as you go whilst sharing functionality. For example this: // Make an object initialiser extending Function. In OOP `class Foo extends Function` function Foo(bar) { this.baz = bar; } Foo.prototype.append = function(what) { this.baz += &quot; &quot; + what; }; Foo.prototype.get() { return this.baz } Now lets say we want different ways to get baz out of there. One for console logging and one for putting it on the title bar. We could make a big thing about our class Foo, but we don't do that, because we need to do wholly different things with the new classes that are made for different implementations. The only thing they need to share are the baz item and the setters and getters. So we need to extend it to use an OOP term. In OOO this would be the desired end result class Title extends Foo(){}. So lets take a look at how to get there. function Title(what) { this.message = what; } At this point the Title function looks l…
accepted answer of: http://stackoverflow.com/q/28600238
has comment: http://stackoverflow.com/comment/81269524
answers question: http://stackoverflow.com/q/28600238
downvote count: 2

http://stackoverflow.com/a/28662056
has comment: http://stackoverflow.com/comment/45621070
type: Answer
has comment: http://stackoverflow.com/comment/45619734
has comment: http://stackoverflow.com/comment/45620115
answers question: http://stackoverflow.com/q/28661757
has comment: http://stackoverflow.com/comment/45619851
accepted answer of: http://stackoverflow.com/q/28661757
upvote count: 4
has comment: http://stackoverflow.com/comment/45621263
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45620484
score: 4
has body: Try using this... $(document).ready(function (e) { $("#Form").on('submit',(function(e) { e.preventDefault(); $.ajax({ url: "uploader.php", // Url to which the request is send type: "POST", // Type of request to be send, called as method data: new FormData(this), // Data sent to server, a set of key/value pairs (i.e. form fields and values) contentType: false, // The content type used when sending data to the server. cache: false, // To unable request pages to be cached processData:false, // To send DOMDocument or non processed data file it is set to false success: function(data) // A function to be called if request succeeds { console.log(data); } }); })); });
has comment: http://stackoverflow.com/comment/45622517
has comment: http://stackoverflow.com/comment/45620597
downvote count: 0
has comment: http://stackoverflow.com/comment/45620216

http://stackoverflow.com/comment/45556573
has text: what does 'this' resolve to if you inspect in your listener code?
comment on: http://stackoverflow.com/q/28627882
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45673943
has text: I'm crystal sure the logic how to run the loop is causing the issue.I don't see any problem with the code you put.ofc You can fix the loop logic though changing it into setInterval is easier and simpler.
comment on: http://stackoverflow.com/q/28691133
type: Comment
type: QuestionComment
score: 0

cocos2d-android
type: Tag
tag name: cocos2d-android
tags question: http://stackoverflow.com/q/28670511

http://stackoverflow.com/q/28619313
score: 12
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45547296
has body: I've successfully used the EmberJS JavaScript framework with an ASP.NET web application, by referencing ember.js file. I'm under the impression that Ember-CLI is the way Ember will be heading in future versions. If this is correct, what's the appropriate way to keep using Ember going forward? Does it make sense to use Ember-CLI with ASP.NET, or is the assumption that the client is only ever static HTML and CSS/JS that calls back to server-side code (eg. WebAPI)?
tagged with: ember-cli
tagged with: asp.net
favorite count: 0
accepted answer: http://stackoverflow.com/a/28972677
has comment: http://stackoverflow.com/comment/45567978
has title: Ember CLI and ASP.NET
tagged with: ember.js
upvote count: 12
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28972677
has comment: http://stackoverflow.com/comment/45546978
type: Question
has comment: http://stackoverflow.com/comment/45546763
tagged with: javascript

google-chrome-storage
tags question: http://stackoverflow.com/q/28604494
type: Tag
tag name: google-chrome-storage

http://stackoverflow.com/q/28655312
has body: Below are my code parts javascript, main.php and getparty.php 1) getparty.php code is as follow called from javascript to take details from party table on change of dropdown value of party from main.php <?php $q = intval($_GET['q']); include "dbc.php"; $sql= mysql_query("Select a.pcode,a.pname,a.discperc,a.delvterm from PARTY a where a.pcode='$q'") or die(mysql_error()); $row = mysql_fetch_array($sql) or die(mysql_error()); $pcode=$row['pcode']; $ppname=$row['pname']; $pdiscperc=$row['discperc']; ?> main.php ... it is my main form to display main form for user to enter Party <?php <?php $sql="UPDATE PARTY set repo_flag=0 "; if (!mysql_query($sql,$conn)) { die('Error: ' . mysql_error()); } if ($ppname!="") { $sql="UPDATE PARTY set repo_flag=1 where pname='$ppname' "; } if (!mysql_query($sql,$conn)) { die('Error: ' . mysql_error()); } $dropdown = "<select id='pname' name='pname' style='width:275px' onchange='showparty(this.value)' value='<?php echo $ppname; ?>' >"; $query1 = "select pcode,pname from PARTY order by repo_flag DESC "; $get=mysql_query($query1); while($row = mysql_fetch_array($get)) { $dropdown .= "\r\n {$row['pname']} "; } $dropdown .= "\r\n "; echo $dropdown; ?> ?> <input type="text" maxlength="3" size="3" name="txtdiscperc" value="<?php echo $pdiscperc; ?>"/> Javascript .. This is called to take value of party when dropdown combo changes I am not getting value of Discount % in main.php, and some other fields also I want to get from party table which I can write code when above discount % gets properly. How can I
tagged with: javascript
has comment: http://stackoverflow.com/comment/45609746
has comment: http://stackoverflow.com/comment/45607988
has title: How to get database other fields on change even of dropdown
score: 0
has comment: http://stackoverflow.com/comment/45607693
has comment: http://stackoverflow.com/comment/45632920
answer count: 0
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/45608695
tagged with: mysql
type: Question
has comment: http://stackoverflow.com/comment/45642156

http://stackoverflow.com/a/28595996
type: Answer
answers question: http://stackoverflow.com/q/28595427
score: 0
has body: If performance is the issue, have you tried not constructing other at all and just defining percentage, turning off the scroll on .not(this) elements, then going with $divs.not(this).scrollTop = percentage * ($divs.not(this).scrollHeight - $divs.not(this).offsetHeight)?
has comment: http://stackoverflow.com/comment/45498609

http://stackoverflow.com/q/28599577
has answer: http://stackoverflow.com/a/28599605
tagged with: javascript
duplicate of: http://stackoverflow.com/q/203198
type: AnsweredQuestion
tagged with: jquery
type: Question
accepted answer: http://stackoverflow.com/a/28599605
tagged with: http://stackoverflow.com/tag/html
has title: Event is not triggered after adding new elements
has body: I have HTML list: &lt;ul&gt; contains initial items of: &lt;li&gt; I have added new items dynamically to that list. Old items are responding very well , but the new ones cannot be triggered for the same event. I am using (.on) event as per JQuery documentation to trigger the current and future elements. But still not responding. $(".favorite-btn").on("click",function(){ alert("Yes!"); }); Could you help ?
has answer: http://stackoverflow.com/a/28599602
score: 0
possible better answer: http://stackoverflow.com/a/28599602
answer count: 2
linked to: http://stackoverflow.com/q/203198

http://stackoverflow.com/q/28639399
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45578484
has comment: http://stackoverflow.com/comment/45578733
has answer: http://stackoverflow.com/a/28639453
has answer: http://stackoverflow.com/a/28639438
has body: I initialize my array as myArray=[]; I want to dynamically create an associative array in a for loop. I am trying to create a key index and push a new value in at the same time. I want each key index to be a number like '1': '2': '3': The number of indexes will be unknown so I need to create them in my loop I am not sure how to accomplish this or push more values into each index. My code is: var myArray=[]; for(i=0; i&lt;10; i++){ myArray['1'].push(i); myArray['2'].push(i); myArray['3'].push(i); } alert(myArray); There is an error in the code . I apologize if this is similar to a repeat question. I can not find this answer in my searches though. Thanks for any help.
type: Question
has answer: http://stackoverflow.com/a/28639461
tagged with: arrays
tagged with: javascript
score: 0
has title: push value at index in array
answer count: 3

http://stackoverflow.com/a/42653177
score: 0
has body: I realise I'm rather late, but having just re-familiarised myself with this library, I don't believe there's a built-in callback for the start of a drag. The documentation states that: DayClick is called when the user clicks a day, and Select is called after a selection is made You may be able to add an Event listener on MouseDown, but you won't get access to the handy moment instances like with the select callback.
type: Answer
answers question: http://stackoverflow.com/q/28621605

http://stackoverflow.com/a/28694298
answers question: http://stackoverflow.com/q/28694053
score: 0
has body: If you want to show an alert when the phone number is exist in the database you should try to code in your api.
type: Answer

http://stackoverflow.com/comment/45531764
comment on: http://stackoverflow.com/q/28612113
score: 0
type: Comment
type: QuestionComment
has text: I was trying to keep the version the same, but updating jqGrid to 4.7 seemed to fix the issue. Thank you for your help!

http://stackoverflow.com/comment/45512521
score: 0
has text: Oh i get it. The right is allowed to be an expression. Got it.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28603490

http://stackoverflow.com/a/28704639
upvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45698977
has comment: http://stackoverflow.com/comment/45699508
type: Answer
has comment: http://stackoverflow.com/comment/45699596
has comment: http://stackoverflow.com/comment/45699481
downvote count: 2
has comment: http://stackoverflow.com/comment/45699406
has comment: http://stackoverflow.com/comment/45699023
has comment: http://stackoverflow.com/comment/45699255
has body: No need to create a new image. This has more to do with html and displaying of the image than anything else: function NotebookListCtrl($scope) { $scope.notebooks = [ {"name": "Lenovo", "processor": "Intel i5", "age": 2011, "src": 'images/img/image1.jpg' }, //more notebooks... {"name": "Toshiba", "processor": "Intel i7", "age": 2010, "src": 'images/img/image2.jpg' }, ]; $scope.orderList = "name"; } name: {{notebook.name}} processor: {{notebook.processor}} age: {{notebook.age}} Just set the image source and use the ng-src attribute in html to set the image source.
has comment: http://stackoverflow.com/comment/45699071
answers question: http://stackoverflow.com/q/28704509
score: -2
accepted answer of: http://stackoverflow.com/q/28704509
has comment: http://stackoverflow.com/comment/45699192

http://stackoverflow.com/q/28718110
linked to: http://stackoverflow.com/q/23405162
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45723326
score: 0
has comment: http://stackoverflow.com/comment/45723407
has title: concatenate expression into the mid of html tags
answer count: 1
type: UnansweredQuestion
tagged with: ionic-framework
has comment: http://stackoverflow.com/comment/45723210
tagged with: javascript
has answer: http://stackoverflow.com/a/28718441
type: Question
has body: In my View, how can I concatenate {{videoId}} into to my iframe tag?

http://stackoverflow.com/a/28603121
has body: The problem here is that you are passing wrong parameters to ajax call, you want to pass data as JSON object, so instead of data: item,, write data: {'item': item}, NOTE: also be sure to be opened developer tools->network tab, in most cases it will let you know where the problem is.
upvote count: 1
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28602852

http://stackoverflow.com/a/28722826
upvote count: 1
type: Answer
downvote count: 0
has body: Use ui-router. You will love it and it's the proper approach! Trust me! There is a great example from this link - https://github.com/angular-ui/ui-router/wiki/URL-Routing
score: 1
answers question: http://stackoverflow.com/q/28722074

http://stackoverflow.com/comment/45570872
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28635385
type: Comment
has text: The problem is your range ``001`` to ``001`` is a number so it becomes ``1`` to ``1`` and you care comparing a string to it.

http://stackoverflow.com/comment/45738319
type: Comment
has text: ah, it was re-rendered by a higher level component, but by itself. Thanks for the clarification!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28721148

http://stackoverflow.com/comment/45626692
type: QuestionComment
score: 0
has text: have you try jQuery animate funtion $(.item).animate({'top': '-=30px'},'slow'); });
comment on: http://stackoverflow.com/q/28665828
type: Comment

http://stackoverflow.com/q/28614621
upvote count: 1
type: Question
type: AnsweredQuestion
score: 1
tagged with: raphael
has title: Raphael.js causing "Forced synchronous layout" bottleneck
has comment: http://stackoverflow.com/comment/45571522
has answer: http://stackoverflow.com/a/28639674
has comment: http://stackoverflow.com/comment/45533031
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45575851
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45573824
favorite count: 0
has comment: http://stackoverflow.com/comment/45533366
has comment: http://stackoverflow.com/comment/45578580
has body: I monitored the page load time for my site in chrome (using Timeline), and got hundreds of warnings that said "Forced synchronous layout is a possible performance bottleneck" for all the Raphael.js calls: I don't know how to fix this :/ Any ideas on where to look? Here's how I normally create text on the page: currentPaper.text(width,height,"text") .attr({opacity:.8, fill: "#333", 'font-size':10}) .id = "someId"; //Or, to be exact: currentPaper.text(x_pos+(width/2), y_pos-height/8, lopaLayoutArray.x[s].y1[r].y2[x]) .attr({opacity:.8, fill: "#333", 'font-size':(10*size)}) .id = seatName+"-textLabel"; Thanks!
accepted answer: http://stackoverflow.com/a/28639674

http://stackoverflow.com/q/28643304
score: 0
answer count: 1
has title: How to call custom.js file in for loop and i want pass some argument with this js
tagged with: php
type: UnansweredQuestion
has body: How to call customs.js file in for loop and i want pass some argument with this js,And how to retrieve this var in JavaScript file. for($i=0;$i&lt;5;$i++) { &lt;script type="text/JavaScript" src="http://localhost/customs.js?var=test'"&gt; }
has answer: http://stackoverflow.com/a/28643366
linked to: http://stackoverflow.com/q/1996122
tagged with: javascript
type: Question

http://stackoverflow.com/a/30774085
score: 0
has body: I solved this by upgrade easyUI to 1.4 which has the feature of submitting form with Ajax. Refer to: http://www.jeasyui.com/documentation/form.php
type: Answer
accepted answer of: http://stackoverflow.com/q/28722498
answers question: http://stackoverflow.com/q/28722498
type: AcceptedAnswer

http://stackoverflow.com/comment/45504206
has text: possible duplicate of [set value of input using JS function](http://stackoverflow.com/questions/5700471/set-value-of-input-using-js-function)
score: 0
comment on: http://stackoverflow.com/q/28598997
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28709125
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28708096
upvote count: 1
answers question: http://stackoverflow.com/q/28708096
has body: On my machine (a Windows 7 machine), under my home directory there are: AppData/Local/Mozilla/Firefox/Profiles and AppData/Roaming/Mozilla/Firefox/Profiles directories. My profile name appears under each, but only the latter contains a prefs.js file. Try checking in the Roaming directory.
score: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/45537777
type: AnswerComment
has text: Definitely agree. Generally a View that fetches its own data is going to be hard to manage. Prefer to instead pass data into the view(s) `initialize(...)` method, and then re-use the data for other views that might need them.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28616604

http://stackoverflow.com/q/28669676
has body: I just wanted to ask for an example of a regular expression, that would match the below string format for JS: 2 or 2/3 or 2/4/1 or 5/6/7/4, etc. Thanks.
has comment: http://stackoverflow.com/comment/45633447
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45633455
favorite count: 0
has title: Validate string with regular expression Javascript
tagged with: regex
has answer: http://stackoverflow.com/a/28669748
type: UnansweredQuestion
downvote count: 2
upvote count: 1
type: Question
score: -1

http://stackoverflow.com/q/28628212
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28628431
possible better answer: http://stackoverflow.com/a/28628345
has comment: http://stackoverflow.com/comment/45557410
tagged with: javascript
has answer: http://stackoverflow.com/a/28628345
tagged with: http://stackoverflow.com/tag/html
has body: All this program should/needs to do is do simple conversions between US & Metric, however, for some reason it is resisting every effort I have made to make it work. From what I can tell my script is not firing, I have worked relentlessly to fix it but my lack of experience with JS has made it an uphill battle. My HTML and JS appear to be in good order, so it must be my understanding of what I've written that is failing me. The values for calculation come straight from Google, so they should be solid. function calc() { var h; var ee = isNaN(document.getElementById("number")).value; if (ee == "true") { document.writeln("Please use only numerical keys I.E 128"); } else if (document.getElementById("us").value == 1) {if (document.getElementById("met").value == 4) { h = (document.getElementById("number").value * 453.592; document.writeln(document.getElementById("number").value + " pounds is" + h + "grams."); } else document.writeln("This is not a valid conversion!") } else if (document.getElementById("us").value == 2) {if (document.getElementById("met").value == 5) { h = (document.getElementById("number").value * 0.946353; document.writeln(document.getElementById("number").value + " liters is" + h + "quarts."); } else document.writeln("This is not a valid conversion!"); } else if (document.getElementById("us").value == 3) {if (document.getElementById("met").value == 6) { h = (document.getElementById("number").value * 2.54; document.writeln(document.getElementById("number").value + " inches is" + h + "centimeters."); } else document.writeln("This is not a valid conversion!"); } } U.S. to Metric Converter Pound(s) Quart(s) Inch(es) to Gram(s) Liter(s) Centimeter(s) Convert! Please be ruthless with me if I am being a complete idiot somewhere in here, my main priority is getting this working but a better understanding of where I am failing is definitely important.
accepted answer: http://stackoverflow.com/a/28628431
has title: Issues creating/using a simple U.S. to Metric converter. (HTML/JavaScript) Function is not firing
type: AnsweredQuestion
score: 0

http://stackoverflow.com/comment/45728130
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28720549
has text: ;) Asking to resolve human error then eh! ;]

http://stackoverflow.com/comment/45511236
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28602939
type: Comment
has text: I will, just a few minutes more :)

http://stackoverflow.com/comment/45592693
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28647092
has text: ouch I didn't spot it :-)

http://stackoverflow.com/q/28705634
linked to: http://stackoverflow.com/q/4376596
tagged with: internet-explorer-11
upvote count: 3
has answer: http://stackoverflow.com/a/28824837
type: Question
linked to: http://stackoverflow.com/q/446594
tagged with: firefox
answer count: 1
downvote count: 0
has title: Browsers continue to perform Javascript after "PageUnload" & new "PageLoad"
tagged with: javascript
tagged with: ajax
linked to: http://stackoverflow.com/q/2452110
accepted answer: http://stackoverflow.com/a/28824837
linked to: http://stackoverflow.com/q/600494
favorite count: 0
has body: We have the following AJAX throttler. This was implemented to be able to perform many (20+) ajax requests for one page without the remainder timing out just because the first X requests took a total of 60 seconds. RequestThrottler: { maximumConcurrentRequests: 3, //default to 3 requestQueue: new Array(), numberOfRequestCurrentlyProcessing: 0, addRequestToQueue: function (currentRequest) { var self = this; self.requestQueue.push(currentRequest); if (self.numberOfRequestCurrentlyProcessing &lt; self.maximumConcurrentRequests) { self.sendNextRequest(); } }, sendNextRequest: function () { var self = this; if (self.numberOfRequestCurrentlyProcessing &gt;= self.maximumConcurrentRequests) { return; } if (self.requestQueue.length === 0) { return; } var currentRequest = self.requestQueue.pop(); self.numberOfRequestCurrentlyProcessing++; AJAX.SendAjaxRequest(currentRequest.url, currentRequest.httpMethod, function(data){ self.numberOfRequestCurrentlyProcessing--; currentRequest.onSuccessCallback(data); self.sendNextRequest(); }, function(){ self.numberOfRequestCurrentlyProcessing--; currentRequest.onErrorCallback(); self.sendNextRequest(); }); }, sendUpdateRequest: function (currentRequest) { var self = this; self.addRequestToQueue(currentRequest); } } However, because these requests are sitting in a Javascript queue, when the user attempts to load a new page, the developer tools show the responses in the NET area of the new page. Our app has a check in place for privacy reasons to not allow this kind of behavior. Is this normal for browsers, or is it some sort of bug, or am I doing something wrong?
linked to: http://stackoverflow.com/q/14391531
tagged with: google-chrome
type: AnsweredQuestion
score: 3

http://stackoverflow.com/a/28626875
answers question: http://stackoverflow.com/q/28626746
downvote count: 0
type: Answer
upvote count: 3
score: 3
has body: You can do this in pure javascript var arr = [{'id':1, 'name':'John'}, {'id':2, 'name':'Jane'}, {'id':3, 'name':'Pete'}]; var nameArr =[]; arr.forEach( function(elem){ nameArr.push(elem.name); });

http://stackoverflow.com/comment/45771071
has text: you can take look at this simple example http://micheltriana.com/2013/09/30/http-verbs-in-a-rest-web-api/
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28743923
score: 0

http://stackoverflow.com/comment/45525760
has text: Beat me to it was just about to post. +1 correct answer
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28611026
type: Comment

http://stackoverflow.com/comment/45547742
type: Comment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/71309/discussion-between-lokesh-and-outlooker).
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28622517

http://stackoverflow.com/comment/45736703
type: QuestionComment
comment on: http://stackoverflow.com/q/28724936
has text: You have mentioned in title as `Array of objects`..but your code doesn't depicts the same..
score: 0
type: Comment

http://stackoverflow.com/a/28746433
has comment: http://stackoverflow.com/comment/45775048
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28746323
upvote count: 3
answers question: http://stackoverflow.com/q/28746323
type: Answer
has comment: http://stackoverflow.com/comment/45775621
has body: You must change your function to: function fadeBg(){ $("body").fadeOut(1000); } In your HTML code onclick is being set to run your function fadeBg. So in your function you must put what you want to run; in this case $("body").fadeOut(1000);
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/45775296

http://stackoverflow.com/comment/45767041
type: Comment
comment on: http://stackoverflow.com/q/28671532
type: QuestionComment
has text: Yes it'd be great to learn why I'm also not able to debug it. It does not seem to be working properly. So my question is about both.
score: 0

http://stackoverflow.com/q/28664965
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45624760
has body: Where I'm At I've managed to get the location of all of the headshots of politicans in index.html using jQuery's .offset() Where I'm Stuck I'm looking to get each individual image's location on the page (using their class or id) and then change the current top and left values of the tooltip (which contains info about each of the politicians), using .offset() so it's appears near/above where the corresponding image of that politician is on the page. UPDATE #1 @Roko: Can you elaborate on why the positioning needs to be fixed in this case. Likewise, with your suggested change, I can see the HTML for div class="tooltip" style="display: block; top: ... px; left ... px;"> but the numbers seem to have shifted the tooltip too much. Tried: $('img').each(function(){ var img = $(this); img.click(function(){ $('.tooltip') .show(100) .text(img.attr('alt')) .offset({ top : img.offset().top + img.height(), left : img.offset().left }); }); }); AND var position = $el.data('.elem'), ImagePosition = $el.offset(), ImageSize = { 'width': $el.outerWidth(), 'height': $el.outerHeight() }; 'top': ImagePosition.top - el.outerHeight() 'left': ImagePosition.left - (elelment.outerWidth()/2) + (elementSize.width/2) scripts.js // Positioning of the tooltips $(".headshot").click(function(){ // Fades in the tooltip $(".tooltip").fadeIn("fast"); // This is the coordinates for current position of a tooltip var coords = $(".tooltip").offset(); var height = $(".tooltip").height(); console.log(height); var width = $(".tooltip").width(); console.log(width); // How do I figure out how much top or left I need to move it? alert("Top: " + coords.top + " Left: " + coords.left); console.log(coords); }); index.html tooltip.scss /*---------------------------------- TOOLTIP ----------------------------------*/ .tooltip { display: none; position: relative; left: -12px; top: -5px; } .info { @include serifLight; background: $yellow; color: $black; font-size: 1.4rem; padding: 10px; width: 9%; text-align: center; p { …
has comment: http://stackoverflow.com/comment/45624949
accepted answer: http://stackoverflow.com/a/28665111
score: 2
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/45624732
tagged with: offset
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/65764234
has answer: http://stackoverflow.com/a/28665111
has title: Calculating multiple elements' position in order to .offset() it
has comment: http://stackoverflow.com/comment/45624794

http://stackoverflow.com/a/28651417
answers question: http://stackoverflow.com/q/28651168
has comment: http://stackoverflow.com/comment/78685231
score: 0
has body: Try this in index.php of your theme folder: &lt;?php function iever($compare=false, $to=NULL){ if(!preg_match('/MSIE (.*?);/', $_SERVER['HTTP_USER_AGENT'], $m) || preg_match('#Opera#', $_SERVER['HTTP_USER_AGENT'])) return false === $compare ? false : NULL; if(false !== $compare &amp;&amp; in_array($compare, array('&lt;', '&gt;', '&lt;=', '&gt;=', '==', '!=')) &amp;&amp; in_array((int)$to, array(5,6,7,8,9,10))){ return eval('return ('.$m[1].$compare.$to.');'); } else{ return (int)$m[1]; } } if(iever('&lt;=', 8)){ &lt;?php include (TEMPLATEPATH . '/shared/header.php' ); ?&gt; &lt;!-- YOUR CONTENT --&gt; &lt;?php include (TEMPLATEPATH . '/shared/sidebar.php' ); include (TEMPLATEPATH . '/shared/footer.php' ); ?&gt; } else { echo("Oh noes. IE8 or below. Maybe"); } If that works, let me know in a comment and I'll find out which action to hook into (maybe init?) so that it can be done for every page. I got the browser sniffing function from here. You know that browser sniffing is bad, right?
type: Answer

http://stackoverflow.com/comment/66593608
comment on: http://stackoverflow.com/a/28725041
score: 0
type: AnswerComment
type: Comment
has text: @jakethecool1: FYI, [`scope: true` is not an isolated scope](http://stackoverflow.com/questions/24528388/what-is-the-difference-between-scope-and-scopetrue-inside-directive)

http://stackoverflow.com/comment/45563103
has text: Try to use An ArrayList().hashSet dos not preserve order. If you really need Hashed collection with order, you could use LinkedHashSet
comment on: http://stackoverflow.com/q/28630068
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45680070
type: Comment
type: QuestionComment
has text: Which Qt/QML version?
score: 0
comment on: http://stackoverflow.com/q/28694314

http://stackoverflow.com/q/28666964
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: css
has body: Where I'm at I'm trying to use jQuery's .toggleClass() to toggle the opacity of a series of politician's photos from an opacity of 0.5 to 1, when one of the options in a category (radio input) is :clicked. ie. Clicking female, will change the opacity of all the female photos to 1. Where I'm stuck Clicking on the options does not properly change the opacity of the corresponding images' data which is pulled from var MLA =[] of the photos. What would be a more effective way than writing .toggleClass() multiple times for a single option/ click of a radio button? Tried: // Option #1: Gender $( ".G1" ).click(function() { $(".G2").toggleClass("disabled"); $(".headshot").not(".Female").toggleClass("opacity"); }); $( ".G2" ).click(function() { $(".G1").toggleClass("disabled"); $(".headshot").not(".Male").toggleClass("opacity"); }); // Option #2: Age $( ".A1" ).click(function() { $(".A2").toggleClass("disabled"); $(".A3").toggleClass("disabled"); $(".Low").toggleClass("show"); }); $( ".A2" ).click(function() { $(".A1").toggleClass("disabled"); $(".A3").toggleClass("disabled"); $(".Medium").toggleClass("show"); }); $( ".A3" ).click(function() { $(".A1").toggleClass("disabled"); $(".A2").toggleClass("disabled"); $(".High").toggleClass("show"); }); scripts.js // MLAs var MLAs = [ { "Name": "Nancy Allan", "Age": 62, "Constuency": "St. Vital", "Party": "NDP", "Gender": "Female", "Ethnicity": "White" }, { // Missing Data "Name": "James Allum", "Age": null, "Constuency": "Fort Garry-Riverview", "Party": "NDP", "Gender": "Male", "Ethnicity": "White" }, { "Name": "Rob Altemeyer", "Age": 46, "Constuency": "Wolseley", "Party": "NDP", "Gender": "Male", "Ethnicity": "White" }, { "Name": "Steve Ashton", "Age": 58, "Constuency": "Thompson", "Party": "NDP", "Gender": "Male", "Ethnicity": "White" }]; var filteredMLAs = MLAs.slice(0); // copy MLAs var total = filteredMLAs.length; var refreshList = function () { var list = filteredMLAs; setTotal(list.length); $MLA_List.empty(); $.each(list, fun…
type: UnansweredQuestion
has title: Trouble with toggling opacity using .toggleClass()
has answer: http://stackoverflow.com/a/28667057
type: Question

http://stackoverflow.com/a/28657451
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45610990
upvote count: 1
type: Answer
downvote count: 0
has body: I think what you need is here: http://www.jqueryrain.com/?4A0zDhn1
score: 1
answers question: http://stackoverflow.com/q/28657313
accepted answer of: http://stackoverflow.com/q/28657313

http://stackoverflow.com/q/28706862
has body: I am using CSRF protection in CodeIgniter 2.2.1 I want to form submit process when I click datatable. Therefore, I create form element in javascript in click event. When form submit process run I get "500 Internal Server Error". Here is my code for datatable click event; var form = $('&lt;form&gt;&lt;/form&gt;', { id: "tdClickForm", name: "tdClickForm", method: 'post', action: "&lt;?= base_url(); ?&gt;files/folderClick" }); var cellInput = document.createElement("input"); cellInput.setAttribute("name", "currentCell"); cellInput.setAttribute("value", 1);; form.append(cellInput); form.appendTo('body').submit();
has answer: http://stackoverflow.com/a/28707366
answer count: 1
tagged with: javascript
has title: Codeigniter csrf protection error in Javascript form submit
score: 0
tagged with: csrf-protection
tagged with: form-submit
type: UnansweredQuestion
tagged with: codeigniter
has comment: http://stackoverflow.com/comment/45703679
tagged with: internal-server-error
type: Question

http://stackoverflow.com/comment/45642068
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28674258
has text: you are reinventing the wheel

http://stackoverflow.com/q/28737861
type: AnsweredQuestion
tagged with: javascript
has body: I'm using this approach for getting number of li returned from ajax call: $.post('@Url.Action("actionName", "controller")', function (data) { $('#notificationCounter').html($(data).find('li').length); }); The result looks like below: ... .. ... .. For example for that result I should get 2 because the result returned two li, But I get 0! Any idea?
accepted answer: http://stackoverflow.com/a/28737972
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/45759685
tagged with: jquery
linked to: http://stackoverflow.com/q/3697957
tagged with: ajax
has comment: http://stackoverflow.com/comment/45759732
has comment: http://stackoverflow.com/comment/45759793
has answer: http://stackoverflow.com/a/28738142
possible better answer: http://stackoverflow.com/a/28738052
has title: How to get number of elements returned from ajax call?
has answer: http://stackoverflow.com/a/28737972
has answer: http://stackoverflow.com/a/28738052
type: Question

http://stackoverflow.com/a/28633998
has body: On blur event your directly removing. Before removing just check in the input field value is exist or not. If exist don't remove it, otherwise you can remove it. I Hope this will help you.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28633835

http://stackoverflow.com/a/28655860
has body: As the error says, you did not declare TestFirst with var but assign a value to it (or use window.TestFirst = ...): TestFirst = define_TestFirst(); You want strict mode, but having the console.log() before the use strict causes the use strict to not enable strict mode. From MDN: To invoke strict mode for an entire script, put the exact statement "use strict"; (or 'use strict';) before any other statements.
score: 0
upvote count: 1
downvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28655824

http://stackoverflow.com/a/28615053
score: 0
type: Answer
has body: Just iterate over the immediate child which is an li. Then access the span and replace the spaces with underscore and set the id accordingly. // Iterate over the immediate li elements for the ul $('#menu &gt; li').each(function(elem) { var $this = $(this); // Access the span element var $span = $('.menu-item', $this), spanText = $span.text(), // Replace space with underscore replacedText = spanText.split(' ').join('_'); // Set the id of for the li element $this.attr('id', replacedText); }); $('#menu &gt; li').each(function(elem) { console.log($(this).attr('id')); }); Check Fiddle
answers question: http://stackoverflow.com/q/28614719
has comment: http://stackoverflow.com/comment/45533437

http://stackoverflow.com/q/28733675
has answer: http://stackoverflow.com/a/29881820
tagged with: url-routing
accepted answer: http://stackoverflow.com/a/29881820
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28736152
type: Question
tagged with: javascript
tagged with: express
score: 0
answer count: 2
has title: Express Routing: 404 on some route names, but not others?
possible better answer: http://stackoverflow.com/a/28736152
linked to: http://stackoverflow.com/q/12695591
tagged with: angularjs
has body: I'm making a single page app with Angular routes on the front end, but the backend is giving me grief. All the routes that involve interfacing with the database work, but when I add in a route (Copying the exact same structure) to send an html file, or just hello world, it returns a 404, not even registering on the node console (with one weird exceptions noted below). I read this post explaining how static should come after routes, it makes sense, but it's not working on my code. app.js is as follows: // SETUP var express = require('express'); var app = express(); var router = express.Router(); var mongoose = require('mongoose'); var port = process.env.PORT || 3001; var database = 'mongodb://example-database...'; var path = require('path'); var logger = require('morgan'); var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); // CONFIG mongoose.connect(database); // Note: response parser must be placed before routing app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'ejs'); app.set('jsonp callback name', 'cb'); app.use(logger('dev')); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: false })); app.use(cookieParser()); app.use(router); 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"); res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE'); next(); }); // ROUTES require("./routes/api_chirp.js")(router); require("./routes/api_video.js")(router); require("./routes/api_interaction.js")(router); require("./routes/api_user.js")(router); require("./routes/api_search.js")(router); require("./routes/api_jsonp.js")(router); require("./routes/index.js")(router); app.use(express.static(path.join(__dirname, 'public'))); // ERROR HANDLING // catch 404 and forward to error handler app.use(function(req, res, next) { var err = new Error('Not Found'); err.status = 404; next(er…

http://stackoverflow.com/comment/45516070
type: QuestionComment
comment on: http://stackoverflow.com/q/28605468
score: 0
has text: Change your question and list correct examples otherwise people will not be able to help.
type: Comment

http://stackoverflow.com/q/28596284
type: Question
has answer: http://stackoverflow.com/a/28596453
tagged with: javascript
score: -1
answer count: 2
upvote count: 0
has title: use jquery to increases variable value by 1 when button clicked
tagged with: button
tagged with: variables
tagged with: jquery
tagged with: click
favorite count: 0
has answer: http://stackoverflow.com/a/28596337
type: UnansweredQuestion
has body: I'm trying to make a button that will increase a variable by one each time the button is clicked using jQuery. This is the jQuery and HTML code to create the button I've used. $('.runHome').on('click', myfunction); function myfunction() { $(this).number(++runHome); 0 RunsHome The variable is runHome and it is also a class.
downvote count: 1

http://stackoverflow.com/comment/45621225
has text: Append the td's to the row, not tbody.
score: 0
comment on: http://stackoverflow.com/q/28663068
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28684339
has comment: http://stackoverflow.com/comment/45663794
accepted answer: http://stackoverflow.com/a/28685850
tagged with: jquery-mobile
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has body: I was working on a code using jQuery, jQuerymobile, and soundcloud API. The code works perfectly on server and on jsfiddle.net but when I run it locally it does not work. I've tried it with a local copy of jQuery library but it still does not work on a PC. Any suggestions? Thank you!
has answer: http://stackoverflow.com/a/28685850
type: AnsweredQuestion
has title: My jQuery ,jQuerymobile code doesn't work on PC, but perfectly on server
type: Question

http://stackoverflow.com/q/28605532
has title: Custom right click UI Context Menu(copy,paste,cut) For Entire Application (All web pages) Across All Browsers not for single web page
has answer: http://stackoverflow.com/a/28605650
has body: I want to develop a Custom ui context menu with simple copy paste options, after searching in google, found a jquery plugin to do same for a html elememt. Now what i want to know is....? how can i make it applicable to all the web pages in application, not for a individual web page. any kind of hint will be appreciated thanks in advance Edit : I know that i can do this by applying code in each and every page, is there any simpler way to do so. using which i can apply the code to entire application at once.
tagged with: javascript
type: Question
score: 0
answer count: 1
tagged with: jquery
tagged with: asp.net
type: UnansweredQuestion

http://stackoverflow.com/comment/45705458
score: 0
has text: and DO NOT USE `async: false`. It is a terrible practice and browsers are starting to deprecate it's use
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28707799

http://stackoverflow.com/comment/45725144
has text: i am using mocha-chai
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28717341

http://stackoverflow.com/q/28644920
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28645022
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/45589131
type: Question
tagged with: javascript
score: 4
upvote count: 4
has answer: http://stackoverflow.com/a/44009472
answer count: 2
linked to: http://stackoverflow.com/q/28527149
tagged with: google-chrome-extension
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/44009472
has answer: http://stackoverflow.com/a/28645022
has body: I need to open a chrome tab using content script. I checked message passing in chrome example and tried this In content script: chrome.runtime.sendMessage({greeting: "hello"}, function (response) { console.log(response.farewell); }); And in background.js chrome.runtime.onMessage.addListener( function (request, sender, sendResponse) { chrome.extension.getBackgroundPage().console.log('resp.type'); console.log(sender.tab ? "from a content script:" + sender.tab.url : "from the extension"); if (request.greeting == "hello") { chrome.tabs.create({url: 'http://google.com'}); sendResponse({farewell: "goodbye"}); } }); It is working well, the problem is that the tab is opening but also lots of tabs get opened...What I need to do to open just one tab?
has title: open a chrome tab from content script

http://stackoverflow.com/a/53853568
answers question: http://stackoverflow.com/q/28706485
has body: I know this is rather late, but I ran into an issue with reproducing C#'s Rfc2898DeriveBytes.GetBytes in Node, and kept coming back to this SO answer. I ended up creating a minimal class for my own usage, and I figured I'd share in case someone else was having the same issues. It's not perfect, but it works. const crypto = require('crypto'); const $key = Symbol('key'); const $saltSize = Symbol('saltSize'); const $salt = Symbol('salt'); const $iterationCount = Symbol('iterationCount'); const $position = Symbol('position'); class Rfc2898DeriveBytes { constructor(key, saltSize = 32, iterationCount = 1000) { this[$key] = key; this[$saltSize] = saltSize; this[$iterationCount] = iterationCount; this[$position] = 0; this[$salt] = crypto.randomBytes(this[$saltSize]); } get salt() { return this[$salt]; } set salt(buffer) { this[$salt] = buffer; } get iterationCount() { return this[$iterationCount]; } set iterationCount(count) { this[$iterationCount] = count; } getBytes(byteCount) { let position = this[$position]; let bytes = crypto.pbkdf2Sync(Buffer.from(this[$key]), this.salt, this.iterationCount, position + byteCount, 'sha1'); this[$position] += byteCount; let result = Buffer.alloc(byteCount); for (let i = 0; i &lt; byteCount; i++) { result[i] = bytes[position + i]; } return result; } } module.exports = Rfc2898DeriveBytes;
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/94554541
downvote count: 0
score: 1

http://stackoverflow.com/comment/45658251
has text: It's ok, php anwser is appreciated as well! thanks
score: 0
comment on: http://stackoverflow.com/q/28682452
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28633824
downvote count: 0
tagged with: global
tagged with: jquery
favorite count: 0
has title: Certain Javascript works on single pages, but not when loaded globally via a Drupal theme's javascript
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28653705
upvote count: 2
has body: On the SO-chat, I was advised to ask the following question here: I would like to load some Javascript globally on my complete website, via a Drupal theme's Javascript; insead of having to re-insert the Javascript-code each article over and over again. For example, I have managed this with the following code (imagine it wrapped in &lt;script type="text/javascript"&gt;...&lt;/script&gt;, when inserted locally): (which worked fine both locally when inserted per page, and also when loaded in to the Drupal theme's javascript globally as such): (function ($) { $(document).ready(function () { $ $(".toggler").click(function () { $(this).next().slideToggle("slow"); }).next().hide(); $("a[href^=#]").click(function () { var id = $(this).attr('href'); $(id).parents('.toggled').fadeIn("fast"); }); }); })(jQuery) However, for 2 other pieces of Javascript, I can't get things to work when loading them globally. However, they work great when inserted locally in to each consecutive article, as such (I'll mention just 1 smaller code, for reference): (imagine it wrapped in &lt;script type="text/javascript"&gt;...&lt;/script&gt; again, when inserted locally): (function($) { $(document).ready(function() { function getKey(element) { return element.href; } function sameGroupAs(element) { var key = getKey(element); return function() { return getKey(this) === key; } } $(document).on("mouseenter", "a", function() { $("a").filter(sameGroupAs(this)).addClass( "active"); }).on("mouseleave", "a", function() { $("a").filter(sameGroupAs(this)).removeClass( "active"); }); }); })(jQuery) Just for reference: if you would be interested how I added the Javascript to a Drupal's theme.
has comment: http://stackoverflow.com/comment/45604113
has answer: http://stackoverflow.com/a/28681669
type: Question
tagged with: drupal-7
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28681669
accepted answer: http://stackoverflow.com/a/28653705
answer count: 2

http://stackoverflow.com/q/28742453
upvote count: 3
tagged with: http://stackoverflow.com/tag/json
tagged with: jsonschema
answer count: 1
has body: I've got JSON files that can look either like this: { "api": "http://my.api.host", "modules": [ "core", "module", "another" ] } or this: { "api": "http://my.api.host", "modules": "*" } Note that modules attribute can have either an array as its value or a * string. How can I do that in JSON schema? Using priceless http://jsonschema.net/ I have created following structure that validates arrays only: { "$schema": "http://json-schema.org/draft-04/schema#", "id": "http://jsonschema.net", "type": "object", "additionalProperties": true, "properties": { "api": { "id": "http://jsonschema.net/api", "type": "string", "minLength": 1 }, "modules": { "id": "http://jsonschema.net/modules", "type": "array", "minItems": 1, "uniqueItems": false, "additionalItems": true, "items": { "id": "http://jsonschema.net/modules/2", "type": "string", "minLength": 1 } } }, "required": [ "api", "modules" ] } How can I make an alternative in JSON schema?
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28743376
linked to: http://stackoverflow.com/q/20886599
type: AnsweredQuestion
score: 3
downvote count: 0
has title: how to define alternative structure in json schema
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/28743376

http://stackoverflow.com/comment/45733098
type: QuestionComment
has text: The class id is what is listed in that thread, `clsid:CA8A9780-280D-11CF-A24D-444553540000`. You can actually find that GUID by looking in the Windows registry under `HKCR\AcroPDF.PDF\CLSID`. That GUID is common across all computers that have Acrobat Reader installed.
score: 0
comment on: http://stackoverflow.com/q/28722135
type: Comment

http://stackoverflow.com/q/28599067
upvote count: 2
tagged with: playback
has comment: http://stackoverflow.com/comment/45681237
favorite count: 0
has body: Can fabric keep track of event fired in canvas and related object(upon which event was fired ) in one big set (in short Recording of fabric canvas), so that by iterating over that set we can actually play back and show all activity performed on canvas. Have a look at this: link: http://ramkulkarni.com/blog/record-and-playback-drawing-in-html5-canvas/ source: http://ramkulkarni.com/temp/2012-10-03/js/RecordableDrawing.js demo: http://ramkulkarni.com/temp/2012-10-03/ I have made such a plugin like this, but only problem i had is about free drawing mode of fabric (I can get point on "mouse:up" but for that i have to get every property like style, strokewidth, color of point and store them along with point, which is very hard for me as of now!!). So, can anyone look at link i have provided and replay whether is it possible or not? Already had a look at #1431 but this doesn't make sense. Edit: I want something like "movie" mode in this android app if you have tried it (Kids Doodle - Color &amp; Draw):
has comment: http://stackoverflow.com/comment/45520459
has title: Record and playback of all activity happened on fabric canvas
type: UnansweredQuestion
score: 2
tagged with: video
answer count: 0
tagged with: recording
downvote count: 0
has comment: http://stackoverflow.com/comment/45713140
has comment: http://stackoverflow.com/comment/45688301
type: Question
tagged with: javascript
tagged with: fabricjs

http://stackoverflow.com/q/28611246
has answer: http://stackoverflow.com/a/30742901
answer count: 3
possible better answer: http://stackoverflow.com/a/28612216
downvote count: 0
has answer: http://stackoverflow.com/a/28612216
accepted answer: http://stackoverflow.com/a/28612193
favorite count: 0
tagged with: angularjs
upvote count: 2
has body: I'm looking for a way to return the child elements from within a given parent element block (using page objects), and to be able to call them via chaining. For example, given a number of widgets on a page: Widget 42 Blue Widget 23 Red And a page object, widgetPage: this.widget = function(num) { return $('div#widget-' + num) }; I want to ONLY grab the name and color from the first widget block. This works in my spec: expect(widgetPage.widget('42').$('color').getText()).toBe('Blue'); But I don't want to have selector code in my spec; I want it in the page object, where it belongs. I've not been able to find a good way to do this. I've tried various things like... this.getWidgetElms = function(num) { return this.widget(num).then(function(w) { return { name: w.$('div.name'), color: w.$('div.color') }; }); }; // fails because name and color are undefined... Ultimately, I'm looking to be able to do something like this (not working): expect(widgetPage.getWidgetElms('42').color.getText()).toBe('Blue'); Obviously I'm doing something wrong... How can I return only the child elements for the first widget block?
score: 2
type: AnsweredQuestion
has title: How to return child elements from within parent element in Protractor
type: Question
has answer: http://stackoverflow.com/a/28612193
tagged with: testing
tagged with: protractor
tagged with: javascript
tagged with: end-to-end

http://stackoverflow.com/comment/45698853
comment on: http://stackoverflow.com/q/28704330
has text: I think CKEditor wrap your textarea inside other elements, maybe you should try to hide thoses elements
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28658522
favorite count: 0
has comment: http://stackoverflow.com/comment/45613773
has comment: http://stackoverflow.com/comment/45613736
linked to: http://stackoverflow.com/q/3895478
tagged with: python
has comment: http://stackoverflow.com/comment/45613642
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
has title: How to arange list of numbers in javascript?
has comment: http://stackoverflow.com/comment/45613675
accepted answer: http://stackoverflow.com/a/28659117
tagged with: javascript
has body: In Python: data = range(50,60,2) print data [50, 52, 54, 56, 58] How can I do it in js? Looking for simple and shorter way. var range = (start, end) =&gt; [...Array(end - start + 1)].map((_, i) =&gt; start + i); var result = range(50, 60, 2); print(result);
has comment: http://stackoverflow.com/comment/45613720
upvote count: 1
tagged with: arrays
answer count: 1
has answer: http://stackoverflow.com/a/28659117

http://stackoverflow.com/q/28609348
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28609395
has title: Loop to avoid repetitive code
answer count: 2
has body: myApp.onPageInit("page", function(page) { $$('#ajax_step1').on('submitted', function(e) { mainView.router.loadPage('transfer1'); }); $$('#ajax_step2').on('submitted', function(e) { mainView.router.loadPage('transfer2'); }); ... }); The code inside the function seems very repetitive. How can i do the same but in a more smart way? I tried something like this, but will not work as exptected. for (var i = 0; i &lt; 6; i++) { $$('#ajax_step'+i).on('submitted', function(e) { mainView.router.loadPage('transfer'+i); }); }
possible better answer: http://stackoverflow.com/a/28609395
downvote count: 0
favorite count: 0
upvote count: 2
has answer: http://stackoverflow.com/a/28609374
linked to: http://stackoverflow.com/q/750486
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28609374
has comment: http://stackoverflow.com/comment/45522611
type: Question
has comment: http://stackoverflow.com/comment/45522595

http://stackoverflow.com/comment/45603386
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28653141
type: Comment
has text: removing the `var` has stopped the `alert()` from showing and the required action doesn't happen. I have tested it by entering a static number.

http://stackoverflow.com/comment/45704857
type: Comment
comment on: http://stackoverflow.com/a/28691360
has text: Your logic works just changed the date format for the json data to have time offset and comparision worked perfectly
type: AnswerComment
score: 0

http://stackoverflow.com/q/28704520
has comment: http://stackoverflow.com/comment/45699152
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45699947
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45702668
linked to: http://stackoverflow.com/q/13284083
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/45702263
has answer: http://stackoverflow.com/a/28706927
has comment: http://stackoverflow.com/comment/45699396
has comment: http://stackoverflow.com/comment/45699921
has comment: http://stackoverflow.com/comment/45699812
has title: Why does the following throw an "Object doesn't support property or method 'importNode'" in IE11?
has body: Why does the following throw an "Object doesn't support property or method 'importNode'" in IE11? Could it be my "document mode"? I am in "document mode" 7. Click Me For clarification I want the node, node to be created by the opener window, and I am using importNode in order to attempt to get this working in IE (it is not needed for Chrome). importNode was added in IE9 I think (https://msdn.microsoft.com/en-us/library/ie/gg130964%28v=vs.85%29.aspx).
answer count: 1
has comment: http://stackoverflow.com/comment/45700203
linked to: http://stackoverflow.com/q/27272454
accepted answer: http://stackoverflow.com/a/28706927
tagged with: internet-explorer
tagged with: javascript
linked to: http://stackoverflow.com/q/1811116

http://stackoverflow.com/q/28689226
type: UnansweredQuestion
has title: Call Action Method, close dialog and refresh parent
tagged with: razor
has body: I may be thinking about this incorrectly since I am new to MVC5. I have a CustomerInfo.cshtml view that lists CustomerContacts on it. Next to them is a '+' icon that will open a dialog window and allow them to add a new CustomerContact. On dialog open I call CustomerContactController Create GET method (passing it the customerId setting it to my model and passing it to the view). On save I call CustomerContactController Create POST method set the values and save to db. At this point how can I close the dialog window and refresh the parent CustomerInfo.cshtml page so the new contact will appear in the list. All of the Action methods require me to return something. I am opening my dialog from CustomerInfo.cshtml view like this: @(Html.Kendo().Window() .Name("windowContact") .Title("New Customer Contact") .LoadContentFrom("Create", "CustomerContact", new { customerId = Model.Id }) .Draggable() .Width(680) .Visible(false) .Events(events =&gt; events.Open("centerWindow")) ) In the dialog window I have a razor form. Here is the bottom of the dialog: &lt;input type="submit" value="Save" id="btnSave" class="btn btn-primary" /&gt; &lt;input type="button" value="Cancel" id="btnCancel" class="btn btn-default" /&gt; } &lt;script&gt; $("#btnCancel").click(function () { $("#windowContact").data("kendoWindow").close(); }); &lt;/script&gt; Here is what I am currently doing and it is taking me back to the CustomerInfo view but with a refresh. Is the only way to do it smoothly using AJAX? return RedirectToAction("CustomerInfo", "Customer", new { id = custContact.CustomerId });
has answer: http://stackoverflow.com/a/28691481
type: Question
has comment: http://stackoverflow.com/comment/45670337
tagged with: asp.net-mvc
tagged with: javascript
score: 0
tagged with: asp.net-mvc-5
answer count: 1
has comment: http://stackoverflow.com/comment/45670390
tagged with: jquery
has comment: http://stackoverflow.com/comment/45670364

http://stackoverflow.com/comment/45680415
comment on: http://stackoverflow.com/q/28693000
type: Comment
has text: Working Fiddle : http://jsfiddle.net/5gvv27rr/2/ : just change the number at the top of the Javascript
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45710330
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28710775
score: 0
has text: I need to use as part of browser fingerprint

http://stackoverflow.com/q/28632682
type: Question
has title: fabric.js push() not working when trying to call it using external javaScript
tagged with: javascript
tagged with: fabricjs
has comment: http://stackoverflow.com/comment/45569679
has body: I'm new to fabric.js. I'm trying simple example in this page. "Custom background image" http://fabricjs.com/customization/ it's working without error when I code it as Internal Javascript. But when I trying to use same code using External JavaScript. It says. Uncaught TypeError: Cannot read property 'push' of undefined HTML file Untitled Document JavaScript var canvas = new fabric.Canvas('c'); canvas.add(new fabric.Circle({ radius: 30, fill: '#f55', top: 100, left: 100 })); canvas.setOverlayImage('bg.png', canvas.renderAll.bind(canvas)); this.__canvases.push(canvas);
score: 0
has answer: http://stackoverflow.com/a/53759043
answer count: 1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/54628233
has comment: http://stackoverflow.com/comment/45566827

http://stackoverflow.com/comment/131677806
has text: It's a very bad practice to create for every cell it's own CellStyle and/or Font, by the way Excel sheet has style and fonts limited, so an advice for whom will use this example, to create some global styles/fonts for workbook and reuse it.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/33632416
type: Comment

http://stackoverflow.com/comment/45542219
type: Comment
comment on: http://stackoverflow.com/a/28613437
has text: You need to ID the inputs in your HTML markup and grab the values that in javascript such as: id="mInput2" Then use: var thisInput = getElementById('mInput2').value; However, the Radio Buttons are a separate issue, as well, and need a slightly different code to grab the 'selected' attribute.
score: 0
type: AnswerComment

http://stackoverflow.com/a/28656564
has comment: http://stackoverflow.com/comment/45609751
type: Answer
downvote count: 1
upvote count: 0
has comment: http://stackoverflow.com/comment/45609540
answers question: http://stackoverflow.com/q/28656528
has comment: http://stackoverflow.com/comment/45609655
score: -1
has body: .... if (likeCount &lt; 1) { return ""; } ....
has comment: http://stackoverflow.com/comment/45609467
has comment: http://stackoverflow.com/comment/45609611

http://stackoverflow.com/a/28720985
has comment: http://stackoverflow.com/comment/45729033
has comment: http://stackoverflow.com/comment/45737173
score: -3
type: Answer
has comment: http://stackoverflow.com/comment/45947983
has body: The "ID" must be unique, because of it "getElementById" is singular (Element), not plural like getElementsByTagName or getElementsByClassName (Elements). But you can use getElementsByTagName, getElementsByClassName, xpath or another ways to look for a particular DOM node/s. https://developer.mozilla.org/en/docs/Introduction_to_using_XPath_in_JavaScript Edit 2a: Using xpath It's obvious that if you use a single class for every block it's easiest to use getElementsByClassName. But with xpath you have more power to search into a document for a more complex pattern (a div tag with class "foo" and id that begins with "bar"). Example: http://jsfiddle.net/OscarGarcia/a8jqm636/1/ HTML code: Show information #1 Show information #2 Show information #3 This is information text #1: This is interesting! This is information text #2: What happened? Wow! This is information text #3: Be happy with CSS! CSS code: .information { display: none; } JavaScript code: function showMore(el) { var nodes = document.evaluate('//div[@class="information"]', document, null, XPathResult.ANY_TYPE, null); var result = nodes.iterateNext(); var target = el.getAttribute("href"); while (result) { if (result.getAttribute("id") == target) { result.style.display = 'block'; } else { result.style.display = 'none'; } result = nodes.iterateNext(); } return false; } This code will look for every div tag with class "information" and compare its "id" with the content of "href" attribute of clicked link. Hope it helps. Edit 2b: Show/hide information blocks without javascript Probably you don't need to use javascript at all! This is an example without javascript: http://jsfiddle.net/OscarGarcia/431nhjbb/ HTML code: Show information #1 Show information #2 Show information #3 This is information text #1: This is interesting! This is information text #2: What happened? Wow! This is information text #3: Be happy with CSS! CSS code: .information { display: none; } .information:target { display: block; } As you can see, a…
answers question: http://stackoverflow.com/q/28720782
downvote count: 3
has comment: http://stackoverflow.com/comment/45728851
has comment: http://stackoverflow.com/comment/45742075
has comment: http://stackoverflow.com/comment/45742201
has comment: http://stackoverflow.com/comment/45729068
has comment: http://stackoverflow.com/comment/45760560
upvote count: 0
has comment: http://stackoverflow.com/comment/45941150

http://stackoverflow.com/q/28748374
accepted answer: http://stackoverflow.com/a/28748962
tagged with: spring
type: AnsweredQuestion
score: 3
has title: Error adding new line in Spring.message property
has body: Hi there I´m using spring properties to localization of my text, so I have something like my.property.test=This is my propery Then in my Javascript I get the literal using spring.message var test = &lt;spring:message code="my.property.test"/&gt; With this scenario everything works like a charm. 'But' if I try to add a new line on the text as here: my.property.test=This is my \npropery or my.property.test=This is my \n\propery Browser always return me this error SyntaxError: missing } after property list onCriteriaNotOpenProcedureQualificationWorksBellMessage : ''This is my --------------------------------------------------------------------------| Any suggestion Solved Since is a message source, I have to use &lt;br/&gt;
upvote count: 3
tagged with: java
type: Question
linked to: http://stackoverflow.com/q/9207021
has comment: http://stackoverflow.com/comment/104772354
tagged with: javascript
has answer: http://stackoverflow.com/a/28748962
answer count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/45541433
comment on: http://stackoverflow.com/q/28619092
has text: Does [this fork of your fiddle](http://jsfiddle.net/amullins/ojqswfw8/) match up with what you expect?
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28681818
type: AnsweredQuestion
has title: Google Maps v3 Javascript: geojson overlays city and country names
has answer: http://stackoverflow.com/a/28681929
type: Question
has body: I´m adding some geojson data (polygon features) to a Google Map. Is it possible to add the geojson below the city and country names? map.data.addGeoJson(data);
has comment: http://stackoverflow.com/comment/45656645
answer count: 1
accepted answer: http://stackoverflow.com/a/28681929
tagged with: javascript
tagged with: google-maps-api-3
score: 0

http://stackoverflow.com/q/28742092
answer count: 1
has comment: http://stackoverflow.com/comment/45767319
has comment: http://stackoverflow.com/comment/45767269
has comment: http://stackoverflow.com/comment/45767632
has title: Javascript strange behavior, asynchronism issue?
has body: I have the next code: exports.getCommunities = function(user, callback) { //I am getting the communities for a user. community_users.find({'user':user}).sort({_id : 1 }).toArray(function(err, docs) { docs.sort var clas = []; //for each community, I need to find the country of that community and add it to each docs object. To do so, i call a getCommunityByName function that finds the community document in the communities mongodb collection by a given name. docs.forEach(function(entry,i) { clas.push(entry); getCommunityByName(entry.name, function(e, o){ if (o){ clas[i].country = o.country; if (docs.length-1 == i) {callback(null,clas)} } else { console.log('community-not-found: '+entry.name)} }); }); }); }; I am having strange behavior. Imagine docs is a 7 object array. I am obtaining a 7 positions array but a random number of them have the country key. Sometimes only 3 of them have the country key, sometimes are 5, sometimes 6... I think that the if statement to call the callback is not waiting for every call to getCommunityByName and i don't know really why... I need some light in this... Regards,
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28742207
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28742207

http://stackoverflow.com/a/28677937
has comment: http://stackoverflow.com/comment/75462299
answers question: http://stackoverflow.com/q/28676872
type: Answer
has body: With $("#tags2").autocomplete("widget").addClass('fixed-height'); you can add a height class to the autocomplete widget. If you want to set a global max-height you could override the css class .ui-autocomplete. See the following demo for some ways to change the height but I think the best will be addClass. (You can find the fiddle with the same code here) $(function () { var availableTags = [ "ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme"]; $("#tags").autocomplete({ source: availableTags }); $("#tags2").autocomplete({ source: availableTags }); $("#tags3").autocomplete({ source: availableTags }); $("#tags2").autocomplete("widget").addClass('fixed-height'); $("#tags3").autocomplete("widget").attr('style', 'max-height: 400px; overflow-y: auto; overflow-x: hidden;') }); .ui-autocomplete { max-height: 100px; overflow-y: auto; /* prevent horizontal scrollbar */ overflow-x: hidden; } /* IE 6 doesn't support max-height * we use height instead, but this forces the menu to always be this tall */ * html .ui-autocomplete { height: 100px; } .fixed-height { padding: 1px; max-height: 200px; overflow: auto; } Tags max-height set with class .ui-autocomplete: Tags max-height set manually with class fixed-height: Tags max-height set with jQuery:
score: 0

http://stackoverflow.com/q/28657757
has comment: http://stackoverflow.com/comment/45611663
type: Question
possible better answer: http://stackoverflow.com/a/28658742
tagged with: javascript
has comment: http://stackoverflow.com/comment/45613117
has answer: http://stackoverflow.com/a/28658742
has comment: http://stackoverflow.com/comment/45611555
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/28657851
has comment: http://stackoverflow.com/comment/45611524
tagged with: angularjs
has title: Parse field name which contain dot character with $parse
has comment: http://stackoverflow.com/comment/45611632
has comment: http://stackoverflow.com/comment/45611604
has comment: http://stackoverflow.com/comment/45612588
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28657851
has body: Consider I have object which has a field that contains dot character and I want to parse it with $parse , For example , the follow code logs undefined - var getter = $parse('IhaveDot.here'); var context = {"IhaveDot.here":'The point value'}; scope.name = getter(context); console.log(scope.name); // logs 'undefined' how to make it to logs the field value - e.g - The point value ? var myAppModule = angular.module('myAppModule', []). directive('n',function($parse){ return { restrict: 'E', link: function(scope,element,attrs) { var getter = $parse('IhaveDot.here'); var context = {"IhaveDot.here":'The point value'}; scope.name = getter(context); console.log(scope.name); } } }); &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.7/angular.min.js"&gt;&lt;/script&gt; &lt;n&gt;&lt;/n&gt;

http://stackoverflow.com/a/28599813
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28599423
has body: You can easily move the fn into the new namespace. And add the js code in a separate external .js file. var myns = {}; myns.globvar = {}; //global variables restricted to the namespace. myns.funcs = {}; //Add your functions to the funcs. myns.funcs.samplefunctest= function () { / * Code here */ } Ref - http://addyosmani.com/resources/essentialjsdesignpatterns/book/#detailnamespacing
answers question: http://stackoverflow.com/q/28599423

http://stackoverflow.com/comment/45536736
score: 0
type: AnswerComment
has text: Thank you all for your comments and answers. Mathletics: ihmo it will be useful because (even if it is a basic in JS) other 'new guys' can get the idea of 'basics in JS obfuscation' ;) MiltoxBeyond: thanks, this is the idea ;) T.J. Crowder - big thanks for your answer!
type: Comment
comment on: http://stackoverflow.com/a/28612485

http://stackoverflow.com/q/28740416
has body: Before all, I just want to apologize to my bad English (french school are not so good for practicing other languages ...). I have a header.html on my site. I cannot modify him because it's not mine. I just want to call an other html (one of mine, that i can modify, we can name it toto.html), when header.html is display (in other words, it's not a Java functions who call my other html, it's header.html). I've tried some Jquery functions (like load()), Javascript and even the macro &lt;#include from HTML, but without success. Thanks to all for your responses. Have a good day !
type: Question
has answer: http://stackoverflow.com/a/28740662
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28740664
has title: Load an HTML when another is display without modify him
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion

http://stackoverflow.com/comment/75256408
type: Comment
type: QuestionComment
has text: does anyone has working example of the above question posted?
comment on: http://stackoverflow.com/q/28745357
score: 0

http://stackoverflow.com/a/28693296
type: Answer
score: 0
has body: When the popup opens you only have to set a class on the body to set it fixed: body.popup-visible { position : fixed; width: 100%; height: 100%; } See the updated fiddle.
answers question: http://stackoverflow.com/q/28691592

http://stackoverflow.com/comment/45736886
comment on: http://stackoverflow.com/a/28721774
has text: Thanks, this is the hint that I needed. The containers don't have a size relative to anything. The bounding box is just that, a bounding box of its contents. I adjusted my math to make sure the group's ***contents*** stayed in the proper spot relative to the origin *before* they were moved. Seems to be working as expected now.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28720484
upvote count: 2
downvote count: 3
has body: try the ISO 8601 format, or better yet, read this http://www.ecma-international.org/ecma-262/5.1/#sec-15.9 Edit: if you have no other choice than to get it in that format though, i guess you'll need something like this: function DDMMYYYY_HHMMtoYYYYMMDD_HHMM($DDMMYYYY_HHMM) { var $ret = ''; var $foo = $DDMMYYYY_HHMM.split('.'); var $DD = $foo[0]; var $MM = $foo[1]; var $YYYY = $foo[2].split(' ') [0].trim(); var $HH = $foo[2].split(' ') [1].split(':') [0].trim(); var $MMM = $foo[2].split(' ') [1].split(':') [1].trim(); return $YYYY + '-' + $MM + '-' + $DD + ' ' + $HH + ':' + $MMM; } var d=new Date(DDMMYYYY_HHMMtoYYYYMMDD_HHMM('13.02.2015 12:55'));
score: -1
answers question: http://stackoverflow.com/q/28720337
type: Answer

recaptcha
tag name: recaptcha
tags question: http://stackoverflow.com/q/28674946
tags question: http://stackoverflow.com/q/28670429
type: Tag

http://stackoverflow.com/q/28672701
favorite count: 0
has body: I was just going through the source of modal.js and came across the following line of code: var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) It is quite confusing to understand what e is being defined as, as I have never seen such a construct in JS/Jquery. I tried Googling jQuery.Event() and $.Event, but all i get in the jQquery doc's is this page, which isn't leading me anywhere. The line in concern is line 50 in modal.js. If I run console.log(_relatedTarget); i get the following HTML object: &lt;a data-target="#myModal" data-toggle="modal" class="btn btn-primary btn-lg"&gt; I didn't want to post an overly complicated question, so I am just posting the relevant line of code. I know the piece of code I have provided uses object and looking at it might not give you an outright overview of what that line is doing, but if somebody can tell me what vaguely that line of code is doing or seems to be doing, i could go look up. As of now, I am stuck on this line.
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28672776
tagged with: twitter-bootstrap
has title: unknown jquery method used in modal.js
upvote count: 1
type: Question
score: 1
tagged with: javascript
answer count: 1
has answer: http://stackoverflow.com/a/28672776
downvote count: 0
tagged with: jquery

http://stackoverflow.com/a/28670571
upvote count: 2
type: AcceptedAnswer
downvote count: 0
has body: Try this, var object = { a: ["A1"], b: ["B1", "B2"], c: ["C1", "C2", "C3", "C4"] }; var keys = Object.keys(object); var obj = {}; for(var j=0,l=keys.length;j&lt;l;j++){ for (var i = 0; i &lt; object[keys[j]].length; i++) { obj[object[keys[j]][i]] = keys[j]; } } console.log(obj); var object = { a: ["A1"], b: ["B1", "B2"], c: ["C1", "C2", "C3", "C4"] }; var keys = Object.keys(object); var obj = {}; for(var j=0,l=keys.length;j&lt;l;j++){ for (var i = 0; i &lt; object[keys[j]].length; i++) { obj[object[keys[j]][i]] = keys[j]; } } console.log(obj); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
accepted answer of: http://stackoverflow.com/q/28670498
answers question: http://stackoverflow.com/q/28670498
type: Answer
score: 2

http://stackoverflow.com/comment/45755040
comment on: http://stackoverflow.com/a/28734832
score: 0
type: AnswerComment
type: Comment
has text: What have you tried re rotation? There are numerous tutorials on the web on how to do rotation and other transforms. StackOverflow is for help with problems you can't solve by yourself.

http://stackoverflow.com/q/28657119
score: 0
answer count: 1
has title: Use Ajax return value in Jade file
has answer: http://stackoverflow.com/a/28657174
tagged with: jquery
favorite count: 0
tagged with: ajax
tagged with: node.js
type: AnsweredQuestion
has body: I am using ExpressJS together with the Jade template engine. I am trying to do the following: In a Jade file, I extract a variable which I need in a JavaScript file. In this JavaScript file, I send an Ajax request to the Express server. This returns some data and I would like to put this data in another variable which I can use again in my Jade file. Here is my code: Jade file: script. var userID = '#{userObject.ID}'; //Extract variable script(src='/javascripts/account.js') //needed in this file p | #{papersObject} //This should be the result from the Ajax request Ajax request: $(document).ready( function() { $.ajax({ url: '/accountdata', /* jshint ignore:start */ data: {'personId': userID}, /* jshint ignore:end */ dataType: 'JSON', success: function(data, status, jqXHR) { var papersObject = JSON.stringify(data.result); } }); }); app.js: var accountData = require('./routes/accountdata'); app.use('/accountdata', accountData); Route: var express = require('express'); var router = express.Router(); router.get('/', function (req, res) { data = //Some database function res.send({result: data}); }); module.exports = router; Why is #{papersObject} not showing on my page? How can I get this to work?
accepted answer: http://stackoverflow.com/a/28657174
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
tagged with: express

http://stackoverflow.com/comment/45573205
has text: This question is already answered here: http://stackoverflow.com/questions/4550505/getting-random-value-from-an-array
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28636748
type: QuestionComment

http://stackoverflow.com/comment/45623388
has text: Now add a little code or a reduced test case so people can understand and try and help you
comment on: http://stackoverflow.com/q/28664217
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/q/28730346
type: Question
downvote count: 0
tagged with: javascript
upvote count: 3
tagged with: require
answer count: 1
has title: "require" DDO option of Angular directive does not throw an error when it should
favorite count: 0
tagged with: angularjs
has body: Forgive me if this is obvious, but I am just learning the ropes. I've been following this article, trying to understand directives in AngularJS. The docs specify that the require option of a directive's DDO should throw an error if the referred-to directive is not found. I cannot seem to make it throw an error - here's my code (I'm using v1.3.13) test.html: &lt;body ng-app="Test"&gt; &lt;dir /&gt; &lt;/body&gt; test.js: var test = angular.module('Test', []); test.directive('dir', function() { return { require: '99 red baloons', restrict: 'E', template: '&lt;div&gt;this should not work&lt;/div' }; }); (Here's the corresponding jsfiddle) Everything seems to work fine, the $compile function doesn't complain, the directive gets picked up and rendered in the DOM just fine. What am I missing? Thank you! EDIT Seems this is a bug in Angular, here's the issue to match
tagged with: angularjs-directive
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/28749315
accepted answer: http://stackoverflow.com/a/28749315

http://stackoverflow.com/q/28640274
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45591904
upvote count: 1
tagged with: php
type: Question
has title: Ember-data: How DS.attr("number") is supposed to work?
has comment: http://stackoverflow.com/comment/45592645
has answer: http://stackoverflow.com/a/28646904
tagged with: ember-data
has comment: http://stackoverflow.com/comment/45589426
has answer: http://stackoverflow.com/a/28714708
tagged with: javascript
has comment: http://stackoverflow.com/comment/45740700
has comment: http://stackoverflow.com/comment/45593067
answer count: 2
has comment: http://stackoverflow.com/comment/45739056
has body: I'm using DS.RESTAdapter, php on server. I have a model UacList: DS.Model.extend({ dummyFieldForErrors: DS.attr("string"), selected: DS.attr("number"), uacs: DS.hasMany("uac") }); Ember sends request GET /rest/uacLists/1. Server response is: { "uacList":{ "id":1, "selected":32483, "uacs":[33618,9678,...,33656] }, "uacs": [...] } But Ember Inspector tells me that selected is undefined (other attributes have values they should have according to server response). No matter if there is a quotes ("selected":"32483") or not ("selected":32483), it is undefined anyway. If I define this attribute as a string, it works but I don't like when an integer is defined as a string.
has comment: http://stackoverflow.com/comment/45593924
tagged with: ember.js
downvote count: 0
has comment: http://stackoverflow.com/comment/45582237
score: 1
has comment: http://stackoverflow.com/comment/45740298
favorite count: 0
has comment: http://stackoverflow.com/comment/45765289

http://stackoverflow.com/comment/45816694
has text: No, that's unexpected, of course. Most likely your MongoDB shut down before the second call. Check that it is running. If it's not, check the log to see what happened.
comment on: http://stackoverflow.com/q/28731992
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28630976
tagged with: javascript
score: 0
answer count: 0
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/45562626
has body: My form has listbox ok I am selecting data on change event of listbox using some javascript <?php foreach ($society as $soc){ ?> <option value="<?php echo $soc["society"]; ?>"><?php echo $soc["society"]; ?> <?php }?> **Data displays in below div** Person info will be listed here... But i need to echo data inside multiple textboxes..so what to change in javascript and how to echo data inside all textboxes here.. plz help me... below is my 3 textboxes in which i need to echo data php code <?php $q = $_GET['q']; $con = mysqli_connect('localhost','root','','circulation_scheme_prepaid'); if (!$con) { die('Could not connect: ' . mysqli_error($con)); } mysqli_select_db($con,"ajax_demo"); $sql="SELECT * FROM societymaster WHERE society = '".$q."'"; $result = mysqli_query($con,$sql); while($row = mysqli_fetch_array($result)) { echo $row['city'] ; echo $row['amount'] ; echo $row['coupon'] ; } mysqli_close($con); ?>
has comment: http://stackoverflow.com/comment/45566043
has comment: http://stackoverflow.com/comment/45562456
type: Question
has comment: http://stackoverflow.com/comment/45563914
has title: javascript php code to echo selected data inside multiple textbox
has comment: http://stackoverflow.com/comment/45562406

http://stackoverflow.com/a/28700144
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/45690429
has body: To use the "power" API, you need to declare the proper permission, as indicated at the very beginning of documentation: "permissions" : ["power"], If you don't include this, you can run into the "undefined" error. However, the error you quote is strange. It should be Cannot read property 'requestKeepAwake' of undefined Double-check for typos. I recommend deleting the whole string and re-typing it by hand (a stray Unicode unprintable character is a possibility)
has comment: http://stackoverflow.com/comment/45690510
answers question: http://stackoverflow.com/q/28699971
downvote count: 0
has comment: http://stackoverflow.com/comment/45690591
type: Answer

http://stackoverflow.com/a/28700263
answers question: http://stackoverflow.com/q/28700137
has comment: http://stackoverflow.com/comment/45690615
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45690684
has comment: http://stackoverflow.com/comment/45690762
score: 0
has comment: http://stackoverflow.com/comment/45691756
type: Answer
has body: That's it

http://stackoverflow.com/comment/45554264
type: AnswerComment
has text: you don't need to use `.each()`
type: Comment
comment on: http://stackoverflow.com/a/28626787
score: 1

http://stackoverflow.com/q/28730817
answer count: 1
favorite count: 0
has body: I have var something = $('id1', 'id2'); What is the equivalent in jQuery?
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/28730843
type: Question
tagged with: prototypejs
downvote count: 0
has title: How to convert $('id1', 'id2') in Prototype JS to jQuery?
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28730843

http://stackoverflow.com/comment/45744972
type: AnswerComment
has text: Also tried that with no joy :( Should I be storing the from date and to date in hidden input fields or anything?
type: Comment
comment on: http://stackoverflow.com/a/28707290
score: 0

http://stackoverflow.com/a/28657447
score: 0
answers question: http://stackoverflow.com/q/28657287
has body: Your $scope.submit function has nothing inside it for routing. It should be: $scope.submit = function($scope) { $scope.$apply(function() { $location.path("*place your details page here*"); }); } Note that you also need to inject $location to your controller, as follows: FormApp.controller('CustomerDetailsController', ['$scope', '$location', function($scope, $location) ... Try reading the following for more details: https://docs.angularjs.org/api/ng/service/$location Also have you tried checking your paths? (e.g. angular.min.js, script.js)
type: Answer

http://stackoverflow.com/q/28600993
accepted answer: http://stackoverflow.com/a/28601509
type: Question
has comment: http://stackoverflow.com/comment/45507704
tagged with: database
tagged with: javascript
has body: I'm currently in the process of making an App using Javascroipt and Phonegap that needs to save a Database or something similar localy while offline until it is later synced with an external Database (not the main Problem). So whats the best solution for managing relativly big chunks of data that have to be modified a lot during runtime, be able to delete entrys, add new entrys, read entrys using attributes and ids, sort entrys and be able to import and export data in a file (i.e give me a string or object that I can save in a file using phonegap)? I already looked at TaffyDB (abandonned since 2 years) and pounchDB (seams to work using ajax and therefore require internet connection).
score: 0
has comment: http://stackoverflow.com/comment/45507875
answer count: 1
has title: Managing Large amounts of Data in Javascript
has answer: http://stackoverflow.com/a/28601509
tagged with: cordova
tagged with: data-management
type: AnsweredQuestion

http://stackoverflow.com/a/28598329
type: Answer
answers question: http://stackoverflow.com/q/28598223
score: 0
has body: Using jquery you can type: $("iframe").contents().find("body").html(yourHTML); Important to say, this only works if iframe and your parent window are on the same domain, by security reasons.

http://stackoverflow.com/comment/127839498
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/68055157
has text: @Timo Put some `console.log` to see `fileContent` variable XD I bet you forgot the await and you are trying to `.match()` a promise. This could be a side conversation, first try to learn how to debug your code :)

http://stackoverflow.com/comment/45631408
score: 0
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/71460/discussion-between-dvideby0-and-sam).
type: AnswerComment
comment on: http://stackoverflow.com/a/28668406
type: Comment

http://stackoverflow.com/q/28618878
type: Question
has body: I have a drpdown list. In my html I have this: Choose university I bind this dropdown from my collection. I want to show optional text as first element as you see above. First element is always empty. How do I do this?
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28618920
upvote count: 2
answer count: 2
possible better answer: http://stackoverflow.com/a/37545547
has answer: http://stackoverflow.com/a/37545547
accepted answer: http://stackoverflow.com/a/28618920
has title: Angular - Default option of select not showing in dropdown
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/comment/45592723
comment on: http://stackoverflow.com/q/28646837
score: 0
type: Comment
type: QuestionComment
has text: See: http://tutorials.jenkov.com/angularjs/custom-directives.html

http://stackoverflow.com/q/28709007
favorite count: 0
has body: I want to set the default view/home location for a cesium app. I don't just want to flyTo the location once; I want the location set as the default/home - so that it can be used elsewhere in the app - e.g. in the HomeButton Widget. I've tried setting the Camera.DEFAULT_VIEW_RECTANGLE (docs here) like this: var extent = Cesium.Rectangle.fromDegrees(117.940573,-29.808406,118.313421,-29.468825); viewer.camera.DEFAULT_VIEW_RECTANGLE = extent; But it doesn't work.. For completeness, here's how I'm initializing the app: var viewer = new Cesium.Viewer('cesiumContainer', { terrainProvider : new Cesium.CesiumTerrainProvider({ url : '//cesiumjs.org/stk-terrain/tilesets/world/tiles' }), mapProjection : new Cesium.WebMercatorProjection(), timeline: false, animation: false, }); Any suggestions? If any further info is needed please let me know.
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/65607475
has answer: http://stackoverflow.com/a/65607475
accepted answer: http://stackoverflow.com/a/28721315
type: Question
upvote count: 12
tagged with: cesiumjs
has title: How to Set the Default View Location (Cesium 1.6)
tagged with: javascript
score: 12
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/28721315

http://stackoverflow.com/comment/45757510
score: 0
type: Comment
type: QuestionComment
has text: @SarangaSachinthana I believe no need mention [HttpPost] just do change your action name to `PostCustomerList`
comment on: http://stackoverflow.com/q/28736107

http://stackoverflow.com/a/28622345
has body: Try setting header in jEcho.php file (not tested) header('Content-Type: application/javascript');
has comment: http://stackoverflow.com/comment/45546652
answers question: http://stackoverflow.com/q/28622052
score: 0
type: Answer

http://stackoverflow.com/a/28665249
has comment: http://stackoverflow.com/comment/45659920
has comment: http://stackoverflow.com/comment/45655836
has comment: http://stackoverflow.com/comment/45656214
has comment: http://stackoverflow.com/comment/98795501
type: AcceptedAnswer
has body: To track event hover, you still need to add the proper JavaScript. For example if you were using jQuery: $("#someID").mouseover(function(){ ga('send', 'event', 'button', 'hover', ...); )} The main point being that the GA event parameters don't define the logic of the event. It's still JavaScript in the end that does that.
downvote count: 0
has comment: http://stackoverflow.com/comment/45661642
has comment: http://stackoverflow.com/comment/45661697
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28663696
has comment: http://stackoverflow.com/comment/45649545
accepted answer of: http://stackoverflow.com/q/28663696
score: 1

http://stackoverflow.com/q/28631520
score: 0
answer count: 3
tagged with: javascript
has answer: http://stackoverflow.com/a/28675939
has comment: http://stackoverflow.com/comment/45563318
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45563416
tagged with: jquery
has comment: http://stackoverflow.com/comment/45563085
tagged with: ajax
possible better answer: http://stackoverflow.com/a/28631652
type: Question
accepted answer: http://stackoverflow.com/a/28675939
has answer: http://stackoverflow.com/a/28631652
has answer: http://stackoverflow.com/a/28631709
has title: JQuery: Unbind click event not working as expected
has body: I'm having a problem with the unbind event from jquery. I load a modal after clicking a button and in this modal I have two possibilities, continue or cancel. If I continue there are some validations and if something goes wrong an alert should appear, or if I click cancel I close the modal. But if i cancel the modal and then I click the button that loads the modal with an ajax call again when clicking continue the alert appears 2 times, when it should appear only once. I've tried using the unbind event as is seen in the code but it doesn't seem to work, any ideas? The ajax call is done by the followinenter code hereg code: function ValidacionGeneral() { var frmObs = $("#frmCreate"); $.ajax({ url: '@Url.Action("ValidacionGeneral", "Viajes")', type: 'POST', dataType: "text", data: frmObs.serialize(), success: function (data) { if (data == "OK") { $('#frmCreate').submit(); } else { $.unblockUI(); $.modal(data); } } }); } And the script of the modal is: &lt;script type="text/javascript"&gt; $(document).ready(function () { $("#btnAceptarValidacionGeneral").unbind("click"); $("#btnAceptarValidacionGeneral").live("click", function (e) { e.preventDefault(); var error1 = false; var error2 = false; var error3 = false; var error4 = false; if ($('#ddlMotivosDistancia').length) { error1 = $("#ddlMotivosDistancia").val() == '00000000-0000-0000-0000-000000000000'; } if ($('#ddlMotivosRendimiento').length) { error2 = $("#ddlMotivosRendimiento").val() == '00000000-0000-0000-0000-000000000000'; } if ($('#ddlMotivosCarga').length) { error3 = $("#ddlMotivosCarga").val() == '00000000-0000-0000-0000-000000000000'; } if ($('#ddlMotivosDuracion').length) { error4 = $("#ddlMotivosDuracion").val() == '00000000-0000-0000-0000-000000000000'; } if (error1 || error2 || error3 || error4) { alert('Debe seleccionar los motivos de tolerancia correspondientes para las alertas'); } else { var form = $('#frmCreate'); if (form.html() == null) { form = $('#frmEdit'); } form.submit(); } }); $("#btnCancela…

filewriter
tag name: filewriter
tags question: http://stackoverflow.com/q/28710804
type: Tag

http://stackoverflow.com/a/57145556
downvote count: 1
upvote count: 0
has body: I 'm using pagination to display my resultset on application because sometimes the data is in millions and sending all data to UI makes DOM heavy resulting in slowness and app unresponsiveness. For read view I'm good, but in edit view if a user is adding multiple records (thousands or millions) at once (which are essentially pulled from another datasource), how shall I handle that data.
type: Answer
has comment: http://stackoverflow.com/comment/100806527
answers question: http://stackoverflow.com/q/28603030
score: -1

http://stackoverflow.com/comment/45594337
type: QuestionComment
comment on: http://stackoverflow.com/q/28647478
has text: canvas does not get updates as the values change in angularjs. you should remove the old canvas and create a new one
score: 0
type: Comment

http://stackoverflow.com/a/29674049
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28603267
score: 1
downvote count: 0
has body: If you use gulp, you can use devDependencies flag of wiredep plugin. gulp.task('bower', function () { gulp.src('./app/index.html') .pipe(wiredep({ devDependencies: true })) .pipe(gulp.dest('./dest')); });

http://stackoverflow.com/q/28620157
has comment: http://stackoverflow.com/comment/45542879
linked to: http://stackoverflow.com/q/28610501
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28620481
type: AnsweredQuestion
has title: Javascript one liner to make sure checkbox is checked?
favorite count: 0
type: Question
upvote count: 2
has body: I am working with selenium ide and was wondering if there is a one line that can make sure a checkbox is checked. or any other selenium javascript commands you've used in the past would be greatly appreciated. Thanks all!!
answer count: 1
has comment: http://stackoverflow.com/comment/45543252
score: 0
downvote count: 2
tagged with: selenium
has answer: http://stackoverflow.com/a/28620481

d3.js
tags question: http://stackoverflow.com/q/28717674
tags question: http://stackoverflow.com/q/28603796
tags question: http://stackoverflow.com/q/28639889
tags question: http://stackoverflow.com/q/28615033
tags question: http://stackoverflow.com/q/28615597
tags question: http://stackoverflow.com/q/28720553
tags question: http://stackoverflow.com/q/28742630
tags question: http://stackoverflow.com/q/28674371
tags question: http://stackoverflow.com/q/28647623
tags question: http://stackoverflow.com/q/28685146
tags question: http://stackoverflow.com/q/28732380
tags question: http://stackoverflow.com/q/28624255
tags question: http://stackoverflow.com/q/28727388
tags question: http://stackoverflow.com/q/28710373
tags question: http://stackoverflow.com/q/28715020
tags question: http://stackoverflow.com/q/28742899
tags question: http://stackoverflow.com/q/28744547
tags question: http://stackoverflow.com/q/28658748
tags question: http://stackoverflow.com/q/28693043
tags question: http://stackoverflow.com/q/28704093
tags question: http://stackoverflow.com/q/28705913
tags question: http://stackoverflow.com/q/28634283
tags question: http://stackoverflow.com/q/28676186
tags question: http://stackoverflow.com/q/28638126
tags question: http://stackoverflow.com/q/28677690
tags question: http://stackoverflow.com/q/28689462
tags question: http://stackoverflow.com/q/28747682
tags question: http://stackoverflow.com/q/28680996
type: Tag
tags question: http://stackoverflow.com/q/28663562
tags question: http://stackoverflow.com/q/28711536
tags question: http://stackoverflow.com/q/28713419
tags question: http://stackoverflow.com/q/28745398
tags question: http://stackoverflow.com/q/28719086
tags question: http://stackoverflow.com/q/28650096
tags question: http://stackoverflow.com/q/28664826
tags question: http://stackoverflow.com/q/28714419
tags question: http://stackoverflow.com/q/28621747
tags question: http://stackoverflow.com/q/28658493
tags question: http://stackoverflow.com/q/28699691
tags question: http://stackoverflow.com/q/28653331
tags question: http://stackoverflow.com/q/28613475
tags question: http://stackoverflow.com/q/28744768
tags question: http://stackoverflow.com/q/28669830
tags question: http://stackoverflow.com/q/28671388
tags question: http://stackoverflow.com/q/28612403
tags question: http://stackoverflow.com/q/28723036
tags question: http://stackoverflow.com/q/28723447
tag name: d3.js
tags question: http://stackoverflow.com/q/28691146
tags question: http://stackoverflow.com/q/28733489
tags question: http://stackoverflow.com/q/28637598
tags question: http://stackoverflow.com/q/28681481
tags question: http://stackoverflow.com/q/28635733
tags question: http://stackoverflow.com/q/28612163
tags question: http://stackoverflow.com/q/28677789
tags question: http://stackoverflow.com/q/28698696
tags question: http://stackoverflow.com/q/28662624
tags question: http://stackoverflow.com/q/28599233
tags question: http://stackoverflow.com/q/28663313
tags question: http://stackoverflow.com/q/28626550
tags question: http://stackoverflow.com/q/28616948
tags question: http://stackoverflow.com/q/28670614
tags question: http://stackoverflow.com/q/28662810
tags question: http://stackoverflow.com/q/28609929
tags question: http://stackoverflow.com/q/28682804
tags question: http://stackoverflow.com/q/28641821
tags question: http://stackoverflow.com/q/28649650
tags question: http://stackoverflow.com/q/28700591
tags question: http://stackoverflow.com/q/28714632

http://stackoverflow.com/q/28680613
has answer: http://stackoverflow.com/a/28693103
tagged with: polymer
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28693103
tagged with: dom
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28704529
tagged with: function
possible better answer: http://stackoverflow.com/a/28704529
has comment: http://stackoverflow.com/comment/45654109
has title: How can I use a javascript function to create polymer elements which can call javascript functions
has comment: http://stackoverflow.com/comment/45709355
tagged with: custom-element
has body: I have an array of objects, each of which I want to render into polymer cord-card element. Each element when tapped, i'd like to call a javascript function. I've used a simple loop to create the elements with javascript however nothing happens when I click/tap the element. Here is part of my JS function to create the element: createElements: function() { ... var count = results.length; var custom = ""; for (var a = 0; a < count; a++)//places results in cards { custom += ' '; custom += ' '; custom += ' '; custom += ' '; custom += ' '; custom += ' '; custom += ' '; } this.$.result.innerHTML = custom;//places card elements on page }, test: function() { alert("works"); } I'm trying to render the cards within a larger custom polymer-element. The cards render fine, but when I click on them I get nothing. If however the card element already existed within the document as opposed to being inserted by JS like i'm trying to do, then it works fine. Only when I try to insert the very same markup by JS do I have this issue.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45672727
has comment: http://stackoverflow.com/comment/45709367
type: Question

http://stackoverflow.com/comment/46032676
score: 0
has text: I tried this but it doesn't work. To be clear, I replaced this line: ` toggleSidebar.on("click", function(){` with this line: `$(document).on("click", ".togglesidebar", function(){` within the `ready()` function. Also, the issue is primarily on the word & character counter. That is what is not working on my `/posts/new/` page. This change doesn't fix that.
type: Comment
comment on: http://stackoverflow.com/a/28837762
type: AnswerComment

http://stackoverflow.com/q/28663485
type: Question
tagged with: css
accepted answer: http://stackoverflow.com/a/28663694
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28663629
possible better answer: http://stackoverflow.com/a/28663629
has body: I have an animated gradient as a background div on my website. However, whenever I try to apply css styling to the HEIGHT such as "100%" or "background: cover", etc., so that it will reach the bottom of any window, the gradient just stops functioning. It only seems to like being styled with a discreet pixel height, which is not ideal. Below is my css and html. Any ideas on how to get the gradient to scale to fit windows as opposed to being just a single discreet length? I have it set at width:100% which functions perfectly in that direction so I am stumped! Link: http://studiopowell.net/TEST_gradient.html #gradient { width: 100%; height: 1200px; padding: 0px; margin: 0px; opacity: 0.1; margin-top: -850px; position: relative; z-index: 10; } &lt;/head&gt; &lt;body&gt; &lt;div class="titles"&gt;&lt;img src="archive-icon.png" width="185" height="185" alt="studio powell michael powell studiopowell art artist books installation video" /&gt;&lt;br /&gt;&lt;br /&gt;M I C H A E L &amp;nbsp; P O W E L L&lt;br /&gt;&lt;br /&gt;&lt;/div&gt; &lt;a class="fancybox" rel="group" href="archive-icon.png"&gt;&lt;img src="ruby ball.jpg" alt="" width="200" /&gt;&lt;/a&gt; &lt;div id="gradient"&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt;
has comment: http://stackoverflow.com/comment/45622029
has answer: http://stackoverflow.com/a/28663694
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
has title: animated gradient (javascript) background will not extend to full height of window
tagged with: linear-gradients
has comment: http://stackoverflow.com/comment/45622004

http://stackoverflow.com/comment/45632765
comment on: http://stackoverflow.com/q/28668883
score: 0
type: Comment
type: QuestionComment
has text: If you could confirm whether you are using the Bootstrap UI, or Foundation Directives, I can give you further assistance with the Modal.

http://stackoverflow.com/comment/45524674
type: Comment
comment on: http://stackoverflow.com/a/28610447
has text: I forgot about this initially too, but `removeEventListener` needs the event type too: `removeEventListener("click", foo);`
score: 1
type: AnswerComment

http://stackoverflow.com/q/28703854
has comment: http://stackoverflow.com/comment/45894995
tagged with: javascript
tagged with: mapreduce
has comment: http://stackoverflow.com/comment/45723638
has body: I have a CouchDB database with the following type of documents, representing events that happen within a building: { person: 1 timestamp: 1 event: { type: enter room: b } } and { person: 2 timestamp: 5 event: { type: leave room: b } } The problem that I want to solve is the following: I want to know the total amount of time that every other person spent in the same room as person 1. Note that any person can enter and leave many rooms at many different times. I honestly don't know whether MapReduce is the best paradigm for this, or if I should just export my data and write a separate script to figure this stuff out (although this is probably not a feasible solution for our production environment). As a starting solution lets assume that all the data is sane, and thus someone entering a room will also leave that room at a later time. However, in a final solution this requirement will probably have to be relaxed, because some events may be missing. I have thought of a potential solution, but I have no idea whether this is at all possible or how to do this in couchdb. Here is an outline. Create a view that emits the following format, for every person entering a room event: { [room, person, timestamp], null } Create a view that emits { [room, timestamp], null} for every time person 1 exits the room (could be for all people, but is unnecessary). Create a view that for each exiting a room event for any person except person 1, does the following. In the mapping step: Queries the first view to find the last timestamp when that person entered the room. Queries the first view to find all times before the exiting the room event that person 1 entered that room For each of those times, queries the second view to find all exit times for that room, and for each interval checks what the overlap is. Sum these overlaps together and emit as { person, time } Reduce: for every person, sum all the times together. However, this relies on me being able to figure out how to query a different…
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/28949532
tagged with: couchdb
favorite count: 0
has title: Couchdb: is it possible to query a view from within another view?
type: AnsweredQuestion
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45727458
has comment: http://stackoverflow.com/comment/45771467
has answer: http://stackoverflow.com/a/28949532
type: Question

http://stackoverflow.com/a/28610519
type: AcceptedAnswer
type: Answer
has body: "In this case the error is displayed in this way:" That is how the jQuery Validate plugin creates the error messages. ".... as is done by the default browser:" That is how the browser uses HTML5 validation attributes to create the error messages. "I would rather see it as is done by the default browser: How can I do it?" Remove the jQuery Validate plugin to allow the browser default (HTML5) to take over. Otherwise, you cannot let the browser use HTML5 validation while using the jQuery Validate plugin, because the plugin dynamically disables any HTML5 validation and takes over.
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28603967
score: 1
answers question: http://stackoverflow.com/q/28603967
has comment: http://stackoverflow.com/comment/45529720
upvote count: 1

http://stackoverflow.com/q/28602122
has title: Overflow working in Mozilla but not on Chrome and Android (-webkit-) browser
upvote count: 1
tagged with: google-chrome
has body: I want a scroll-bar in my page so I can scroll down for content. Header/Footer is fixed. Issue : In Chrome it doesn't show a scroll-bar, and also the image is overlapping with the header. In Mozilla it shows correctly. Check screenshots. Here is my HTML. Done we will append product info here.. will allow scroll. End of Info section. Here is my CSS. .popimg{ /*border:"1px solid",*/ width:"320px", height:"320px", marginLeft:"-160px", marginTop: "-160px", backgroundColor:"#aaa" } .popupimages img{ position:relative; width:200px; /*image width */ height:200px; /*image height */ left:50%; top:50%; margin-left:-50px; /*image width/2 */ margin-top:-40px; /*image height/2 */ /*border: 1px solid #bbb;*/ border-bottom: 6px solid #ccc; border-radius:2px; } .popupimages { height: 100%; overflow-y: auto; border: 1px dashed; border-color: transparent; left:50%; top:50%; bottom: 20%; }
has comment: http://stackoverflow.com/comment/45510442
tagged with: javascript
has comment: http://stackoverflow.com/comment/45511036
type: Question
downvote count: 0
favorite count: 0
tagged with: css
tagged with: cordova
answer count: 0
type: UnansweredQuestion
score: 1
tagged with: hybrid-mobile-app

http://stackoverflow.com/comment/45679182
comment on: http://stackoverflow.com/q/28694053
score: 0
type: Comment
has text: @kiran Thanks for replay , Do i need to write the alert message in AJAX call itself?
type: QuestionComment

http://stackoverflow.com/comment/46015693
type: Comment
comment on: http://stackoverflow.com/q/28715351
score: 1
has text: Very well done, thanks for the link. Chart JS does work well on this
type: QuestionComment

http://stackoverflow.com/comment/45761681
type: Comment
type: QuestionComment
has text: @Arun P Johny i agree with you
score: 0
comment on: http://stackoverflow.com/q/28738881

http://stackoverflow.com/q/28706618
type: UnansweredQuestion
score: 2
has body: I'm a complete newbie, but I was doing the tutorial for connecting to the YouTube API and executing a search, which consists of making a search.js file and a search.html file. The html then calls the search.js file which has the functions. Everything works fine in Codecademy and I can see the normal results for my youtube query. But I wanted to play around more, so I cut and pasted both files into .js and .html files put them into the same directory and tried to run it locally, but then I just get a blank html page. The code is: Search.js function showResponse(response) { var responseString = JSON.stringify(response, '', 2); document.getElementById('response').innerHTML += responseString; } function onClientLoad() { gapi.client.load('youtube', 'v3', onYouTubeApiLoad); } function onYouTubeApiLoad() { gapi.client.setApiKey('AIzaSyCR5In4DZaTP6IEZQ0r1JceuvluJRzQNLE'); search(); } function search() { var request = gapi.client.youtube.search.list({ part: 'snippet', q: 'Ben Woods', }); request.execute(onSearchResponse); } function onSearchResponse(response) { showResponse(response); } Search.html When I open the html doc I just get a blank page, and if I Alt+Command+J, I see the following errors: Denying load of chrome-extension://gkojfkhlekighikafcpjkiklfbnlmeio/js/jquery.min.map. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension. core:rpc:shindig.random:shindig.sha1.js?c=2:838 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('file://') does not match the recipient window's origin ('null'). cb=gapi.loaded_0:47 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('file://') does not match the recipient window's origin ('null').
has title: Codecademy code connect to Youtube API on their website but won't run locally
has comment: http://stackoverflow.com/comment/46506407
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29141402
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28706675
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
upvote count: 2

http://stackoverflow.com/q/28660666
has body: I've created very simple example, read many similar issues with slideToggle() but haven't been able to figure out the fix for it. How would I get rid of the jump on click of first li a when using slideToggle()? See it also in jsFiddle HTML Click Second Third Fourth CSS ul { background:#ddd; } ul li { display:inline; background:lightyellow; } ul li:not(:first-child) { display:none; display:inline; } jQuery $('ul li:first-child').on('click', function () { $('ul li:not(:first-child)').slideToggle(); });
type: Question
score: 3
tagged with: javascript
upvote count: 3
answer count: 2
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28660786
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28660784
tagged with: css
has answer: http://stackoverflow.com/a/28660784
type: AnsweredQuestion
has title: slideToggle() causes first li a to jump on click
has answer: http://stackoverflow.com/a/28660786
downvote count: 0

http://stackoverflow.com/q/28634286
type: Question
tagged with: performance
has title: What are some highlevel techniques to improving paint or rendering times?
tagged with: javascript
has body: What are some techniques or methods that could potentially reduce jank and/or improve paint times on browsers?
upvote count: 1
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/28634414
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28634414
downvote count: 0
score: 1

http://stackoverflow.com/comment/45496003
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28594604
has text: [this tutorial](https://spring.io/guides/gs/rest-service-cors/#_filter_requests_for_cors) should help ya out

http://stackoverflow.com/comment/45599051
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28650447
has text: Sorry, its window.LikeCon Im using, miss type.

http://stackoverflow.com/comment/45582798
has text: what is your question?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28641958

http://stackoverflow.com/q/28695331
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28695458
has answer: http://stackoverflow.com/a/28695498
type: Question
tagged with: javascript
has title: Initiate the radio button name from javascript in inline
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/28695498
tagged with: jquery
has body: I want to assign the radio button value from javascript variable, in inline html. Because I have lot of radio button, and I have a situation to save the radio button name in localstorage, so should I need to give the radio button name unique.If I change every radio button name manually, it take more time. I have tried &lt;script&gt; var sample=="XXID"; &lt;/script&gt; &lt;input type="radio" name='"javascript:sample"+n1'/&gt; I have plan to using unique name on the every html page.
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28695458

http://stackoverflow.com/comment/45775146
has text: eval is evil. It is not good practice to use it. I cannot see from your example, why you would want to use it, why not simply put the values you need inside the object itself (maybe I am missing something because I have never been interested in Pokemon).
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28732898
type: Comment

http://stackoverflow.com/comment/45625617
has text: @Claies ok thanks - i'll clarify that in my future questions
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28664865

http://stackoverflow.com/comment/45505102
comment on: http://stackoverflow.com/a/28598998
type: AnswerComment
score: 0
type: Comment
has text: @Somashekhar i have added code for sending ajax request using javascript and on server side you need to create web service to handle this.

http://stackoverflow.com/a/28622642
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28621446
answers question: http://stackoverflow.com/q/28621446
has body: Because replacing element.innerHTML it's losing is binding. In order to overcome this. Two method are available: 1- Rebind the new element 2- Else var element = document.getElementById('infoDiv'); var parent = element.parentNode; var wrapper = document.createElement('div'); parent.replaceChild(wrapper, element); wrapper.appendChild(element); This is updated url: http://jsfiddle.net/p5o8842w/5/

http://stackoverflow.com/q/28683743
upvote count: 7
type: Question
has title: Adjust Node REPL to not clobber prompt on async callback?
has comment: http://stackoverflow.com/comment/45662549
has answer: http://stackoverflow.com/a/28684875
has answer: http://stackoverflow.com/a/66931940
downvote count: 0
tagged with: javascript
answer count: 3
has body: When working with the Node REPL console, I'm looking for a way for asynchronous calls to both not lock up the console input, and not clobber the console prompt when they return. I've seen a few solutions dealing with asynchronous calls in the REPL, where writing your own custom eval function you can check the result of the executed code to see if it's a promise/async object, and just not return until it resolves. However, I'd like to solve the issue of a repeating background process logging its progress. Ideally I'd like it to behave like the Chrome Javascript console, where if you have a command partially printed on the console prompt, and an async result gets logged, the line you're typing on gets moved one line down, and the log inserted above it. So, functionally, I'd like to insert the logic that when console.log() is called, the line containing the cursor is first cleared, then the contents of the log() written, and then the REPL prompt (and whatever the user had typed so far onto it) gets re-written on the line following the new output. Is there any way to hook into the REPL object to accomplish this? Is this some advanced manipulation of the output stream from the REPL (i.e. only possible on terminals that support an "erase to beginning of line" escape code)?
favorite count: 0
type: UnansweredQuestion
tagged with: read-eval-print-loop
tagged with: node.js
score: 7
has comment: http://stackoverflow.com/comment/45660330
has answer: http://stackoverflow.com/a/63121427

http://stackoverflow.com/a/38853805
downvote count: 0
answers question: http://stackoverflow.com/q/28593854
has body: Use drawCallback option to handle DT draw event and show/hide pagination control based on available pages: $('#table_id').dataTable({ drawCallback: function(settings) { var pagination = $(this).closest('.dataTables_wrapper').find('.dataTables_paginate'); pagination.toggle(this.api().page.info().pages &gt; 1); } })
type: Answer
upvote count: 62
score: 62

http://stackoverflow.com/comment/45722803
score: 1
type: Comment
has text: @micheal Have a look at this: http://jsfiddle.net/lharby/nzezu5zy/3/ ha, skobaljic beat me to it, same solution.
type: AnswerComment
comment on: http://stackoverflow.com/a/28717443

http://stackoverflow.com/a/40218634
type: Answer
has body: In case you are still interested in the answer, try this before doing the request var data = { firstName: 'stack', lastName: 'overflow' }; var jsonData = JSON.stringify(data); and change your AJAX request to $.ajax({ type: "POST", url: "fHandler.ashx", data: jsonData, dataType: 'json', contentType: 'application/json; charset-utf-8' }) .done(function (response) { // do something nice }) .fail(function (jqXHR, textStatus, errorThrown) { console.log("request error"); console.log(textStatus); console.log(errorThrown); }); Explanation You are trying to send the plain data object. You must transform it into a Json string using JSON.stringify(object). Changing the dataType isn't really a solution but a workaround. Additional Notes Also, I think you should use .done() and .fail(). See here for further details.
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28747744
downvote count: 0

http://stackoverflow.com/comment/45729561
has text: Ok, I'm still lost. I've updated my question with what I have now.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28721151

http://stackoverflow.com/q/28694314
tagged with: qml
has comment: http://stackoverflow.com/comment/61102820
linked to: http://stackoverflow.com/q/25850881
tagged with: javascript
has answer: http://stackoverflow.com/a/42364400
score: 3
has comment: http://stackoverflow.com/comment/45681137
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45679973
favorite count: 0
has comment: http://stackoverflow.com/comment/45679856
has title: How to include qml file from js file
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/67222117
has comment: http://stackoverflow.com/comment/61108478
has comment: http://stackoverflow.com/comment/80147813
has comment: http://stackoverflow.com/comment/61108559
has body: I collect some examples of import statement in QML. But one is lacking — import a qml file from js file. Documentation says that it is a way to do it .import Qt.test 1.0 as JsQtTest but I can't make it work. I appreciate suggestions on my example collection and the answer to the question — how to import qml file from js file?
upvote count: 3
has comment: http://stackoverflow.com/comment/45680070
has comment: http://stackoverflow.com/comment/45679796
has comment: http://stackoverflow.com/comment/71878240
type: Question

http://stackoverflow.com/a/28695099
has comment: http://stackoverflow.com/comment/45681101
score: 0
has body: ng-repeat create a new scope foreach iteration. In your example container will be available to the elements inside ng-repeat. It will not be available in controller.
answers question: http://stackoverflow.com/q/28694598
type: Answer

http://stackoverflow.com/q/28730631
tagged with: javascript
tagged with: jquery
score: 0
has body: Thanks to anyone willing to help! I new around here and hope I'm following the right format. I have several horizontal bar charts made with flot charts in jquery. Most render the data perfectly fine. One does not. In this chart, the axis labels and data series labels show up, as do the tick labels and my vertical scroll bar. However, no actual axes or data get rendered in the chart. One main difference is that this chart has more data than the others - about 500 rows as opposed to about 50. The chart area of all charts are adjusted to the number of rows using jquery .css so that the height of the charts are all different. I am wondering if there is simply a limit to how much data flot charts can take for the horizontal bar chart format. I found some stack overflow questions about flot chart line charts, which said you could have max one point per pixel on the x axis in this format - so I'm wondering if there is something similar going on for height with horizontal bar charts. Or, does anyone see anything else in my code that could be causing the data and axes not to render? The data is called via an API from mySQL into a jSON object, which I format in javascript for use in flot charts in the form of data, index. The chart should load on page ready into the div class "pd_level". There is also a filter function with a drop down menu, which when something from the drop-down is selected, new charts show in both div classes "pd_level" and "conversions". This filter is on a number of my other charts and is working fine on those. The html: Filter by Product... Product Performance The javascript: var load = function () { $.getJSON('api/db/product_conversions_pd_level', function (data) { var i = 0; var dta0 = [], dta1 = [], ticks = []; var dtlist = [dta0, dta1]; var calcs = ['view', 'choose']; //this runs through each row and grabs the relevant values and adds them to an array of arrays for the chart data $.each(data, function (key, val) { for (n = 0; n < calcs.length; n…
has comment: http://stackoverflow.com/comment/45844589
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45817259
has answer: http://stackoverflow.com/a/35863880
has title: Max length for flot chart data or other reasons horizontal bars might not show up even though axes are rendered
type: Question
tagged with: charts
tagged with: flot
answer count: 1

http://stackoverflow.com/comment/45690394
score: 0
comment on: http://stackoverflow.com/q/28699971
has text: @MrPablo The documentation mentions it in the very header, but does a bad job stressing it. The arcane error message does not help.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45745933
has text: @tymeJV Please elaberate.
type: QuestionComment
comment on: http://stackoverflow.com/q/28729797
score: 0
type: Comment

http://stackoverflow.com/comment/45666527
comment on: http://stackoverflow.com/q/28670498
score: 0
type: Comment
has text: @zerkms Thanks. Your answer is good, why don't you answer the question but only put the comments?
type: QuestionComment

http://stackoverflow.com/a/28628804
upvote count: 4
downvote count: 0
has body: This is actually simpler than the comment suggests since promises chain. If you want to chain though - you need to do it with then: $q.all([ ResourceA.get({}).$promise.then(function(data){ // chain a then if (data.key !== "secret") return $q.reject("Invalid key"); return data; // return same value if ok }), ResourceB.get({}, function success(data) { console.log('got B'); }).$promise ]).then(function() { console.log("done"); });
accepted answer of: http://stackoverflow.com/q/28626959
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28626959
score: 4
type: Answer

http://stackoverflow.com/q/28727882
type: Question
has body: I'm trying to select an option from a variable. These don't work: select | name=UserID | label=${varUserID} select | name=UserID | label=javascript{storedVars['varUserID']} I keep getting: Option with label '${varUserID}' not found Option with label 'javascript{storedVars['varUserID']}' not found What am I missing? Sure here is the html: User Name LastName, FirstName
has answer: http://stackoverflow.com/a/28819504
score: 0
answer count: 2
tagged with: javascript
tagged with: selenium-ide
accepted answer: http://stackoverflow.com/a/28819504
has comment: http://stackoverflow.com/comment/45742044
has title: Selenium IDE: How to select from a variable?
possible better answer: http://stackoverflow.com/a/28806113
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28806113
tagged with: selenium

http://stackoverflow.com/q/28714034
has comment: http://stackoverflow.com/comment/45717233
tagged with: asp.net-mvc
tagged with: javascript
tagged with: jquery-validate
has comment: http://stackoverflow.com/comment/45716961
score: 0
has body: I have a simple form and I validate it, but then I check to see if it's valid and it is always invalid. How can I check to see what is invalid about my form? If I swap out the razor code with html for the text box it seems to work. I posted the rendered razor code below. Here is my form - @using (Html.BeginForm("Search", "Home", FormMethod.Post, new { id = "MyForm", name = "MyForm" })) { @Html.TextBoxFor(model => model.SearchQuery, new { @class = "form-control", name = "FullAddress", id = "FullAddress" }) @Html.ValidationMessageFor(model => model.SearchQuery, "", new { @class = "text-danger" }) Search } And here is my script. It displays a alert box every time I hit the submit button and this line is checked if (!$('#MyForm').valid()) { alert('Invalid Form!'); $(document).ready(function () { if ($('#MyForm').exists()) { // Enable jQuery Validation for the form //$("#MyForm").validate({ onkeyup: false, onfocusout: false }); $("#MyForm").validate(); var errors = validator.errors(); //get the error elements, the actual labels var errors1 = validator.invalidElements(); // Add validation rules to the FullAddress field $("#FullAddress").rules("add", { fulladdress: true, required: true, messages: { fulladdress: "Google cannot locate this address." } }); // This function will be executed when the form is submitted function FormSubmit() { $.submitForm = true; if (!$('#MyForm').valid()) { alert('Invalid Form!'); return false; } else { if ($("#FullAddress").data("IsChecking") == true) { $("#FullAddress").data("SubmitForm", true); return false; } alert('Form Valid! Submit!'); // return true; // Uncomment to submit the form. return false; // Supress the form submission for test purpose. } } // Attach the FormSubmit function to the Submit button if ($('#Submit').exists()) { $("#Submit").click(FormSubmit); } // Execute the ForumSubmit function when the form is submitted $('#MyForm').submit(FormSubmit); } }); // Create a jQuery exists method jQuery.fn.exists = function () { return …
answer count: 1
has comment: http://stackoverflow.com/comment/45716516
tagged with: jquery
has comment: http://stackoverflow.com/comment/45738031
has title: What is invalid about my form with jquery .valid() failing?
has comment: http://stackoverflow.com/comment/45732613
has answer: http://stackoverflow.com/a/28714848
has comment: http://stackoverflow.com/comment/45716806
has comment: http://stackoverflow.com/comment/45732459
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45715857

http://stackoverflow.com/a/28653141
type: Answer
has body: The problem is this code: var cur_lv = cur_lv - 1; It creates a local variable that shadows the global variable. The right side of the assignment also uses the local variable, so the value of the expression is undefined - 1. The undefined will be converted to a numeric value to be possible to be used in the subtraction, and that numeric value is NaN. The result of NaN - 1 is NaN. The code should be: cur_lv = cur_lv - 1;
has comment: http://stackoverflow.com/comment/45603386
answers question: http://stackoverflow.com/q/28653103
score: 0

http://stackoverflow.com/comment/45616364
type: Comment
comment on: http://stackoverflow.com/a/28660146
type: AnswerComment
has text: Yes that's the question, how do you trigger your popup? btn (click), link (click), event (load, resize), ... In any case, combine the event handler with the `delayedGrid` and that should do the trick.
score: 0

http://stackoverflow.com/q/28736870
tagged with: firefox
tagged with: javascript
linked to: http://stackoverflow.com/q/26254473
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28739146
has body: we have application that from one window you open new window (tab) in the browser. this is working fine ,the problem is that if you open debugger in the second tab the first tab (which initistate the proceess) is stuck I guess its becouse they share the same JS VM ,my question is if there is a way to overcome this issue?maybe web worker or something else... Any idea why does it happen and some hint to search for solution will be very helpful.
type: Question
tagged with: http://stackoverflow.com/tag/html
score: 0
tagged with: google-chrome
answer count: 1
tagged with: virtual-machine
has title: Two tabs the first is stuck when you in debug mode in the second tab

http://stackoverflow.com/comment/45709499
type: QuestionComment
type: Comment
has text: @jfriend00 I'm not asking how to comma a number, yet how do I comma the output number in the provided script as I have posted a working example on how to comma a number.
comment on: http://stackoverflow.com/q/28710243
score: 0

http://stackoverflow.com/a/28636751
has comment: http://stackoverflow.com/comment/45573350
has body: add the following css #imageStack { position: relative; } img { position: absolute; } img:nth-child(1) { top: 0; left: 0; } img:nth-child(2) { top: 6px; left: 8px; } .... etc they will display relative to the imageStack element
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45573437
type: Answer
answers question: http://stackoverflow.com/q/28636593
accepted answer of: http://stackoverflow.com/q/28636593
score: 0

http://stackoverflow.com/a/28679995
upvote count: 1
has body: You can use "for .. in ..." loop to iterate input object with params. Example: Room = function(options) { for (var key in options) { this[key] = options[key]; } } var bedroom = new Room({ name: 'Bedroom', north: true });
downvote count: 0
has comment: http://stackoverflow.com/comment/47663018
answers question: http://stackoverflow.com/q/28679781
type: Answer
score: 1

http://stackoverflow.com/comment/45722437
has text: Which method are you using to perform these transitions ? It should exist a "end-of-function" callback you could use to know when the process is complete.
comment on: http://stackoverflow.com/q/28717609
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45679858
type: QuestionComment
has text: I don't know that's why I asked.
comment on: http://stackoverflow.com/q/28684406
score: 4
type: Comment

http://stackoverflow.com/q/28671459
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28672668
has title: Conditional include js/css files for IE with meteor
tagged with: javascript
tagged with: jquery
has body: In pure html it is common to use conditional includes like: <!--[if lt IE 9]> <![endif]--> My ltie9.js is pretty simple $(document).ready(function(){ $("#ltie9").modal('show'); }); The ltie9.js is wrapped by meteor into: Wrapped as it looks now: (function(){$(document).ready(function(){ $("#ltie9").modal('show'); }); })(); Seems that conditional comment doesn't work as the modal occurs even if I use Chrome. How to fix that conditional statement - should I check the browser vendor and version via js? Sounds like a very heavy solution.
answer count: 1
downvote count: 0
tagged with: bootstrap-modal
tagged with: meteor
accepted answer: http://stackoverflow.com/a/28672668
favorite count: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45636982
tagged with: twitter-bootstrap-3
score: 1

http://stackoverflow.com/q/28594555
possible better answer: http://stackoverflow.com/a/29051367
has answer: http://stackoverflow.com/a/29051367
has title: AngularJS Material - Dialog Close Using Phone "back" Button
has comment: http://stackoverflow.com/comment/50863049
upvote count: 3
has answer: http://stackoverflow.com/a/30781296
tagged with: angular-material
accepted answer: http://stackoverflow.com/a/34844681
type: Question
type: AnsweredQuestion
answer count: 3
tagged with: modal-dialog
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/34844681
has body: Overflow! I am building an Angular Material site for the first time and I seem to be having an issue with the Dialog box feature. I can get the box to display and close fine except on a mobile device. Namely, when the user presses the "Clear" or "Back Button" on the phone. When you do this (or click the back button on the browser) it has no affect on the dialog box. It remains in view and waiting for input. Pressing the ESC key closes it. Anybody on a phone would instinctively think they can clear out of it and in my opinion they should be. I have tried all sorts of various methods that either do not work I am just not implementing them properly. So, here goes.. Controller: 'use strict'; app.controller('NavCtrl', function ($scope, $mdDialog) { $scope.itworked = "Angular Successful"; var dialogContent = ' \ \ Content \ This link works \ This link also works \ filler \ \ '; var noForm = ' ' + dialogContent + ' '; var formAround = ' ' + dialogContent + ' '; var formInside = ' ' + dialogContent + ' '; function makeDialog(tmpl) { return function(ev) { $mdDialog.show({ template: tmpl, targetEvent: ev, controller: 'DialogController' }); }; } $scope.dialogNoForm = makeDialog(noForm); $scope.dialogFormAround = makeDialog(formAround); \\ This is for future use $scope.dialogFormInside = makeDialog(formInside); \\ so is this... }); app.controller('DialogController', function($scope, $mdDialog) { $scope.hide = function() { $mdDialog.hide($scope.participant); }; $scope.cancel = function() { $mdDialog.cancel(); }; }); Anything anybody can suggest I am willing to try. I have tried the following: setCancellable(true) Also tried using a "navigation" trick to close the dialog box if the back button was pressed but it just doesnt work. You can see an example that has the SAME functionality on the official docs site. If you check the Dialogs you can see their functionality is the exact same. https://material.angularjs.org/#/demo/material.components.dialog They are kind of written a litt…
tagged with: angularjs
score: 3
has comment: http://stackoverflow.com/comment/46551055
tagged with: android

http://stackoverflow.com/comment/45747560
has text: @Qantas94Heavy Fair enough, I will change the third parameter to true.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28730276

packery
tags question: http://stackoverflow.com/q/28644072
type: Tag
tag name: packery

http://stackoverflow.com/q/28707156
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/15316363
has body: I'm using angularjs in a site and there I have a search input that filters a list on a view. This list is displayed with a ng-repeat that has a filter from the search input: The search input: &lt;input type="text" placeholder="Device Search" class="form-control hasclear" ng-model="searchText"/&gt; And here the ng-repeat: &lt;tr ng-click="openModal(device['device_id'], device)" ng-repeat="device in devices | filter:searchText | orderBy:predicate:reverse"&gt; As you see the filter in the ng-repeat has the filter that uses the searchText variable from the ng-model. I would like to know if it's possible to know how many objects were found when the user enters a text in the search input (How many devices the ng-repeat is displaying being filtered). Like: 0 devices were found, 3 devices were found... Is there a way to display this information by the way I built this search?
has answer: http://stackoverflow.com/a/28707346
has comment: http://stackoverflow.com/comment/45704406
has answer: http://stackoverflow.com/a/28707341
tagged with: angularjs-ng-model
possible better answer: http://stackoverflow.com/a/28707307
has title: Number of objects in a ng-repeat that is filtered
duplicate of: http://stackoverflow.com/q/15316363
has answer: http://stackoverflow.com/a/28707307
has answer: http://stackoverflow.com/a/28707301
accepted answer: http://stackoverflow.com/a/28707341
tagged with: angularjs-ng-repeat
favorite count: 0
tagged with: angularjs
answer count: 4
type: AnsweredQuestion
upvote count: 2
score: 1
has comment: http://stackoverflow.com/comment/45704179
downvote count: 1

http://stackoverflow.com/q/28723282
has title: Why can't I add parameters to the window.location?
tagged with: google-chrome
type: Question
has body: Using Javascript, I'm trying to reload my page and add a parameter before doing so. I've added the alerts to debug why the parameter is not getting passed to the server: alert('before: ' + window.location.href); window.location.href = window.location.href + "?advanced_expand=true"; alert('after: ' + window.location.href); window.location.reload(); What has me perplexed is that the first alert is: before: http://localhost:3000/orgconf/quick_org_benefit/edit/784 and the second is: after: http://localhost:3000/orgconf/quick_org_benefit/edit/784 without the parameter added...what gives?
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28723390
linked to: http://stackoverflow.com/q/486896
answer count: 1
has comment: http://stackoverflow.com/comment/45733371
has answer: http://stackoverflow.com/a/28723390
type: AnsweredQuestion

http://stackoverflow.com/q/28734792
has answer: http://stackoverflow.com/a/31218600
has comment: http://stackoverflow.com/comment/50437680
upvote count: 17
tagged with: generator
type: AnsweredQuestion
score: 15
type: Question
tagged with: ecmascript-6
has answer: http://stackoverflow.com/a/53510794
accepted answer: http://stackoverflow.com/a/31218600
has title: Can I pass a parameter to ES6 generator function
tagged with: javascript
has body: Here's a ES6 generator: function *Gen() { var input1 = yield 'output1' } var gen = Gen() gen.next('input1').value // return 'output1' gen called 1st time, return output1 but the variable input1 doesn't equal 'input1' which passed in , the value of input actually is the 'input2', 2nd time next('input2')called My question is how to access the input1 which is the first time next called, something like: function *Gen() { var input 1 = param1 var input2 = yield 'output1' }
has answer: http://stackoverflow.com/a/28754234
possible better answer: http://stackoverflow.com/a/28734955
has answer: http://stackoverflow.com/a/64956825
has answer: http://stackoverflow.com/a/28734955
favorite count: 0
answer count: 5
downvote count: 2

http://stackoverflow.com/comment/45750557
type: AnswerComment
has text: I don't know what @marjes is going on about. Your `action.php` is fine. As long as your model values use the same keys as the ones you use in `$_POST['firstName']` etc they will be detected without a problem. You also don't need to set `headers: { 'Content-Type': 'application/x-www-form-urlencoded' }` because your PHP application will work with the default header.
type: Comment
comment on: http://stackoverflow.com/a/28731896
score: 0

http://stackoverflow.com/a/28720052
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: You need to encapsulate the value with parenthesis, this will create a group and you will be able the get that group in the replacement string with $n where n is the number of the group. The index start to 1. So use that : appendString.replace(new RegExp('(' + $("#SearchInput").val() + ')', "gi"), "$1"); Note that using regexp like that is dangerous, for instance, if I write (hello in the input, it will throw an error : invalid regexp.
accepted answer of: http://stackoverflow.com/q/28706278
answers question: http://stackoverflow.com/q/28706278

http://stackoverflow.com/q/28658423
tagged with: jquery
tagged with: asp.net
has body: I want to disable first saturday of every month + I want to disable all sundays I have tried below code which will only disable every sundays.How can I disable first saturday of every month ?? Below is the code I have tried : $(function () { $("#txtDate").datepicker({ beforeShowDay: noSunday }); function noSunday(date) { var day = date.getDay(); return [(day &gt; 0), '']; }; });
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28661787
has title: Jquery UI calendar control disable specific dates
type: Question
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery-ui-datepicker
duplicate of: http://stackoverflow.com/q/15400775
score: 0
accepted answer: http://stackoverflow.com/a/28661787
linked to: http://stackoverflow.com/q/15400775
answer count: 1

http://stackoverflow.com/comment/45743888
score: 0
type: Comment
type: QuestionComment
has text: Updated and still not displaying out for me :(
comment on: http://stackoverflow.com/q/28728798

http://stackoverflow.com/a/28627236
has body: Try this: $(".sch").find('#hlp').closest('td').remove(); or as ids are unique so you can directly do this: $('#hlp').closest('td').remove(); $('.sch').find('#hlp').closest('td').remove(); Address Book Options remove Log Off
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28627161
type: Answer
answers question: http://stackoverflow.com/q/28627161

http://stackoverflow.com/q/28749373
answer count: 1
type: UnansweredQuestion
has title: Script for browser detection and url linking
has body: I'm new... I'm looking for a script that detects the browser and then a function that links to a specific url based on the browser being used. I'm stuck on how to combine two functions into one js file. Using the onclick method to call one of the two functions. Does this make sense? What are my options. I know userAgent is frowned upon, what are the work arounds?
has comment: http://stackoverflow.com/comment/45780693
has answer: http://stackoverflow.com/a/28749550
type: Question
tagged with: javascript
score: 0

http://stackoverflow.com/comment/45746652
has text: Off the top of my head its hard to say. `123 Buckingham Palace Road, London, United Kingdom`? They would all be UK based addresses. The issue with the approach you're suggesting is that Google's lookup services (which is what I am using to narrow down the addresses) spits out all kinds of addresses in different format. Hence, I thought it would be a better idea to limit the address list by making a call to the API instead of validating the input box entry.
type: Comment
comment on: http://stackoverflow.com/a/28725222
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45543710
has text: I posted an answer I'm pretty sure will help, but it would be good to know what element has ng-click on it
score: 0
comment on: http://stackoverflow.com/q/28620092
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28628927
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28628627
has body: The problem is that nodefn.lift doesn't know how many parameters the function has (zero), so it just takes the appearing arguments and appends its callback to them. In a then chain every callback receives the result of the previous promise (in your case: undefined), so your twofn will be called with two arguments: undefined and the nodeback. So if you fix their arities, it should work: Function.prototype.ofArity = function(n) { var fn = this, slice = Array.prototype.slice; return function() { return fn.apply(null, slice.call(arguments, 0, n)); }; }; var one = nodefn.lift(oneFn).ofArity(0), two = nodefn.lift(twoFn).ofArity(0), three = nodefn.lift(threeFn).ofArity(0);
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/45561972
score: 2
has comment: http://stackoverflow.com/comment/45558137
has comment: http://stackoverflow.com/comment/45559709
has comment: http://stackoverflow.com/comment/45558534
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28628627
has comment: http://stackoverflow.com/comment/45558064

http://stackoverflow.com/a/28617061
answers question: http://stackoverflow.com/q/28616955
has comment: http://stackoverflow.com/comment/45537489
upvote count: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45538570
score: 1
has body: $(document).ready(function() { $('.box').click(function() { $(this).animatecss('blur-out', 5000, function() { console.log('callback'); }); }); // add this line $('.box').trigger('click'); }); Reference: http://api.jquery.com/trigger/
has comment: http://stackoverflow.com/comment/45538935
accepted answer of: http://stackoverflow.com/q/28616955

http://stackoverflow.com/q/28690481
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28690541
tagged with: function
has title: cannot set/read property of undefined
has comment: http://stackoverflow.com/comment/45672693
type: Question
has answer: http://stackoverflow.com/a/28690541
linked to: http://stackoverflow.com/q/336859
has comment: http://stackoverflow.com/comment/45672813
has comment: http://stackoverflow.com/comment/45672618
score: 0
possible better answer: http://stackoverflow.com/a/28690545
answer count: 2
has answer: http://stackoverflow.com/a/28690545
has comment: http://stackoverflow.com/comment/45672749
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/45672524
has body: This is basically two errors but they go hand in hand since the second error goes back to the first one Uncaught TypeError: Cannot set property 'Players' of undefined Uncaught TypeError: Cannot read property 'CreatePlayer' of undefined var TotalPlayers = 0; Player.Players = []; Player.CreatePlayer = function (name, Class, rank) { TotalPlayers ++; Player.Players[TotalPlayers] = { name: name, Class: Class, rank: rank }; Player[name] = new Player(name, Class, rank); }; There is more to the code than this but this should be the only parts needed

http://stackoverflow.com/a/28641548
has comment: http://stackoverflow.com/comment/45600053
has comment: http://stackoverflow.com/comment/45599810
upvote count: 2
has comment: http://stackoverflow.com/comment/45599618
accepted answer of: http://stackoverflow.com/q/28641434
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28641434
type: Answer
score: 2
has body: You can on the OnCreateUser, do something like this. Accounts.onCreateUser(function(options, user) { //if there is not users on the database //we assign the First-User role if(Meteor.users.find().count() === 0){ user.role = "First-User" }else{ user.role = "normalUser" } return user; }); Assuming you have the First-user role. like this. Meteor.publish("First-User", function () { var user = Meteor.users.findOne({_id:this.userId}); if (Roles.userIsInRole(user, ["First-User"])) { return Meteor.users.find({}, {fields: {emails: 1, profile: 1, roles: 1}}); } this.stop(); return; }); Remember you should call the onCreateUser at the top of the createUsers methods. Note that the Roles.addUsersToRoles call needs to come after Accounts.createUser or Accounts.onCreate or else the roles package won't be able to find the user record (since it hasn't been created yet) From README. Hope this Works.
downvote count: 0

http://stackoverflow.com/a/28626949
score: 1
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/45554542
downvote count: 0
answers question: http://stackoverflow.com/q/28626897
has body: You have wrong selector for targeting p elements. it should be $(".guess-box p") . : $(".guess-box").click(function() { $(".guess-box p").remove(); var discount = Math.floor((Math.random()*5) + 5); var discount_msg = " Your Discount is "+ discount +"% "; $(this).append(discount_msg); }); also you should only remove p elements from currently clicked and keep retain for others: $(".guess-box").click(function() { $(this).find("p").remove(); ....... Working Demo

http://stackoverflow.com/q/28734674
tagged with: javascript
tagged with: console
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45779411
favorite count: 0
has comment: http://stackoverflow.com/comment/45755420
tagged with: input
tagged with: node.js
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/28750467
upvote count: 3
has comment: http://stackoverflow.com/comment/45773224
has comment: http://stackoverflow.com/comment/45754657
has title: How to get JavaScript console user input working (node.js)?
accepted answer: http://stackoverflow.com/a/28750467
type: Question
has body: This is some homework I have. I want it to read user input and then create two objects, giving them values based on the user input. Here is my code, beginning at the top of the JS file: console.log("Type 'help' for commands"); console.log("Square numbers:"); console.log("Enter player 1 name"); var player1 = new Player(readLine()); var player2 = new Player(readLine()); console.log("logging name after making players" + player1.name); function readLine() { var inputText; var readline = require('readline'); var rl = readline.createInterface({ input: process.stdin, output: process.stdout }); rl.question("Enter player name? ", function(answer) { inputText = answer; console.log("Player name:", answer); rl.pause(); }); return inputText; } Here is the output I get: http://oi60.tinypic.com/9tn7nn.jpg I'm used to C# and Java and in those languages, readline() would wait for the input and then create the object with whatever I inputted, before moving onto the next line. Not in JS though! It just carries on, calling readline() twice before I've typed anything in (therefore printing "prompt>" twice) and then logging player 1's name (before typing it in, hence undefined). Then it waits for me to type something in and once I type something, it sets both players to the one name and then ends the program. Is it possible to do what I am trying to get it to do? Is there another way I can get input to work without it skipping past it and running the rest of the code? Thanks in advance!

http://stackoverflow.com/comment/45618354
has text: Oh something you've missed out from my question though was that it checks if an object with a matching ID already existing. This code produces duplicates.
type: Comment
comment on: http://stackoverflow.com/a/28661311
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45783969
type: AnswerComment
has text: Nice, when i use everything better than expected!! :D
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28750898

http://stackoverflow.com/q/28735139
has answer: http://stackoverflow.com/a/28735177
accepted answer: http://stackoverflow.com/a/28735177
tagged with: checkbox
linked to: http://stackoverflow.com/q/426258
linked to: http://stackoverflow.com/q/901712
has comment: http://stackoverflow.com/comment/45755191
type: AnsweredQuestion
has body: I want to check a checkbox is checked or not using jquery. When click on the check box, check the checkbox is checked or not using jquery. My code is given below. &lt;script&gt; function check(id) { if($("#id:checked").length == 1) { alert("cheked"); } } &lt;/script&gt; Html $i=1; &lt;input name="" type="checkbox" value="" id="one&lt;?php echo $i; ?&gt;" onclick="check(one&lt;?php echo $i; ?&gt;)"/&gt;
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Check a check box is checked or not using jquery
has comment: http://stackoverflow.com/comment/45755682
score: 0

http://stackoverflow.com/a/28773076
has comment: http://stackoverflow.com/comment/45839594
answers question: http://stackoverflow.com/q/28678548
has body: Looking at your code, I've updated the line you said for the below one: if (target.position().top - $('#header').outerHeight() <= windowPos) { $('#primary-navwrapper li a').removeClass("current"); anchorId.addClass("current"); } In this way, it'll get the target's difference to the top minus the header's height (as it will be always visible) and then check with the window's position. If it's inferior, the user has passed this anchor, so the correspondent link in the menu gets highlighted. And your first link doesn't have its anchor in the fiddle, so: Home After these changes, everything seems to work fine. JSFiddle: http://jsfiddle.net/8n06pvy9/17/ EDIT: To update the hash, I've tried to use a simple window.location.hash = anchorId;, but it results in some weird scroll issues in FF and IE. I've spent some time on it, but I wasn't able to figure out what happens. So, I suggest a trick that I've already used, using #! in the hash. In this way, your code would be like that: window.location.hash = '#!' + anchorId.replace('#', ''); And in the scroll function, like that: window.location.hash = '#!' + anchorId.attr('href').replace('#', ''); JSFiddle: http://jsfiddle.net/8n06pvy9/18/ And, if you want, you can check for the hash in pageload, remove the exclamation point and scroll the page to the desired anchor. Or, if you want to avoid all of that, you can always use some history plugins, like this one. In your case, I personally wouldn't use a plugin for that, but it's your call if it worth it or not. Hope it helps!
has comment: http://stackoverflow.com/comment/45864811
type: Answer
upvote count: 6
score: 6
has comment: http://stackoverflow.com/comment/45892791
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28678548

http://stackoverflow.com/comment/81277465
type: AnswerComment
comment on: http://stackoverflow.com/a/43147967
type: Comment
score: 1
has text: This should be the correct answer. Server and process uptime.

http://stackoverflow.com/a/28596263
answers question: http://stackoverflow.com/q/28594445
has comment: http://stackoverflow.com/comment/53871979
score: 4
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/53879784
type: Answer
has body: As of today, there is no foolproof ironclad way of doing it. The modernizr folks, pretty much the experts in feature detection, recently had this to say about it: https://github.com/Modernizr/Modernizr/issues/869#issuecomment-57891034 The end result of all of this is that you cannot detect a mouse use in a way that would conform to the level of reliability that Modernizr is credited with. For our intents and purposes, it is a undetectable. If you, future traveler, wish to attempt to detect a mouse user, then the following is the best guide I can offer. Don't. Seriously. Just because a user has a "mouse" doesn't mean that they don't have multiple other forms of input. You should try really hard to avoid making any kind of UI/UX decision that changes based upon the idea of a mouse user being diametrically opposed to a touchscreen user (or any other kind, for that matter). Make things universal. If you have to, and only care about IE 10 and 11, then IE's PointerEvent would be worth checking out. Support is abysmal, outside of those two (and presumably future IE versions). You can attach a listener for a 'hover' event on the body, and if it is true, then the user probably has a mouse. The drawback with this approach include touch events briefly firing hover events on tap/touch, so you could get false positives. sniff for mobile user agents. This is a bad idea, and goes against the very core of Modernizr. Please don't do it. So to me #1 pretty much sums it up. However, that answers your question but doesn't give you a solution. You mention "one of our PC's in the office..." Is this by chance an internal only application? I've occasionally run across situations where internal special use or one off pages may require some individual treatment for whatever reason (like one of our employees having a touch based AIO with a mouse attached). What I'll do then is append a ?hasmouse onto the end of the url and give the user that link to bookmark. Then inside javascript after your…
has comment: http://stackoverflow.com/comment/53878556

http://stackoverflow.com/a/28715504
score: 1
has body: You can use jQuery. for example: var x = $(".div-class").width() or .height now you have div height or width in pixels. make some calculations to get border height. for exaple we need 10% of height. var borderHeight = x *0.1; now just give it for div $("div-name").css("border-size",borderHeight + "px");
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28715182
downvote count: 0

http://stackoverflow.com/comment/45534306
score: 0
type: Comment
type: QuestionComment
has text: Using `on/off`seems a bit over-kill. Doesn't using an `active` class on the element suit you instead? If it's set, `return;`, otherwise add it and proceed with ajax request. On complete, remove the class.
comment on: http://stackoverflow.com/q/28615322

http://stackoverflow.com/a/28726602
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28718223
has body: Unfortunately, the included sorting that comes with HOT does not allow that sort of behavior, simply because it sorts the data array and the freezing of rows is just for aesthetics. The solution is implementing your own sorting on your data. I had the same task and solved it by adding an onclick event to the column headers and have that function do a selective sorting. In your case, that function could ask for the property from your HOT instance that gives you the consecutive rows which are frozen, then sort your data manually by ignoring the first x frozen rows. One way to implement this is by splicing the sub-array with the non-frozen rows from the large array, sorting, then combining the two arrays. Hope this helps!

http://stackoverflow.com/comment/45496295
has text: Since you don't tell us what line throws that error and you have numerous syntactical and typographical errors (each which would give its own error), this question should be closed for the above stated reason. To have it re-opened, please take a moment and fix your typographical errors and make sure to invoke the method correctly; and then report any errors to us once you do that.
type: Comment
comment on: http://stackoverflow.com/q/28594468
type: QuestionComment
score: 0

http://stackoverflow.com/a/28632129
score: 0
type: AcceptedAnswer
has body: Yes, using jQuery you can access them using $(this)[0].innerText and $(this)[0].outerText Are you sure its a good idea to have an ID that starts with an integer and not a letter?
type: Answer
answers question: http://stackoverflow.com/q/28632053
accepted answer of: http://stackoverflow.com/q/28632053

http://stackoverflow.com/comment/45598555
type: QuestionComment
has text: What function fires for an invalid ajax request?
comment on: http://stackoverflow.com/q/28650417
score: 0
type: Comment

http://stackoverflow.com/comment/45694832
type: QuestionComment
has text: What OS are you on? Did you `npm install -g strongloop`?
comment on: http://stackoverflow.com/q/28693852
score: 0
type: Comment

http://stackoverflow.com/comment/61502721
score: 0
type: AnswerComment
has text: I just spent a good many hours looking for `fd.append('user[avatar]', files[0]);` . You are a saint!
type: Comment
comment on: http://stackoverflow.com/a/28835904

http://stackoverflow.com/comment/45611366
type: QuestionComment
comment on: http://stackoverflow.com/q/28657424
type: Comment
has text: I want to invoke only once, once I know its not empty. ( there isn't a possibility to pull object (delete object) only insert)
score: 0

http://stackoverflow.com/comment/45711867
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28711381
has text: You need to also describe what output you get, and why it doesn't match with what you expect. For one thing, it will never say exactly what you ask because the string "left" is not even in the function. Please be precise.
score: 0

http://stackoverflow.com/comment/46139571
type: Comment
has text: Thanks Zyrex ,it helped me out.
type: AnswerComment
comment on: http://stackoverflow.com/a/28715817
score: 0

http://stackoverflow.com/comment/45614403
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28659291
has text: oh ok try using var_dump()
score: 0

http://stackoverflow.com/comment/45615104
comment on: http://stackoverflow.com/a/28659631
type: AnswerComment
score: 0
type: Comment
has text: well that's exactly what I'm doing? Also I'm not using jquery

http://stackoverflow.com/comment/45782480
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28750248
has text: This might help untangle the order of things? http://stackoverflow.com/questions/22083248/which-is-the-load-rendering-and-execution-order-of-elements-in-a-html-page/22159928#22159928
score: 0

http://stackoverflow.com/comment/45581924
type: QuestionComment
has text: _“Why am I setting the variables = to in the var definition, but then when checking them I'm using the === value?”_ – because the first one is an assigment, and the second one a comparison …?
score: 2
comment on: http://stackoverflow.com/q/28641481
type: Comment

http://stackoverflow.com/comment/45637121
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28671636
score: 0
has text: Try to put a word boundary in front of your groups `\b`

http://stackoverflow.com/comment/45581904
has text: Read http://stackoverflow.com/questions/523643/difference-between-and-in-javascript
comment on: http://stackoverflow.com/q/28641481
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45502459
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28598022
has text: Thanks for your comments. Feel free to edit my answer to make it better or suggest edits. I tried to clarify it so that pros/cons could be seen.
type: AnswerComment

http://stackoverflow.com/q/28630449
tagged with: forms
has answer: http://stackoverflow.com/a/28630484
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28630493
has comment: http://stackoverflow.com/comment/45561155
tagged with: javascript
tagged with: asp.net
score: 0
has title: What happens when I add multiple inline JavaScript functions to an onclick handler?
tagged with: submit
has comment: http://stackoverflow.com/comment/45561097
accepted answer: http://stackoverflow.com/a/28630493
has body: I simply want to know what happens in this case: &lt;input type="submit" name="a" id="b" value="Login" onclick="functionOne();functionTwo();" id="LoginUser_LoginButton"&gt; Does functionOne() first run and then once it is completed, functionTwo() runs? My actual situation is on a ASP.NET page, I'm trying to append a domain name to the username in a login page, before it gets submitted: &lt;input type="submit" name="LoginUser$LoginButton" id="loginSubmit" value="Login" onclick="appendDomain();javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&amp;quot;LoginUser$LoginButton&amp;quot;, &amp;quot;&amp;quot;, true, &amp;quot;LoginUserValidationGroup&amp;quot;, &amp;quot;&amp;quot;, false, false))" id="LoginUser_LoginButton"&gt; Right now I have to way to test if appendDomain() is running before the form gets submitted, so I've got to verify this somehow without actually submitting the form. TIA!
type: AnsweredQuestion
tagged with: synchronous
possible better answer: http://stackoverflow.com/a/28630484

http://stackoverflow.com/comment/45778919
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28744426
has text: great suggestion. But still there are issues like the textarea adds line breaks even if the user doesn't hit the enter key. E.g.: if you type something like "Hey Diddle Diddle..." it shows in 2 lines rather than 1 line.
type: AnswerComment

http://stackoverflow.com/comment/45577112
type: QuestionComment
has text: @nikhilrao That's explained in the article I've linked above.
comment on: http://stackoverflow.com/q/28638669
score: 0
type: Comment

http://stackoverflow.com/comment/46168003
type: AnswerComment
type: Comment
has text: Teach me something today. Tell me why my solution is "much worse".
comment on: http://stackoverflow.com/a/28941420
score: 0

http://stackoverflow.com/comment/45722400
has text: getting now-Error: Object doesn't support property or method 'confirm'
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28717443
type: AnswerComment

http://stackoverflow.com/q/28610062
score: -3
upvote count: 0
has answer: http://stackoverflow.com/a/28636673
type: UnansweredQuestion
tagged with: loops
has comment: http://stackoverflow.com/comment/45524065
type: Question
has comment: http://stackoverflow.com/comment/45524050
tagged with: javascript
has body: I am practicing the function and loop in JavaScript. var i; var result = ''; function candy(x) { for (i = 0; i &lt;= 2; i++) { console.log(x + " candy. Take 1, " + (x - 1) + " candy."); } return result += i; } candy(4); The output: "4 candy, Take 1 down, 3 candy" "4 candy, Take 1 down, 3 candy" "4 candy, Take 1 down, 3 candy" "3" My expected output: "4 candy, Take 1 down, 3 candy" "3 candy, Take 1 down, 2 candy" "2 candy, Take 1 down, 1 candy" Am I missing something in my loop? Any suggestion? Thank you!
has comment: http://stackoverflow.com/comment/45523849
has comment: http://stackoverflow.com/comment/45524596
downvote count: 3
has comment: http://stackoverflow.com/comment/45524128
answer count: 1
has title: Function and Loop in JavaScript
favorite count: 0

http://stackoverflow.com/q/28745594
has comment: http://stackoverflow.com/comment/45774074
has comment: http://stackoverflow.com/comment/45773963
has answer: http://stackoverflow.com/a/28745838
has answer: http://stackoverflow.com/a/28745656
type: Question
tagged with: javascript
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28745853
type: UnansweredQuestion
has title: How to run js code with DOM before page load?
has body: I am making a javascript function that adds script and css elements into my head section, but I need to run that before the page is loaded, how could I do that?

http://stackoverflow.com/a/28663032
has comment: http://stackoverflow.com/comment/45621533
has body: If your .hover-wrapper always accompanies the detail div, you could pass a reference like: onmouseover="coworkerDetail(this, 1, 0)" Then change your coworkerDetail function to be: function coworkerDetail(el, post, delay) { Then instead of using: $('.coworker-detail') get var detail = $(el).siblings('.coworker-detail').first(); and use that instead. This finds the one .coworker-detail div assocuated with the hover element.
type: Answer
has comment: http://stackoverflow.com/comment/45621124
has comment: http://stackoverflow.com/comment/45621922
answers question: http://stackoverflow.com/q/28662905
has comment: http://stackoverflow.com/comment/45621582
score: 0

http://stackoverflow.com/comment/45568430
score: 0
has text: Wow, you're right! If I copy the contents of my component and replace my `var SomeComponent = require('./some-component.jsx');` call with the entirety, it logs as expected. I've yet to figure out why when using CommonJS it would render OK, but not fire events.
comment on: http://stackoverflow.com/q/28623734
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28687406
has comment: http://stackoverflow.com/comment/45667422
type: Question
has comment: http://stackoverflow.com/comment/45667182
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: typeerror
has comment: http://stackoverflow.com/comment/45667235
has title: TypeError: illegal invocation with JavaScript forEach function on Chrome?
duplicate of: http://stackoverflow.com/q/8904782
has body: I am writing JavaScript higher-order function forEach which literally applies action as we loop through each element in the array: function forEach(array, action) { for (var i = 0; i &lt; array.length; i++) action(array[i]); } As I call forEach with action console.log to print out the array's elements, TypeError: Illegal invocation was returned: forEach(["Henry", "Juliane","Robert"], console.log); // TypeError: Illegal invocation Puzzled, I tried creating function print, which does exactly what console.log does: var print = function(value) { console.log(value); }; Now, when I call forEach on the same array, with function print, I got the right answers. forEach(["Henry", "Juliane","Robert"], print); // "Henry" // "Juliane" // "Robert" Why was my first invocation illegal? Is it because I am using Chrome's JS console? The syntax looks fine, and print and console.log here do the same thing.
answer count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/8904782
upvote count: 1
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/45667373
tagged with: console.log
tagged with: foreach
score: 1

http://stackoverflow.com/comment/45541589
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28619193
has text: it's okay :) i managed to find it, with a little tip from my friend.
type: Comment

http://stackoverflow.com/q/28748866
answer count: 1
tagged with: javascript
has title: Spotify Web Player style UI in AngularJS
score: 0
has body: I know this is a pretty big and vague question, but if someone good give me a push in the right direction that would be great. I'm trying to build a UI in the vein of Spotify's web player (play.spotify.com), and have been struggling trying to get anything workable (using angular-ui-router and ngAnimate). The main part of the interface I'm looking to replicate is the cascading panels sliding in from the left; that is, how would I implement that using ui-views, when there are potentially infinite views transitioning in from the right, and I can't simply replace one view with another (the previous view stays on the left side of the screen). It's tough to articulate, so this may not make any sense unless you actually use their web player, but if you have had/have a play with it then you might understand. But yeah, any conceptual overview or hints on how I would implement this with angular-ui-router (or perhaps another module I don't know about) would be greatly appreciated.
tagged with: user-interface
tagged with: angularjs
type: UnansweredQuestion
tagged with: angular-ui-router
type: Question
has answer: http://stackoverflow.com/a/28748983

http://stackoverflow.com/q/28702386
has comment: http://stackoverflow.com/comment/46375137
score: 0
has body: I'm using JoeQuery's Stupid-Table jQuery plugin to sort a simple table. I do not know how to refresh the entire sort cache on a dynamic table. It works like this: $("#myTable").stupidtable(); But I'd like to unbind the plugin from this object and re-bind it so I can reset the sorting to use the values from a new, dynamically generated, table. How can I detach or unbind this plugin from this object? $("#myTable").stupidtable(); // do some ajax stuff that rebuilds #myTable // $("#myTable").stupidtable('destroy'); // ^--- something like this, but this plugin // does not have a destroy method $("#myTable").stupidtable(); What do you recommend? Here's a link to the stupidtable.js.
answer count: 1
tagged with: jquery
linked to: http://stackoverflow.com/q/28701630
has comment: http://stackoverflow.com/comment/45694751
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28702574
type: Question
has comment: http://stackoverflow.com/comment/45694747
has title: How can I unbind a jQuery plugin from an object?
has comment: http://stackoverflow.com/comment/45694914
tagged with: javascript
tagged with: jquery-plugins

http://stackoverflow.com/q/28614670
favorite count: 0
upvote count: 1
possible better answer: http://stackoverflow.com/a/28615095
has answer: http://stackoverflow.com/a/28615095
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28615005
tagged with: replacewith
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45532846
has title: replaceWith doesn't remove comments
accepted answer: http://stackoverflow.com/a/28615005
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
has body: I'm trying to replace a piece of HTML with jquery replaceWidth() &lt;!-- content box --&gt; &lt;div id="content-box"&gt; yo &lt;/div&gt; &lt;!-- /content box --&gt; Like this: $('#content-box').replaceWith(response.box); But then I get &lt;!-- content box --&gt; &lt;!-- content box --&gt; &lt;div id="content-box"&gt; yo &lt;/div&gt; &lt;!-- /content box --&gt; &lt;!-- /content box --&gt; Is there a way to make it replace the HTML comments too? :P
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45532550

http://stackoverflow.com/q/28670948
tagged with: view-source
has title: How can view jquery appended data using browsers view page source option?
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: Iam appending some data to a table in my php page. Data is shown in web page. That's ok. Then I opened the view page source in my web browser. But I didn't see that data in page source. Is there any method to show that data in page source? This is my code for (var i in Newdata) { $('.dataTables_empty').hide(); var str = " " + " " + Newdata[i].VehicleTypeName + " " + " Edit " + " Delete " + " "; var $row = $(str).appendTo("#BrandTypeTable tbody"); }
answer count: 1
has answer: http://stackoverflow.com/a/28671122
favorite count: 0
has comment: http://stackoverflow.com/comment/45635847
upvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28671122
score: 1
type: Question
tagged with: browser

http://stackoverflow.com/q/28687604
has body: I'm trying to use this document.getElementById('menu2').style.marginleft = "5%"; To manipulate the margin-left: 20%; to become margin-left: 5%; I don't know what to do with the dash, if it's a single word like style.width, it's no problem, but a dash seems problematic, what do I do?
possible better answer: http://stackoverflow.com/a/28687695
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28687624
tagged with: javascript
favorite count: 0
type: Question
tagged with: css
has title: Using javascript to manipulate css elements, dash margin-left
accepted answer: http://stackoverflow.com/a/28687624
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28687695
upvote count: 1
downvote count: 1

http://stackoverflow.com/a/28684714
answers question: http://stackoverflow.com/q/28684653
type: Answer
score: 0
has body: You are missing the index references for gradeData in all of your if statements. For example, the first one says: if (gradeData &gt;= 90) { . . . and it should say: if (gradeData[i] &gt;= 90) {

http://stackoverflow.com/a/29289522
has body: The issue is that famous scroll view is not truly scrollable , they animate the group so that it looks smooth , and to add the pull to refresh effect. A solution for this : there is no really a direct and neat solution for this as the iOS keyboard animation will always focus into input and on the other hand famous uses a hidden indicator that works like a scroll bar , which conflicts with the iOS focus algorithm , so the only possible solution is that famous changes the way they animate scrollable view. Workaround: Fortunately there is workaround , if user will scroll away from input it means they may be not interested in inputting text anymore , so we can blur the target input once the view is scrolled. after lot of searching I didnt really find a rigid event for famous to indicate scroll start event, however mutation observer worked well to achieve the required result. Famo.us ScrollView MouseOver - jsFiddle demo The live example can be found on my page
has comment: http://stackoverflow.com/comment/46786921
downvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46786291
score: 1
answers question: http://stackoverflow.com/q/28686467
type: Answer
has comment: http://stackoverflow.com/comment/46817757
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28686467

http://stackoverflow.com/q/28653378
downvote count: 1
type: Question
tagged with: java
has title: how to redirect to servlet with values
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45698936
tagged with: servlets
answer count: 2
tagged with: jsp
has comment: http://stackoverflow.com/comment/45638471
favorite count: 0
has body: i want to redirect from login page to home page(.jsp) and i want to display the value of login in the home page, i used window.location.replace but the value in home page is "null".in first time i send the data to servlet and the servlet redirect to the home page. login.html &lt;form&gt; &lt;p&gt;&lt;input type="text" id="login" &gt;&lt;/p&gt; &lt;p&gt; &lt;input type="button" value="LOGIN" id="log" &gt;&lt;/p&gt; &lt;/form&gt; login.js $(document).ready(function (){ $("#log").click(function (){ var log = $("#login").val(); $.post("Test",{log:log},function(){ }).success(function (){ window.location.replace("Test?log="+log) ; }); servlet:Test.java String l =request.getParameter("log"); request.setAttribute("l", l); getServletContext().getRequestDispatcher("/home.jsp").forward(request,response); home.jsp &lt;body&gt; &lt;% out.println(request.getAttribute("l")) ; %&gt; &lt;/body&gt; thanks.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45668499
has answer: http://stackoverflow.com/a/28653767
upvote count: 0
has answer: http://stackoverflow.com/a/28688060

http://stackoverflow.com/comment/45700498
type: Comment
comment on: http://stackoverflow.com/q/28705304
type: QuestionComment
has text: `Uncaught type error: undefined is not a function` let me find the source of that
score: 0

http://stackoverflow.com/q/28685978
tagged with: regex
tagged with: node.js
answer count: 0
type: UnansweredQuestion
upvote count: 1
has body: I'm requesting a URL's HTML, and loading the HTML into the Cheerio module with this code. var cheerio = require('cheerio'); request(url, function(err, http, body) { if(err) throw err; else { var $ = cheerio.load(body), desc = $('.desc'); // checkpoint } }); At the checkpoint, I need to find sentences that contain email addresses. I tried this code in place of //checkpoint with no luck. var regex = /\n|([^\r\n.!?]+([.!?]+|$))/gim, str = $(desc).text(), sentences = str.match(regex)[0]; console.log(str); // 'Hello! My email is jerry@gmail.com.' console.log(sentences); // ['Hello!', 'My email is jerry@gmail.', 'com.'] I started to understand the RegEx, and tried the code below in place of //checkpoint. var regex = /\n|([^\r\n.!?]+([.!?]+|$))/gim, regex_email = require('xemplar').information.email, str = $(desc).text(), email = str.match(regex_email)[0]; console.log(email); // jerry@gmail.com var needle = email.replace('.', 'dot'); str = str.replace(email, needle), sentences = str.match(regex)[0], len = sentences.length; console.log(str); // 'Hello! My email is jerry@gmaildotcom.' console.log(sentences); // ['Hello!', 'My email is jerry@gmaildotcom.'] while(len--) { if(sentences[len].indexOf(needle) &gt; -1) { console.log(sentences[len]; // 'My email is jerry@gmaildotcom.' } } But, here's the problem; I want to preserve the HTML. Is there a way to do something like this in place of //checkpoint? var cheerio = require('cheerio'), regex = require('xemplar').information.email; request(url, function(err, http, body) { if(err) throw err; else { var $ = cheerio.load(body), desc = $('.desc'); // how do I get all bottom level tags? var bottomleveltags = $(desc).someFunction(); bottomleveltags.forEach(function(tag) { var email = tag.match(regex)[0], tagbody = $(tag).text(); var needle = email.replace('.', 'dot'); tagbody = tagbody.replace(email, needle); var sentences = tagbody.match(/\n|([^\r\n.!?]+([.!?]+|$))/gim); sentences.forEach(function(sentence) { if(s…
score: 1
tagged with: javascript
type: Question
tagged with: cheerio
downvote count: 0
has comment: http://stackoverflow.com/comment/45668387
favorite count: 0
has title: NodeJS - RegEx that will get me sentences with email addresses in them?

http://stackoverflow.com/comment/45540207
type: QuestionComment
comment on: http://stackoverflow.com/q/28617890
score: 0
has text: Thanks; comment deleted since it is now outdated.
type: Comment

http://stackoverflow.com/comment/45598532
type: Comment
score: 1
type: AnswerComment
has text: Here's the updated fiddle: http://jsfiddle.net/Lo9trb80/1/ You can see at the end where I added the parenthesis. Does that help?
comment on: http://stackoverflow.com/a/28649834

http://stackoverflow.com/q/28598595
has body: Is it possible to scale the FONT SIZE of a textarea and maintain its ratio when a browser window is resized? My requirement: There is an image on the background and on the foreground I'm having a textarea where the user is allowed to add their text. I need to maintain the textarea's position and ratio when the bowser window is resized.
type: AnsweredQuestion
has title: Maintain ration on textarea resize
has comment: http://stackoverflow.com/comment/45503466
has answer: http://stackoverflow.com/a/28599726
type: Question
answer count: 1
accepted answer: http://stackoverflow.com/a/28599726
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/45503502
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/45728256
type: Comment
type: QuestionComment
has text: no, you can't do anything with individual words in a text node
comment on: http://stackoverflow.com/q/28720555
score: 0

http://stackoverflow.com/q/28653331
tagged with: bubble-chart
score: 4
upvote count: 4
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28655462
linked to: http://stackoverflow.com/q/20366441
type: AnsweredQuestion
tagged with: d3.js
has comment: http://stackoverflow.com/comment/45603697
type: Question
accepted answer: http://stackoverflow.com/a/28655462
has body: I have been trying to learn D3 (Bubble Charts specifically). I have created a very simple chart here: //This is making the demensions for the circles and canvas //The format and color is for hovering over the circles for the dialog box var diameter = 1500, format = d3.format(",d"), color = d3.scale.category20c(); //This makes the canvas that the bubble chart will be made on var canvas = d3.select("body").append("svg") .attr("width", diameter) .attr("height", diameter) .append("g") .attr("transform", "translate(50,50)"); //This is the size of the actual bubbles in the chart var pack = d3.layout.pack() .size([900, 900]) .padding(85); //This is adding the data into the bubbles and creating their size d3.json("CountryData.js", function (data) { var nodes = pack.nodes(data); var node = canvas.selectAll(".node") .data(nodes) .enter() .append("g") .attr("class", "node") .attr("transform", function (d) { return "translate(" + d.x + "," + d.y + ")"; }); //This is the actual bubbles node.append("circle") .attr("r", function (d) {return d.r;}) .style("fill", function (d, i) { return color(i); }); //This is the text inside the bubbles node.append("text") .text(function (d) { return d.children ? "" : d.name; }) .style("text-anchor", "middle") //This is the dialog box node.append("title") .text(function (d) { return d.name + ": " + format(d.value) + "" + "medals"; }); }); I have been trying to add a legend that will show the "Asia", "North America", "Middle East", etc. and their colors. The closest I have got was showing the boxes with the colors and displaying the color names. I was trying to use this: Legend in D3 circle pack diagram as a reference. I can attach how I attempted to make the legend, but I feel like it would be too much code for a post. Here is my data: { "name" : "Region Olympic Medals", "value" : 10000, "children" : [ { "name" : "Asia", "value" : 451, "children" : [ {"name" : "Summer Gold", "value" : 114}, {"name" : "Summer Silver", "value" : 172}, {"name" : "Su…
has title: Creating a legend for a bubble chart using D3

http://stackoverflow.com/q/28680344
tagged with: http://stackoverflow.com/tag/html
tagged with: php
possible better answer: http://stackoverflow.com/a/28680555
has answer: http://stackoverflow.com/a/28680555
has answer: http://stackoverflow.com/a/28680824
type: Question
has comment: http://stackoverflow.com/comment/45684594
type: AnsweredQuestion
tagged with: javascript
has title: How to save image on a Kineticjs canvas to database?
score: 0
accepted answer: http://stackoverflow.com/a/28680824
answer count: 2
has body: I have a canvas function initStage(images) { var stage = new Kinetic.Stage({ container: "container", width: 550, height: 550 }); and Save Button $('#save').click( function() { stage.toDataURL(function(dataUrl) { $.ajax("ajax.php", { data: dataUrl }, function(data) { alert("Your Design Was Saved To The Server"); }); }); }); and ajax.php $png =$_POST['data']; $filteredData=substr($png, strpos($png, ",")+1); $unencodedData=base64_decode($filteredData); $fp = fopen( 'image.png', 'wb' ); fwrite( $fp, $unencodedData); fclose( $fp ); How do I save dataURL to my Database ?
tagged with: kineticjs

http://stackoverflow.com/comment/45677536
type: AnswerComment
score: 0
type: Comment
has text: updated, How add form after article if ul after article not exist?
comment on: http://stackoverflow.com/a/28693125

http://stackoverflow.com/comment/46201236
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28975014
type: Comment
has text: Please [format](http://stackoverflow.com/help/formatting) your answer to improve its readability. Any explanation of what the code is doing is also beneficial.

http://stackoverflow.com/a/28625691
accepted answer of: http://stackoverflow.com/q/28625405
answers question: http://stackoverflow.com/q/28625405
type: AcceptedAnswer
score: 0
has body: If I understand your question correctly, this should work: jQuery(document).ready(function ($) { var slideCount = $('#slider ul li').length; var slideWidth = $('#slider ul li').width(); var slideHeight = $('#slider ul li').height(); var sliderUlWidth = slideCount * slideWidth; $('#slider').css({ width: slideWidth, height: slideHeight }); $('#slider ul').css({ width: sliderUlWidth, marginLeft: - slideWidth }); $('#slider ul li:last-child').prependTo('#slider ul'); function moveLeft() { $('#slider ul').animate({ left: + slideWidth }, 600, function () { $('#slider ul li:last-child').prependTo('#slider ul'); $('#slider ul').css('left', ''); }); }; function moveRight() { $('#slider ul').animate({ left: - slideWidth }, 600, function () { $('#slider ul li:first-child').appendTo('#slider ul'); $('#slider ul').css('left', ''); }); }; $('a.control_prev').click(function () { moveLeft(); }); $('a.control_next').click(function () { moveRight(); }); setInterval(function () { moveRight(); }, 10000); });
type: Answer

http://stackoverflow.com/comment/45723604
type: Comment
comment on: http://stackoverflow.com/q/28717907
type: QuestionComment
has text: @Rohil_PHPBeginner Not the problem. That line is printed like this: `echo " This doesn't have to be a confirmed champion or not. Could be any Marvel character. (1 Champion Only) ";`
score: 0

http://stackoverflow.com/a/28722712
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: Try this "hbeu50271385_612_21".replace(/_.*/, '') Or var str = "hbeu50271385_612_21"; str.substring(0, str.indexOf('_')) Example
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28722683
answers question: http://stackoverflow.com/q/28722683
score: 3

http://stackoverflow.com/a/28603717
upvote count: 4
answers question: http://stackoverflow.com/q/28593494
type: AcceptedAnswer
downvote count: 0
has body: If your element is inside a template, then it does not belong to the DOM but the shadow DOM. As a complement, in the Web Components site there is an article on the topic and Rob Dodson wrote a detailed article about the basics of shadow DOM. Edit : Polymer 1.0 introduced a specific concept, Shady DOM... I admit the relationship between a polymer element, multiple templates and shadow DOM is not really obvious to me. At first glance, a shadow DOM is associated to a template. A few explanations are available in that other article by Rob Dodson about templates repetition. It seems with repetitions things become subtle: here you have a single shadow DOM and the ID becomes pointless. The worse is that I guess you have nested shadow DOMs because of the nested templates. What is not clear at all to me is here: what about visibility in such a context ? Edit : more informations about visibility are available in that later exchange... Edit : template repetition syntax has evolved in Polymer 1.0 As a conclusion (in my understanding), because of the template repetition you could have multiple identical IDs even inside the repeated template shadow DOM. The valid strategy would be to use a class for selection instead of an ID. Javascript is associated to a Polymer element with a method call. To select via Javascript in the shadow DOM, you should use the querySelector. The solution you suggested with document.getElementById() is valid for the DOM. The point is about nested templates. You have a hint with another exchange on the topic. A solution is suggested with this.shadowRoot.querySelectorAll(...) but an issue in the Polymer project covers the point: this could work but probably not a good practice. The details in the Polymer documentation about node finding are here: in that article there is a sample looking like your problem. According to the Polymer doc, when you call the Polymer element method, assuming you want the selection in the ready event and a container ID assigned i…
accepted answer of: http://stackoverflow.com/q/28593494
type: Answer
score: 4

http://stackoverflow.com/comment/45731819
has text: I see it. Euros and cents are both optional.
comment on: http://stackoverflow.com/a/28721726
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45623789
score: 0
type: Comment
type: QuestionComment
has text: Please specify much more concrete what your "couldn't get to work" exactly means.
comment on: http://stackoverflow.com/q/28663932

http://stackoverflow.com/a/28612292
has comment: http://stackoverflow.com/comment/50674942
accepted answer of: http://stackoverflow.com/q/28605591
has comment: http://stackoverflow.com/comment/45589924
type: Answer
has comment: http://stackoverflow.com/comment/103862933
has comment: http://stackoverflow.com/comment/45549220
answers question: http://stackoverflow.com/q/28605591
has comment: http://stackoverflow.com/comment/50699995
has comment: http://stackoverflow.com/comment/45568389
has comment: http://stackoverflow.com/comment/99616516
has body: Based on the suggestions Ian kindly made, here is my working solution. Firstly, I changed each video's child source elements to have an attribute data-src like so: &lt;video id="my-id"&gt; &lt;source data-src="somevideo.mp4"&gt; &lt;/video&gt; Then, after performing a mobile check using the script available at http://detectmobilebrowsers.com/ which I modified to include iPads etc (related SO answer here) I simply used the following script to automatically update the src attribute of each video (if we're on desktop in my case): var sources = document.querySelectorAll('video#my-id source'); // Define the video object this source is contained inside var video = document.querySelector('video#my-id'); for(var i = 0; i&lt;sources.length;i++) { sources[i].setAttribute('src', sources[i].getAttribute('data-src')); } // If for some reason we do want to load the video after, for desktop as opposed to mobile (I'd imagine), use videojs API to load video.load(); And that's it! Nothing loads on mobile devices anymore and I can have fairly granular control over the devices it will or won't load on. Hope this helps somebody.
upvote count: 33
score: 33
has comment: http://stackoverflow.com/comment/45589681
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/76397489
has text: "The advantage is that each symbol has an unique identity". This doesn't really matter in that case because the symbol will be converted to a string and at least in Chrome this would always lead to 'Symbol(foo)', which means it would be the same to simply do element['Symbol(foo)'] = {}. WeakMap seems to be the most robust way if you can support modern browsers only.
type: Comment
comment on: http://stackoverflow.com/a/28650916
score: 0
type: AnswerComment

http://stackoverflow.com/q/28614079
favorite count: 0
type: UnansweredQuestion
tagged with: php
tagged with: regex
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/28616773
type: Question
has body: i wrote regex to validate url, it works fine for most of url i for below url it does not works: my regex : /^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([?=\/\w \.-]*)\/?$/ https://www.facebook.com/permalink.php?story_fbid=802451379821615&amp;id=298161773583914&amp;pnref=story how to make it work for all urls
tagged with: javascript
has comment: http://stackoverflow.com/comment/45531473
has title: regex for url some issue
has answer: http://stackoverflow.com/a/28616855
answer count: 3
has answer: http://stackoverflow.com/a/28614610
downvote count: 0

http://stackoverflow.com/comment/45692566
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28700055
type: Comment
has text: Can you please edit your answer ..cuz i dont get what ur saying ,..i would accept the answer if u could edit it and give me the code

http://stackoverflow.com/comment/45767203
comment on: http://stackoverflow.com/q/28741980
score: 0
type: Comment
type: QuestionComment
has text: q.defer();What is q here?

http://stackoverflow.com/q/28641209
tagged with: slidetoggle
tagged with: fade
has body: So after you click the "Show Description" link Here It slides out the description. But when you then click "Hide Description" it should reset to its original state, which it doesn´t do now. My Jquery: $(document).ready(function(){ $('.show_hide').click(function(){ $(".show_hide").text("Hide Description"); $(this).prev().prev().prev('.slidingDiv').slideToggle(); $(this).prev().prev('.desc_preview').fadeOut(); $("#fade_layer").fadeOut(); return false }); }); Is there any way to do this? thanks in advance
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/28641287
has title: Set elements to their original state after manipulations
type: UnansweredQuestion

http://stackoverflow.com/comment/45762090
score: 0
comment on: http://stackoverflow.com/q/28739025
type: Comment
type: QuestionComment
has text: In short i want to show all of array data when user types. I don't want to show relative data.

http://stackoverflow.com/comment/45781377
has text: Thanks. Jsfiddle is ignoring this wrong value. I will edit @balintpekker
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28749688

http://stackoverflow.com/q/28679198
has body: I have an SVG logo which I need to dynamically change colour when it scrolls past a section. Each section is 100% in height and width of the browser window. It will either be black or white depending on the background colour. I'm happy to set this once I get the gist of this. Here is my work in progress, I've searched for something but can't find exactly what I need. http://digitronix-dev.co.uk/dev/digitronix-holding/ Code I've tried - var t = $(".dba").offset().top; $(document).scroll(function(){ if($(this).scrollTop() &gt;= t) { $('svg.digi-logo polygon').css({"fill":"#000000"}); $('svg.digi-logo path').css({"fill":"#000000"}); $('svg.digi-logo rect').css({"fill":"#000000"}); } else { $('svg.digi-logo polygon').css({"fill":"#ffffff"}); $('svg.digi-logo path').css({"fill":"#ffffff"}); $('svg.digi-logo rect').css({"fill":"#ffffff"}); } }); However this was only for one section.
downvote count: 0
score: 1
type: Question
answer count: 2
upvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28695054
tagged with: css
tagged with: http://stackoverflow.com/tag/svg
has answer: http://stackoverflow.com/a/28679809
has title: Change color of SVG when scroll past each section
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45667888

http://stackoverflow.com/a/28736229
has body: // Simple POST request example (passing data) : $http.post('/someUrl', {msg:'hello word!'}). success(function(data, status, headers, config) { // this callback will be called asynchronously // when the response is available }). error(function(data, status, headers, config) { // called asynchronously if an error occurs // or server returns response with an error status. }); U have to call like this.....first parameter is url and second one is a object what ever u want to post..
answers question: http://stackoverflow.com/q/28736107
type: Answer
score: -1
downvote count: 1
upvote count: 0

http://stackoverflow.com/comment/45841561
type: Comment
comment on: http://stackoverflow.com/a/28749643
score: 0
type: AnswerComment
has text: Thanks @dandavis! What you suggest makes sense, I'll edit the answer to include your proposal ;)

http://stackoverflow.com/comment/45593721
type: Comment
comment on: http://stackoverflow.com/a/28647855
score: 0
type: AnswerComment
has text: @Stefan Kendall Hey, I think it worked. Why not use `setItem` and `getItem`?

http://stackoverflow.com/comment/51210675
comment on: http://stackoverflow.com/a/28683547
has text: This worked for me, except I use view() to present the view, thanks!
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45778884
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28747811
has text: "Random" and "in order" are contradictory if referring to the same thing. But in this case, Random refers to the index at which a letter of the message M is inserted into array A, and In Order refers to the preserving the index order of each letter in message M such that... if a letter x in message M has index 0, and a letter y in message M has index 1, x will always be inserted into array A before y.

http://stackoverflow.com/a/37525493
downvote count: 0
has body: I had the same problem using MediaCapture in C#. I had to call Dispose() after StopPreviewAsync in order to correct it : await cameraControler.MediaCaptureInstance.StopPreviewAsync(); cameraControler.MediaCaptureInstance.Dispose();
upvote count: 2
answers question: http://stackoverflow.com/q/28670361
type: Answer
score: 2

http://stackoverflow.com/q/28611913
has comment: http://stackoverflow.com/comment/45537976
has answer: http://stackoverflow.com/a/28623321
has answer: http://stackoverflow.com/a/60463753
score: 2
type: AnsweredQuestion
tagged with: javascript
tagged with: passport.js
tagged with: express
favorite count: 0
accepted answer: http://stackoverflow.com/a/28623321
has body: I'm using Express JS and Passport JS for my app. I want to give a new user the opportunity to automatically login, once, by a specific URL. I can get the user from the database with the information from the URL, so I have an User object (with id, email, hashed password etc.) but I don't know how I can use passport to authenticate the user and login. I tried executing below function with the user object I got from the database: req.login(user, function(err) { if (err) { return next(err); } return res.redirect('/users/' + req.user.username); }); source: http://passportjs.org/guide/login/ But that didn't work. Guess it's just because the user object contains the hashed password... Anyone who ever tried this before and can tell me how it works?
type: Question
tagged with: node.js
has comment: http://stackoverflow.com/comment/45540709
upvote count: 3
possible better answer: http://stackoverflow.com/a/28636073
answer count: 3
has answer: http://stackoverflow.com/a/28636073
downvote count: 1
has title: Passport js authenticate by url

http://stackoverflow.com/comment/45717129
has text: No still doesn't work. Can get it to work within jsfiddle but when it comes to running original it still comes up with the same message....
comment on: http://stackoverflow.com/a/28707866
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28658493
upvote count: 1
answer count: 1
downvote count: 0
tagged with: javascript
has title: Problems accessing d3.json object through queue on a flask server
tagged with: flask
favorite count: 0
has answer: http://stackoverflow.com/a/28664251
has comment: http://stackoverflow.com/comment/45613562
has body: At work I got an assigment to do a very simple report. In fact, so ridiculously simple that I decided to up the difficulty rating and make it a interactive chart report using dc.js, on a flask server. The kicker here is that I have never touched Flask, dc.js, d3, crossfilter, or javascript for that matter... (Yes; stupid is, stupid does) What made me go for it was a tutorial, that laid everything out so understandably, and tempting. So now I am here, sweating due to the time pressure, trying to get data generated at the back with pandas, over to the front-end. The code from the tutorial is as follows; queue() .defer(d3.json, "/donorschoose/projects") .defer(d3.json, "static/geojson/us-states.json") .await(makeGraphs); function makeGraphs(error, projectsJson, statesJson) { //Clean projectsJson data var donorschooseProjects = projectsJson; var dateFormat = d3.time.format("%Y-%m-%d"); donorschooseProjects.forEach(function(d) { d["date_posted"] = dateFormat.parse(d["date_posted"]); d["date_posted"].setDate(1); d["total_donations"] = +d["total_donations"]; }); Following the monkey see monkey do principle (the monkey has been using the last couple of hours googling, trying to get an understanding of what is happening, but to no avail), my code is as follows; queue() .defer(d3.json, "/salgshisto") .await(makeGraphs); function makeGraphs(error, salgsData) { var salgsTransaksjonene = salgsData; var dateFormat = d3.time.format("%Y-%m-%d %H:%M:%S"); salgsTransaksjonene.forEach(function(d) { d["InvoiceDate"] = dateFormat.parse(d["InvoiceDate"]); d["InvoiceDate"].setDate(1); d["TotalAmount"] = +d["TotalAmount"]; }); This leads to the following error in the safari console; TypeError: undefined is not a function (evaluating 'salgsTransaksjonene.forEach') And the last piece of info; The flask app.py file, has a @app.route("/salgshisto") def betHisto(): .... creating FO = pandas.DataFrame object .... return FO.to_json(orient='index', date_format='iso', date_unit='s', force_ascii=Fal…
tagged with: d3.js
type: UnansweredQuestion
type: Question
score: 1
has comment: http://stackoverflow.com/comment/45619163
tagged with: dc.js
has comment: http://stackoverflow.com/comment/45617333
tagged with: crossfilter
has comment: http://stackoverflow.com/comment/45620197

http://stackoverflow.com/q/28671884
has body: i'm trying to animate numbers after certain position but the problem is that it's looping the condition over and over again My JS var target = $("#team").offset().top-$(window).height(); $(document).scroll(function() { if ($(window).scrollTop() > target) { $('#lines').animateNumber({ number: 165 },500); } }); My HTML 0 I want to run the statement just for the first time and that's its
has title: how to animate numbers with if statement jquery
type: Question
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45637377
has answer: http://stackoverflow.com/a/28671924
accepted answer: http://stackoverflow.com/a/28671924
possible better answer: http://stackoverflow.com/a/28671911
has answer: http://stackoverflow.com/a/28671911
tagged with: javascript
tagged with: jquery
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45530701
comment on: http://stackoverflow.com/a/28610839
score: 0
type: Comment
has text: No problem, we all start like that. Ok, if you are using chrome, press `F12`, then click the `console` tab. Now when you reload your page you should see the results of your `console.log()` here. Let me know what you get
type: AnswerComment

http://stackoverflow.com/q/28613266
type: AnsweredQuestion
tagged with: jquery-ui
score: 1
has comment: http://stackoverflow.com/comment/45530207
answer count: 2
has body: I have list of inputs of type radios, these drop downs provide sort functionality on data set based on select. Initially, the select provides sorting on ascending order. To provide both sorts of sorting (ascending &amp; descending ) , on select of radio would like to display a down arrow image initially &amp; sort data in ascending and then when the user clicks the arrow it will turn as up arrow image and sorts data in descending order. And when the user clicks the other radio the arrow will be removed from previously selected radio and added to current selected radio. Here is the HTML &lt;ul&gt; &lt;li&gt; &lt;input type="radio" id="btn_Value" name="btn_Sort" value="Value" ng-model="sortType" ng-click="sortChartData('Value')" /&gt;&amp;#09;&amp;#09;&amp;#09;Value&lt;/li&gt; &lt;li&gt; &lt;input type="radio" id="btn_ScoreSort" name="btn_Sort" value="Score" ng-Model="sortType" ng-click="sortChartData('Score')" /&gt;&amp;#09;&amp;#09;&amp;#09;Score&lt;/li&gt; &lt;li&gt; &lt;input type="radio" id="btn_Quartile" name="btn_Sort" ng-Model="sortType" ng-click="sortChartData('Quartile')" value="Quartile" /&gt;&amp;#09;&amp;#09;&amp;#09;Quartile&lt;/li&gt; &lt;/ul&gt; I can attach a div next to each li and set property display none in CSS class and down arrow CSS class and remove the display:none property and add jquery event handler on click. Here is the new HTML. &lt;ul&gt; &lt;li&gt; &lt;input type="radio" id="btn_Value" name="btn_Sort" value="Value" ng-model="sortType" ng-click="sortChartData('Value')" /&gt;&amp;#09;&amp;#09;&amp;#09;Value&lt;div class="hide ascSort"&gt;&lt;/div&gt;&lt;/li&gt; &lt;li&gt; &lt;input type="radio" id="btn_ScoreSort" name="btn_Sort" value="Score" ng-Model="sortType" ng-click="sortChartData('Score')" /&gt;&amp;#09;&amp;#09;&amp;#09;Score&lt;/li&gt; &lt;li&gt; &lt;input type="radio" id="btn_Quartile" name="btn_Sort" ng-Model="sortType" ng-click="sortChartData('Quartile')" value="Quartile" /&gt;&amp;#09;&amp;#09;&amp;#09;Quartile&lt;/li&gt; &lt;…
has comment: http://stackoverflow.com/comment/45530053
upvote count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/22895849
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/28617662
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28613382
accepted answer: http://stackoverflow.com/a/28613382
tagged with: css
downvote count: 0
has answer: http://stackoverflow.com/a/28617662
has title: Multiple Radio Buttons on select attach div with down arrow as background image
type: Question

http://stackoverflow.com/q/28707115
answer count: 0
downvote count: 0
tagged with: javascript
score: 1
has comment: http://stackoverflow.com/comment/45703861
type: Question
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has title: How to store javascript coordinates to database through ruby on rails (Geolocation, HTML5, Javascript, Ruby On Rails)
tagged with: geolocation
upvote count: 1
tagged with: ruby-on-rails
type: UnansweredQuestion
tagged with: coordinates
has body: Please help if you can! I've been looking all over the net trying to find a clear explanation on how to pass a javascript variable (from .js file) to the controller and display it on the views page (erb.html file). So far this is a piece of what I have: .js file: var lat = position.coords.latitude; var lon = position.coords.longitude; $.ajax({ type: "GET", url: "/locations/show", data: { latitude: lat, longitude: lon } }); controller.rb file class LocationsController &lt; ApplicationController def index @lat = params[:latitude] @long = params[:longitude] //these print statements below display the collect variables in the console print "this is lat: #{@lat}" print "this is long: #{@long}" end view.erb.html //the @lat &amp; @long variables are now nil and don't display at all. //but in the console they display the collect values. this is lat: &lt;%= @lat %&gt; this is long: &lt;%= @long %&gt; I'M CONFUSED!!! PLEASE HELP! THANK YOU!!!!!

http://stackoverflow.com/comment/45559559
comment on: http://stackoverflow.com/a/28617602
has text: togetherjs plugin is filled with lots of bugs
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28645056
has comment: http://stackoverflow.com/comment/45594312
linked to: http://stackoverflow.com/q/1416697
type: Question
has comment: http://stackoverflow.com/comment/45588844
has comment: http://stackoverflow.com/comment/45588041
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28645137
tagged with: jquery
score: -1
has title: I want to create a script which tells me when a post is posted
has comment: http://stackoverflow.com/comment/45588219
answer count: 2
downvote count: 2
accepted answer: http://stackoverflow.com/a/28645217
upvote count: 1
favorite count: 0
has body: I want to create a script in php, javascript or jquery which tells me when a post is posted like Facebook in facebook when we post a status it tells us posting time like 5 minute ago or so on. I have completed all other work.
has answer: http://stackoverflow.com/a/28645217
tagged with: facebook
has answer: http://stackoverflow.com/a/28645137
tagged with: php
type: AnsweredQuestion

http://stackoverflow.com/comment/45735534
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28712867
has text: This resolved my immediate issue. I will try to extend this accept json data from a controller. Is there anyway that fiddle might be able to duplicate this behavior? That is, post to not a controller, but some api somewhere and get data back? Once I am sure I have the javascript working, then port to my MVC application? Thanks.

http://stackoverflow.com/q/28657476
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28657545
has answer: http://stackoverflow.com/a/28657527
has answer: http://stackoverflow.com/a/28657548
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has title: How to affect a specific class when button contained in said class is clicked
possible better answer: http://stackoverflow.com/a/28657510
favorite count: 0
has answer: http://stackoverflow.com/a/28657510
answer count: 5
has body: I've got a list of links which each have their own scores and up/down vote buttons. When a vote button is clicked, I want to change all the colours in that track's line to green/red. Track 1 10 points + - Track 2 5 points + - Track 3 0 points + - Track 4 0 points + - So if I was to click the upvote button of track 2, how could I change the style attributes of it's containing "trackwrap"? The problem is I don't know how to select just the specific li that contains the button that is clicked. I'm pretty new to javascript so this has been a problem knowing what to google so I'm sorry if the question already exists. The list will be auto-generated so I can't assign ID's to each li and use getElementById.
has answer: http://stackoverflow.com/a/28657585
accepted answer: http://stackoverflow.com/a/28657545
tagged with: css
type: AnsweredQuestion
score: 2
upvote count: 2
type: Question

http://stackoverflow.com/a/28664102
type: Answer
answers question: http://stackoverflow.com/q/28663297
has comment: http://stackoverflow.com/comment/45659227
has body: The data point is, I would assume, being pushed to the series, but the problem lies in the fact that this doesn't happen until after you have already created and rendered your chart instance. Leaving aside the fact that I don't see a declaration of the options variable in your code, which would suggest that there might be another bug lurking (but I'm assuming that's just a typo?), the problem lies in the fact that HighCharts doesn't do anything to track the initial series that you pass it, so modifying that series isn't going to affect the chart. You'll need to update the chart yourself - using, for example, the addPoint method of the HighCharts series object. So, in the success callback for your Ajax calls, you'll need to do something along the lines of: $.get('button0.txt', function(data) { // Split the lines var lines = data.split('\n'), chart = $('#container').highcharts(); chart.series[0].addPoint({ name: 'Power off', y: lines.length-1 }); });
score: 0

http://stackoverflow.com/comment/45720470
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28716346
type: Comment
has text: Can you edit you question with the source code in text format rather than images? having access to the source rather than images of it would make it easier to work with. Then i will edit my answer.

http://stackoverflow.com/q/28669042
tagged with: heatmap
score: 2
type: AnsweredQuestion
has body: I'm using patrick wied's heatmapjs. I want to know how to destroy an instance and remove the canvas div created by h337.create(configObject) function. Example: var config = { container: document.getElementById('heatmapContainer'), radius: 10 }; var config2 = { container: document.getElementById('heatmapContainer'), radius: 5 }; var heatmapInstance1 = h337.create(config); var heatmapInstance2 = h337.create(config); var heatmapInstance3 = h337.create(config2); I want to destroy and delete canvas div only for heatmapInstance1 instance.
has answer: http://stackoverflow.com/a/54642904
type: Question
has answer: http://stackoverflow.com/a/28789832
tagged with: javascript
possible better answer: http://stackoverflow.com/a/53730501
has answer: http://stackoverflow.com/a/53730501
answer count: 3
downvote count: 0
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28789832
upvote count: 2
has title: How to destroy heatmap.js instance?

http://stackoverflow.com/comment/45637120
comment on: http://stackoverflow.com/q/28670527
type: Comment
has text: Give me the link of the isotope so that I can make small demo of it in my machine.
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45754896
score: 0
comment on: http://stackoverflow.com/q/28734841
type: Comment
type: QuestionComment
has text: I added everything i though you might need to help

http://stackoverflow.com/comment/45770538
comment on: http://stackoverflow.com/a/28741058
type: Comment
has text: try that demo @DennisOßwald and make some animation changes as you want... like zoom in or fade out or what ever... just google some css tricks for that
score: 0
type: AnswerComment