« first day (1139 days earlier)      last day (4032 days later) » 

10:00
not bad
Were you trying to blow up my cpu?
0
Q: AngularJS: Conditional Statements not working in angular JS method of controller

PadysterI have a below code: <!DOCTYPE html> <html data-ng-app> <head> <title></title> <style> .menu-disabled-true { color: gray; } .menu-disabled-false { color: red; } .menu-disabled-green { color: green; } </style> </head> <body > <script src="angular.min.js"></script> <script> function DeathrayMenuC...

@Kippie it doesn't eat up CPU. It just gets two threads wait until the other finishes
vs7
vs7
Hi
I think I pissed off Twitter
vs7
vs7
10:12
I have a problem my page sending the same ajax request multiple times
@JanDvorak you helped me yesterday for the same
!!tell vs7 format
@vs7 Format your code - hit Ctrl+K before sending and see the faq
vs7
vs7
   var iCountpage = 0;
            $(window).scroll(function()
            {

//                console.log($(window).scrollTop() + "and height : " + $(document).height());
                if ($(window).scrollTop() + $(window).height() == $(document).height()) {
                    $("#infinite-loading").css('display','inline-block');
                    var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';

                    var data = {
                        wp_nonce: '<?php echo wp_create_nonce('sfp_forum_secret_no_one_knows_LATEST'); ?>',
1 message moved to recycle bin
@vs7 the scroll event does fire multiple times. Perhaps you want to remember if you have already sent a request
vs7
vs7
ya ... it requesting the data for page_num=0 for 2-3 times
and for every page doing same
@JanDvorak how i can track if page request already sent or not
10:17
just store a boolean flag somewhere you can reach
and where it survives long enough
vs7
vs7
in cookies ?
will a local variable do?
vs7
vs7
like before ajax i just set it false and after ajax come i set it true
again
or do you want once and for all instead of once per page?
vs7
vs7
I need to request the next page every time user scroll down
for my infinite scroll
10:20
yeah.. clear when you finish loading
vs7
vs7
 var iCountpage = 0;
            $(window).scroll(function()
            {

    //                console.log($(window).scrollTop() + "and height : " + $(document).height());
                if ($(window).scrollTop() + $(window).height() == $(document).height()) {
                    $("#infinite-loading").css('display', 'inline-block');
                    var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';

                    var data = {
                        wp_nonce: '<?php echo wp_create_nonce('sfp_forum_secret_no_one_knows_LATEST'); ?>',
will it works?
@JanDvorak
where is iCountcheck declared?
Also, why are you using Hungarian notation?
Also, why are you using integers instead of booleans?
also, you're checking the flag just after you set it. Not good.
var loading = false;
//...
if(!loading){
  loading=true;
  $.post(..., function(...){
    ...
    loading=false;
  })
}
10:42
0
Q: Enable ctrl+c and ctrl+v buttons in the function

user3045390I want to add the code to enable ctrl+c and ctrl+v in the function, the numbers are enabled and the alphabets are disabled. This function is used in the textbox, where the ctrl+c and ctrl+v are to be enabled but not the alphabets. I tried various things, but could not get through it. Any help in ...

Son of a...
New expension of wow
But Im not going to play
I like to watch their trailers, they make them so good
Hello all
i want FIleReader interface to run in main thread how to do this?
you know JS is event driven right?
10:57
then why did you ask a question like that? Gosh!
you don't. You don't have threads in javascript, you have events
@EnglishMaster is it possible to wait for reader.onload event to result and then proceed?
God dang it!
Meeeeeep! Wrong approach!
yeah that's the whole point, gosh!
10:58
@MuneemHabib ah, the good old "how do I wait for sth" - no, you can't.
i am new to javascript
please guide me little bit
please
while(new_to_ecmascript) { learn(); }
now thats blocking
Just reboot your computer, that might fix your bug. Gosh!
my new ava! yes!
11:00
well what can I say.. thanks for info & sharing bro!
I disapprove of that avatar.
@FlorianMargaine nice !
@JanDvorak +1
vs7
vs7
11:16
    @JanDvorak

its seems working is that right

var iCountpage = 0;
            $(window).scroll(function()
            {

//                console.log($(window).scrollTop() + "and height : " + $(document).height());
                if ($(window).scrollTop() + $(window).height() == $(document).height()) {

                    $("#infinite-loading").css('display','inline-block');
                    var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';

                    var data = {
                        wp_nonce: '<?php echo wp_create_nonce('sfp_forum_secret_no_one_knows_LATEST
Why do you immediately send back the data by Ajax that client just received?
vs7
vs7
@AbhishekHingnikar what happen?
1. Its horrible
2. I hate php
3. Wtf you do realize that will do what English Master said ?
4. Your indentation & style makes my eyes bleed (yeah even i cuss about bad looking code at times )
ps i hope your realize by doing it that way you are basically doing evil with your satanic soul ?
vs7
vs7
@AbhishekHingnikar its the only code to get a infinite scroll .. as you hate php so its not your cup of tea ...
so better to keep silenced
11:24
test
when Russian hackers would do anything to harm your computer for a cup of vodka. would British hackers do anything to harm you computer for a cup of tea and a biscuit?
@vs7 I hate it cause i have used it for some time
@EnglishMaster no, that's just stupid.
vs7
vs7
how i can invite someone in this chat room ?
11:39
@vs7 send him a link? But, will he like him?
@EnglishMaster dunno but taliban hackers will for no reason !
PS its a shot* of vodka
12:00
guy's, i am passing a string as an attribute to a custom element of mine. based on that string, i would like to call one or another function. i am using a switch block to determine the strings content. but it would be easier if i could rather call a variable function. e.g [string].somePrototype(). is this possible or should i stay with a switch?
sounds like a case for lookup-hash ?
    var lookup = {
        string1:   function() {},
        string2:   function() {},
        // and so forth
    };

and instead of switch you just pass the string to your lookup

    lookup[ theString ]();
i have to admit, i could have thought of this by myself. thank you very much
<script>

	function addControl( element, id, type, value, eventName, eventBehaviour ) {
		var item = document.createElement( element );
		item.id = id;
		item.type = type;
		item.value = value;
		item.addEventListener( eventName, eventBehaviour );
		document.body.appendChild( item );
	}

	function setupPage() {
		addControl( "input", "0", "button",
					"click me", "click",
					function() { alert( "I was clicked!" ); }
		);
	}

	window.onload = setupPage;

</script>
Desktop development style :p
f*** html
12:07
Holy indentation
@user2422960 but you might want to do a if( string in lookup ) or even better if( typeof lookup[string] === 'function') check beforehand
to avoid some nasty errors
@AbhishekHingnikar Good Evening bro... ;-)
@CJRamki good evening
user3762851
Hello all
user3762851
12:35
Can anyone help me out in my issue, please?
user3762851
It's very urgent for me:
user3762851
0
Q: How to give alert message to the user when mouse pointer is not present on the webpage of my website?

PHPGeekI'm using PHP, jQuery, JavaScript, etc. for my website. Now, I have to write a script using jQuery/JavaScript which will give alert message to the user when the mouse-pointer is not present on the tab in which any of the webpage from my website is getting displayed. Suppose, if user presses "Wind...

13:00
@FlorianMargaine damn! Its not like he could even go looking for it.
@FlorianMargaine Oh, man
@SomeGuy minutephysics is excellent btw :D
There's Vsauce and Veritasium1 too if you want more!
sweet, thank you :D
13:27
Angular question
post: function() {$scope.form.isDisabled = true;}
<button ng-click="form.post()" ng-disabled=“{{form.isDisabled}}”>post</ button>

Why the above method not disabled my button?
In browser console the attribute has already changes to true but not disabled

If I write true directly to the attribute, and it works
<button ng-click="form.post()" ng-disabled=“true”>post</ button>
@rlemon What up?
ntm
@rlemon What can you tell me about this: H.J Res 15
no more than google could
13:38
@rlemon Google Cloud? This is political term.
!!google h.j res 15
wrong clipboard
@rlemon could have been a lot worse
@mikedidthis Were you bitten!? Strip! Prove you weren't bitten.
13:39
@Boris_yo i'm not sure what you are asking. just google it
@rlemon I don't remember if it was you or another guy who refuted that Obama cannot stay president for additional period.
and as it currently stands he cannot
this is a proposal.
0
Q: JQuery to construct elements

RoddyI'm new to JQuery, and am using it to dynamically construct chunks of a page. The HTML this code creates is what I want, but I'm not sure if the way I'm generating it is sensible or idiomatic. function setupIndex() { $(document.body).append($("<img/>", {src : 'logo.png'})); var div = $("<div/>

Bye @all, Good Night... tc...
@rlemon Too early to tell...
13:54
I don't think you understand how this works. currently the 22nd amendment says he cannot. This amendment to the amendment is only a proposal.. and it isn't even looking good. but even if it were looking like it would pass, it is not at the moment. So we can say right now he cannot.
even then, the prognosis isn't good for the proposal.
hello :)
@rlemon So original amendment prohibits its cancelation?
right now. at this very moment.. no he cannot. That proposed amendment is in its VERY early stages. That would be like saying "well because I haven't lost the lottery yet I may as well have won it!"
so to the question: Can Obama serve a third term?
the answer is: no

if you follow up with: but there is a proposed amendment that could pass
my follow up is: ask me this same question again once it does. Until then my previous answer stands
get it?
@rlemon I understand. I just assumed that part of 22nd amendment prohibits its change to preserve itself. I mean nobody can change it and ones who do, will be considered traitors to the constitution.
What's the best online JS tutorial you know?
14:04
@rlemon Yes sir, but his man does not: youtube.com/…
@Boris_yo there is a process to make these things pass. as you can see in the 'progress' section of that image above ;) it isn't "one man" it is a collective.
@Boris_yo yea i'm not interested in conspiracy theorists if you didn't already catch on
@BenjaminGruenbaum w3schools
@FlorianMargaine -_-
@BenjaminGruenbaum jk, this one is pretty good javascript.info
it doesn't go through xhr though
"go through xhr"
14:13
@rlemon How much money you bet it would pass? $0?
ah, thanks
@Boris_yo I wouldn't bet it would pass. but I really don't care
XHR takes like 3 minutes to explain - the difficult part is the concurrency model.
If you already know that - XHR is ez
I don't live in that country and their last few presidents have all sucked imo. so . yea.
14:14
XHR is used for making an HTTP request from the page and getting a callback when it's done.
@rlemon You are in Canada but what will happen to US will ultimately affect Canada in first place and then the rest of the world.
I think you put too much pull in the USA
@BenjaminGruenbaum if you know what http is, then yeah
@rlemon Last president with morals was JFK, correct?
it will effects us and the world sure, but not as much as I think you believe.
14:15
@rlemon One world currency.
@Boris_yo and he was killed by a cop!
eh, wrong field. should have gone to the js console
@ThiefMaster I know mods don't have a say in the development of the site (or so they claim ;) ) but surely you can make yourself a little more heard than us about the broken state of the flag system
Benji's question is on its 4th bounty asking for official responses
14:34
ah, bug found... i was checking for eventType == 9 but it's event_type
posted on November 28, 2013

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._getTracker("UA-3727700-1"); pageTracker._trackPageview(); } catch(err) {} Happy thanksgiving, dorks! We'll be releasing the Science book tomor

15:15
0
Q: My JavaScript OOP style, is it correct?

Gelo VolroI have done the following code for the testing a web-service. I wonder, is my style a correct one for using OOP in JavaScript. Thanks! <script> function Ajax() { var Base = { createAjaxInstance: function() { var ajax = null; ...

@GeloVolro no, it's not. The whole bit for 'getting an ajax' is absurd. This is not what OOP is for or what it means at all.
0
Q: My JavaScript OOP style, is it correct?

Gelo VolroI have done the following code for the testing a web-service. I wonder, is my style a correct one for using OOP in JavaScript. Thanks! <script> function Ajax() { var Base = { createAjaxInstance: function() { var ajax = null; ...

@Feeds ninja'd
user1994804
After following a plethora of tutorials I have put together an AJAX call for a pagination application on my existing site but it takes forever to load results when moving from page 1 to page 2 or 3 or 4 etc...
user1994804
and I'm not sure if this is because I have for loops in my ajax call
user1994804
15:28
Hoping someone could take a look and advise
user1994804
Using this page as an example
@YourAdrenalineFix have you located the code that is responsible for the delay?
user1994804
No
does watching the network console give any hint?
user1994804
15:31
Im pretty novice and dont know if having the for loops in honda-dirt-bike-parts-parser is the problem
user1994804
Looking at network console, I only see errors that wouldn't affect this but I could be wrong
user1994804
@JanDvorak Gimme just a sec and I'll post my AJAX call in a GIST
@YourAdrenalineFix if some ajax takes too long to respond, look at the responsible server code
and any errors are definitely worth paying attention to
user1994804
Problem is I don't know if I should have all these for loops in my call\
loops in your call? Do you have an example?
user1994804
15:34
and the errors are just from pics that dont load when working local and the others are from the Share Widget... Nothing I can really do with those
user1994804
@JanDvorak I'm working on the sample
user1994804
<-- Not Super fluent with a keyboard
user1994804
just a sec
user1994804
@JanDvorak here is my AJAX call (honda-dirt-bike-parts-parser.php) called in the AJAX in the link I initially provided
user1994804
user1994804
15:37
The thing is... I DONT know whats right from wrong in this
user1994804
which file should hold the for loops etc
> We seem to have missed the gist of that gist you were looking for
user1994804
I'm very novice and just put this hybrid pagination application together while following many, many tutorials
user1994804
Huh?
@BenjaminGruenbaum definetly hard to call OOP the full one in JS, because it doesn't support many features, which C# or C++ do have. So I can't imagine what are you talking about exactly, if you have exact things to say, so please make a post to my question.
15:39
@YourAdrenalineFix your link doesn't work for me
user1994804
Ahh
user1994804
Lemme look into it
user1994804
strange... I just copied the link
user1994804
user1994804
Tha' Fu$#%??
user1994804
15:42
I dont know why these links arent working
user1994804
WTF??
user1994804
Just a sec, Lemme recreate...
user1994804
?????? Everytime I create a GIST then try to view it, it gives me the WHOOPS
@YourAdrenalineFix You don't even seem to have a Github account github.com/YourAdrenalineFix
github hates you
user1994804
15:48
@JanDvorak Would it be frowned up to insert the code here?
user1994804
GITHUB can Kiss My Ass
@YourAdrenalineFix is it reasonably short?
user1994804
Mmmmmmm...
pastebin is a nice service
user1994804
How long is a piece of string
user1994804
15:49
lol
user1994804
;)
user1994804
200 lines?
more than 15 lines -> use a copy/paste service
200 lines is way over the top
even to read
user1994804
I wonder why GITHUB would drop my acct?
user1994804
idiots...
15:51
Calm down dude
user1994804
I just set up my acct yesterday at Git and used it once last nite. I guess my name rung as a "Spammer"?? Well the 200 lines issue is because it has all these for loops which I am not even sure i have implemented correctly (In the best manner) Could I ask you to just take a glance?
You forgot to ask if you can ask to ask
Not enough indirections
user1994804
@JanDvorak Im not really asking you to scour the code, just tell me from 30,000 ft if it all looks generally correct
user1994804
Seems like a LOT of code duplication on MY part, I just don't know how to tighten it up (Yet)
user1994804
15:55
@rlemon ;)
@YourAdrenalineFix sorry if I'm asking stuff that's been discussed, just got here. Are you using jQuery? $.each loops can be expensive if nested or alot are used.
user1994804
How about since I already posted my url here once, I just create a txt file on my site for you guys to view?
user1994804
@jammypeach Thanks so much for contributing. No, I'm not using jQuery in this app
@YourAdrenalineFix ok, will be happy to scan over it if you post a linky.
user1994804
Cool
user1994804
15:57
Comin right up
user1994804
Thx
.each isn't actually that expensive.
FYI
user1994804
Okie Dokie...
user1994804
PS, I intend on removing this file from my server ASAP
user1994804
15:59
so plz lemme know once you've seen it
user1994804
(Whoever's interested in looking)
Eww, PHP

« first day (1139 days earlier)      last day (4032 days later) »