Moniz: Usman: Start by giving me a single getXByY that cannot be replaced by QS?QSA Event on IE8
Usman: Have a nice friend chicken breast
Rubalcave: Fyi, if youre making some virtual scroll thing, or doing hacky stuff with scroll + height, pointer-events: none is your friend
Burnash: I would like to know how to asynchronously load JS and PHP but hold the output until both the JS and PHP have finished loading
Azim: What do you mean hold the output?
Trucchi: What do you mean load the PHP
Trucchi: PHP doesn’t load, it renders into html/js/browser-consumable things, which then load
Trucchi: I know it sounds like I’m being pedantic but it’s an important distinction – the browser doesn’t care if you’re using php or not
Arrance: I mean not display the output of the JS and PHP until both scripts have finished loading
Hynds: Trucchi: I have a PHP script that takes a while to CURL something, which is what I mean by loading
Jeffress: Xamphyx: they run in different places at different times
Trucchi: Xamphyx: okay. next question: how are you retrieving the PHP that does the curl? Are you using AJAX, or is it a page that you’re going to?
Amis: Trucchi: Yes, I intend on using AJAX, so that both the JS and PHP can work simultaneously
Pesavento: The JS will be getting doing a JSON-P request, the PHP will be doing CURL
Bumpas: They won’t be finished at the same time, so I fear the page will look messed up until everything is done loading
Trucchi: Okay. So you have. I ***ume some sort of JS code, and you want it to be trigger by the completion of your AJAX request to the server – which is what does the php curl?
Trucchi: Okay, that’s where I’m confused. what do you mean by “the page loading?” is there, like, some HTML you don’t want to show up until you’ve performed the AJAX request?
Trucchi: So, the typical way you handle that is with CSS that hides the content that’s useless without the data you’re retrieving – it might optionally show some kinda loading screen, you can play with that to whatever fanciness you want
Trucchi: And then when you launch the AJAX request, it processes the data, renders the content, and transitions the CSS cl***es so the content appears
Trucchi: Xamphyx: Do you already know what you want to use for your AJAX request? I have a suggestion, but if you’ve already got jquery on your page you can also just use that
Kotlowski: Yes, I will be using jquery
Trucchi: Ok. So, I never use jquery for ajax so I don’t know the API off the top of my head, but it supports callbacks and jquery’s inferior, but serviceable promise implementation, both of which should work
Trucchi: But what you want to do is write a function that 1 processes the results of the request and 2 another function that unhides the page by changing your CSS cl***.
Dumes: I have the jquery ajax json-p code already written, I am just wondering about how I will have multiple php curl requests show up at the same time as the json-p
Trucchi: Well, PHP curl requests means your server is getting content from another server
Harang: It’s not instant in my case
Trucchi: Right. so there is no “show up the same time”
Trucchi: Browser asks php for data — php makes curl request — php gets data, turns it into json — php responds to browser with requested data
Trucchi: Then you can use the $.ajaxwhatever.thenprocessContent.thenunhidePageElements, handleErrors or-what-have-you
Trucchi: The browser doesn’t know or care that a CURL request is happening – all the browser knows is it’s asking for data, and it gets the data
Soberanis: Hmm, let me review this code for a minute
Zarek: Thanks for your help so far
Ackies: Hello, i was looking for justification or explanation, if any, to only allow yields in the generator body
Norrod: I need help with basic js, its on an angularJS