« first day (2010 days earlier)      last day (2953 days later) » 

7:00 PM
Browsers are not required to adhere to someone's blog page
 
@TodoPertin Caprica Six is faster than me :)
 
user5992646
@Abhishrek here:
 
user5992646
function sticky_relocate() {
    var window_top = $(window).scrollTop();
    var div_top = $('.something').offset().top;
    if (window_top > div_top) {
        $('div.className ul').addClass('stick');
    } else {
 $('div.className ul').removeClass('stick');
    }
}
$(function () {
    $(window).scroll(sticky_relocate);
    sticky_relocate();
});
 
user5992646
@QueueOverflow faster than me too.
 
user5992646
@JanDvorak ok me friend.
 
7:00 PM
@TodoPertin there is more wrong with that piece of code than css
 
user5992646
@Abhishrek that is scary to hear.
 
for starters can you not cache or refactor out $('div.className ul')
 
user5992646
what is wrong?
 
user5992646
I have to addd 'cache '?
 
user5992646
@QueueOverflow faster than me too.
 
7:03 PM
var cache = $('div.className ul')
s/$('div.className ul')/cache/
 
user5992646
@abhishrek and @littlepootis ok. thank you friends.
 
@BenjaminGruenbaum a bunch of high performance opinionated react components
 
user5992646
JavaScript or PHP is harder to learn?
 
user5992646
!!pronounce JavaScript
 
@TodoPertin That didn't make much sense. Use the !!/help command to learn more.
 
user5992646
7:06 PM
!!wiki JavaScript
 
@TodoPertin it's the difference languages for solving the different tasks.
 
JavaScript (/ˈdʒɑːvəˌskrɪpt/) is a high-level, dynamic, untyped, and interpreted programming language. It has been standardized in the ECMAScript language specification. Alongside HTML and CSS, it is one of the three core technologies of World Wide Web content production; the majority of websites employ it and it is supported by all modern Web browsers without plug-ins. JavaScript is prototype-based with first-class functions, making it a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles. It has an API for working with text, arrays, dates and regular...
 
@Zirak ( ͡° ͜ʖ ͡°)
 
How many JS developers are there out there?
 
user5992646
@QueueOverflow ok. :)
 
7:06 PM
@BenjaminGruenbaum 7
 
@BenjaminGruenbaum 42
 
user5992646
will ios 8.3 safari support flex fully?
 
@TodoPertin loosely speaking, JS is often using for frontend, PHP is using for backend.
 
user5992646
is scroll and fix div to top not possible without JS but CSS only?
 
user5992646
@QueueOverflow ok. :)
 
user5992646
7:08 PM
thank you. :)
 
@TodoPertin ios 8.3 should support (caniuse.com/#feat=flexbox)
 
@QueueOverflow I use JS for backend and PHP for frontend
 
user5992646
ok thank you. people here are still on ios 8.3 for jailbreak.
 
@TodoPertin it's possible.
 
user5992646
lots of people.
 
7:10 PM
@littlepootis PHP for frontend, are you seriously?
 
user5992646
@QueueOverflow I dont know to put in better way, How?
 
@QueueOverflow yes, I am seriously
 
@littlepootis could you describe how?
 
@littlepootis as in, multi-tier?
 
7:13 PM
@FlorianMargaine I've worked on a multi-tier applications but this just sarc
 
@littlepootis sarc?
 
@FlorianMargaine urban :)
 
@TodoPertin one second.
 
!!urban sarc
 
@FlorianMargaine sarc! sarcasm
 
7:14 PM
@BenjaminGruenbaum Err over 9000
 
oh.
boring.
 
user5992646
@QueueOverflow there are people who you cannot thank enough and the truth is you are one of them.
 
@QueueOverflow <script type="application/php"><?peehaachp require('phpQuery.php'); $doc = $("document"); $doc['ul > li'] ->addClass('my-new-class'); ?></script>
 
user5992646
@QueueOverflow wrong link I think. nothing.
 
@QueueOverflow u wot m8
 
user5992646
@QueueOverflow lol not this one.
 
@TodoPertin Then I don't understand you correctly :)
 
@Todo There's no way to do that without JS.
 
user5992646
@littlepootis ok
 
user5992646
7:20 PM
@QueueOverflow you can have a look here:
 
user5992646
 
@TodoPertin I understand, and I agree with "little pootis" that it is impossible without JS.
 
user5992646
:)
 
@littlepootis could you give a link to read about using PHP in frontend? It looks as sort of humor for me now.
 
9 mins ago, by Caprica Six
@FlorianMargaine sarc! sarcasm
 
user5992646
7:23 PM
@QueueOverflow thank you, though.
 
@littlepootis ah, I am too serious today :)
 
old, but fun
 
@Zirak you didn't annswer
 
I have a slight problem : var startdate = $(this).val();
console.log(startdate);
var year = startdate.year();
 
7:36 PM
@tyrell_c Welcome to the JavaScript chat! Please review the room rules. Pleasedon't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
returns startdate.year is not a function
I've tried it with getFullYear and getYear and got the same error
does stardate need to be a specific format ? right now it's in DD/MM/YY format
 
@tyrell_c what is this
what does console.log logged ?
what is the output ?
 
1 message moved to Trash can
@tyrell_c Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
of your console.log(startdate) ?
 
04/02/2016
 
7:42 PM
@tyrell_c I think thats a string
and not a date (:
try doing var startdate = new $(this).val();
 
@MadaraUchiha I'm on...erm...dunno how to translate it. But tomorrow I'll be painting tree trunks white.
 
@Zirak That's what... she said??
So toranut?
at night..?
 
@MadaraUchiha If you know what I mean
yeah
Dunno until when. I'll buzz you up.
 
kk
Benji also said he'll be finishing up late
So we'll probably do later than usual
 
oh yeah .. but the new doesn't make any changes @ab
@Abhishrek
 
7:44 PM
I assume I'll finish by 1700
 
err @tyrell_c i mean new Date($(this).val());
 
it works!
thank you @Abhishrek
 
@Zirak FIGETFROZEN patch declined
 
@abhi how to contact Awal?
 
@FlorianMargaine What!? Why? Link? Explanations? Death sentences?
 
7:47 PM
@littlepootis that will ping every @abhi on so
 
"using this interface would be racy"
 
Ugh, I need to call him right now.
 
@littlepootis also I don't know.
 
@Abhishrek no, only those that were in this room in the last month or so
 
@FlorianMargaine :o well thats better :D
@littlepootis why ?
try calling his phone number ?
 
7:48 PM
@Zirak err, search "FIGETFROZEN" in the fsdevel ml
 
He drank way too much coke yesterday
 
> For some reason, my email client replaced tabs with spaces in my
previous email.
 
Hello
 
@Zirak another reason is that you can freeze multiple times, and thaw multiple times
 
@FlorianMargaine So thawing is a semaphore
 
user5992646
7:50 PM
My codes are working but in a messy mess.
 
@Zirak uh?
 
@FlorianMargaine If you freeze twice, you have to thaw twice to actually thaw.
 
no, it's just that thawing a thawed fs is a noop, basically
@Zirak no
 
oh
 
@awal alive?
 
7:51 PM
subsequent calls to freeze on a frozen fs are a noop
 
@AwalGarg @jarvis show yourself.
 
same for thaw
 
@awal @jarvis congrats on consuming 700mg of caffiene in a day. How're you feeling?
 
user5992646
:)
 
@littlepootis I CAN HEAR COLORS
 
7:59 PM
morning
 
@MadaraUchiha 700mg is near-fatal
 
@FlorianMargaine That sucks :(
 
@littlepootis I CAN FEEL SMELLS
 
@Zirak well, the reasoning is sound...
 
8:15 PM
@FlorianMargaine Still
 
8:26 PM
@Zirak :|
 
8:59 PM
So we were playing cornhole in the driveway and the neighbor kid comes over to play, and after I beat him (after going over 21 3 times...) I said good game, and this dude literally says "gg" to me. I died a little on the inside
 
user5992646
could somebody tell me flex vs media query for responsive design? Flex is not use for responsive design but in my situation it's quite helpful responsively.
 
9:29 PM
@TodoPertin Both
 
ooops
0
Q: How to properly use JQuery load() function?

nTuplyI have hit a dead-end here. I am trying to reload a dropdown menu using the JQuery load() function in my ajax function and I can't seem to get it right. The problem is basically with the CSS styling and the Javascript. Let's say I make an ajax call that adds a user to my database and want to di...

Can anyone help with this? It's driving me crazy crazy crazy
 
user5992646
@MadaraUchiha ok. thank you. :)
 
I prefer media queries, never used Flex
 
user5992646
flex has poor support in old browsers still widespreadly used. but flex is goog too.
 
@BadgerCat I lolled
 
9:41 PM
@phenomnomnominal I bet she's hurting a bit right now lol
 
haha I'd guess so
 
10:40 PM
@SterlingArcher :( typing without my left index finger is hard :/
 
user5992646
I have an element who has a style display: table-cell but when the window is resized to 389 pixels and below I want to make it disappear so I have set @media only screen and (max-width:389px){.element{display: none!important}} but it wouldn't go away.
 
for chart.js ... is there such method as chartdata.lables.push(something)
trying to follow stackoverflow.com/questions/24929931/… and the first answer uses it
but when I use I get chartData is not defined
 
user5992646
It is really stubborn - as you would say in English.
 
user5992646
Ok ignore my problem. I altered the order of media queries and the element went away on window resizing below 389px.
 
user5020521
11:08 PM
hi guys what is the correct condition to prevent an existing script from being reloaded?
 
You'll need to hold some kind of state to decide whether it's been executed or not.
 
user5020521
I mean I have created a script element and added a click event to a html button
 
user5020521
let's assume the function loadScript is executed whenever you click the x button
 
at that point you can either detach the event handler from button in the loadScript or just put have some kind of variable that holds the state of the button (like true/false) and then when it's clicked again you'll check on that variable (state).
 
user5020521
@shriek may I show you a piece of my code?
 
user5020521
11:12 PM
just a few lines don't worry
 
sure
 
user5020521
thank you dawg
 
um..k.
 
user5020521
function loadScript(src)
{
    var s,
    r,
    t;
    s = document.createElement('script');
    s.type = 'text/javascript';
    s.src = 'http://maps.googleapis.com/maps/api/js?key=AIzaSyAaMAfu7S2AITODrGJzVkIYBXlZR3FYhuQ&';
    s.async=true;
    s.onload = s.onreadystatechange = function() {
        //console.log( this.readyState ); //uncomment this line to see which ready states are called.
        if ( !r && (!this.readyState || this.readyState == 'complete') )
        {
            codeAddress();
 
user5020521
the bad thing is that this function has a callback function
 
user5020521
11:13 PM
so if the script is not loaded the callback is not executed
 
where do you see callback function?
 
user5020521
codeAddress
 
user5020521
that function should be a kinda callback of loadScript
 
Oh..that's just a regular function. Not really a callback function. Where is it though?
I don't see it in the code.
I mean the function definition.
 
user5020521
well I show you that too
 
user5020521
11:16 PM
/*geocode function to convert address into google maps lat lon*/
function codeAddress() {
    var geocoder = new google.maps.Geocoder();
    var address = document.getElementById("via").value;
    address += " " +document.getElementById("civico").value;
    address += " " +document.getElementById("cap").value;
    address += " " +document.getElementById("citta").value;
    address += " " +document.getElementById("prov").value;
    console.log(address);
    var lat=[];
    var lon=[];

    // next line creates asynchronous request
 
user5020521
last fucntion called is an ajax request to modify records within a table
 
Does onreadystatechange have context to that function?
 
user5020521
I think so but the problem is that the maps api scritp is loaded whenever you click save
 
what do you get when you do console.log(this) inside onreadystatechange event handler.
 
user5020521
undefined
 
user5020521
11:18 PM
why are you asking me?
 
undefined?
 
user5992646
:)
 
Just trying to help, buddy.
Anyway, if you're trying to prevent codeAddress() from being invoked twice then you'd have to add some kind of state to let the app know that it's been invoked already.
 
user5020521
I'm just curious buddy
 
user5020521
let's deal with a problem a time
 
user5020521
11:20 PM
shouldn't the onreadystatechange be undefined
 
user5020521
???
 
It's an event which fires only when the document is ready. So it should have a context to your outer function. I'm asking what the output of console.log(this) is to determine if you can actually call codeAddress from within that event handler because usually, event handlers are run asynchronously and usually go out of context.
let me back up..do you even see codeAddress being called ?
 
user5020521
yes I do
 
I see and is that the function that you're trying to prevent from being called twice?
 
user5020521
no it isn't
 
11:24 PM
@rlemon, hi! I haven`t seen you for ages :)
 
Oh..which function then?
 
user5020521
the function that i'm trying to prevent from being called multiple times is the caller of codeAddress
 
user5020521
that is loadScript
 
How is loadScript being called in your app?
 
user5020521
it is fired when save button is clicked
 
user5020521
11:26 PM
let me tell you the purpose of this browser app
 
user5020521
so you'll understand me better buddy
 
So, there's another event handler on onClick on your button that invokes loadScript?
 
Are there example how to setup server (nginx, Apache, node.js or any other) to process the links like "site.com/home" and load the corresponding angular page "site.com/#/home"?
 
user5020521
no there isn't plus the ajax request either to add or to edit or to delete a record is called at the end of the display function
 
user5020521
display function convert a street address into google maps coords
 
user5020521
11:29 PM
and the purpose of my browser app is to automatically convert street addresses into google maps coords
 
user5020521
that's why I can't find a way to prevent the api script from being loaded twice
 
Right, but you just said that loadScript is invoked when save button is clicked which means there has to be some kind of event handler attached to onClick event somewhere in your app.
 
user5020521
let me give you an example
 
user5020521
if you click save loadScript is executed
 
user5020521
if the script is loaded codeAddress is executed
 
user5020521
11:31 PM
if codeAddress succeeds ajax request is executed
 
user5020521
and both codeAddress and ajax request function are called inside other functions
 
Right, I think I get the workflow. For shits and giggles, just put a global variable called state and set it to true after codeAddress() is called. Put an if(!state) around all the code inside loadScript. That way it'll know that it's already been clicked.
 
user5020521
codeAddress caller is loadScript while the caller of ajax function is display function that is the callee of codeAddress
 
user5020521
let me get at what you mean
 
user5020521
I need a global var called state
 
user5020521
11:35 PM
set to true
 
user5020521
then I wrap up the loadScript function within an if statement
 
Wrap the content inside loadScript not the function itself.
 
user5020521
would you be so kind to provide me a fiddle buddy?
 
user5020521
on the basis of the code I sent you above
 
1 message moved to Trash can
@shriek Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
user5020521
11:37 PM
well let me tell you one thing
 
function loadScript(){
  if(!state){
    //..your code
  }
}
@CapricaSix: didn't knew about that. Thanks.
 
user5020521
if a user needs to modify the just created record he will click save again
 
user5020521
what I mean is this
 
user5020521
if I change the street address when the script has already been loaded how can I get to convert the new street address into lat and lon if the script is not reloaded
 
user5020521
???
 
user5020521
11:40 PM
have I been clear?
 
Is that a follow up question or question relating to your earlier one?
 
user5020521
it is related to my earlier one
 
user5020521
aggiungi(add) modifica(edit) cancella(delete)
 
It will load once. But after it's invoked it won't load again unless you change the state variable to false again.
 
user5020521
if you need to create more than one record how can you make the conversion without reloading the scritp?
 
11:56 PM
@Riccardo990 did you just share your IP with us ?
 

« first day (2010 days earlier)      last day (2953 days later) »