In the end, the problem is the lack of a safe/proper/easy method to output data from snippets. A console.log expansion would go a long way in reducing the use of document.write. — Cerbrus2 mins ago
Hi is it okay to put jquery document ready inside the function init() ?
function init(){
some javascript codes here
some variables initialize
$(funcion(){
//some jquery onclick handler
});
}
<body onload="init()">
It would work, of course, but what you're doing is the equivalent of assigning a click handler and triggering it, then promptly removing the handler in order to call a function
My favorite trick at a Halloween party is to tape a bunch of cigarettes to me. When someone asks what I am supposed to be, I pull one off. A cigarette lighter
@jemz I'm not sure if this is the correct approach to the 'show loading while the page loads', but I have done this in the past jsfiddle.net/rlemon/t0kearoc
@KendallFrey lol no I'm serious. I was a panda in DC one year... and literally every woman at the bar that was a panda wanted to dance. Then I was a dog... Don't be a domesticated animal. People get drunk and try to give you commands
However, they will feed you and pet you... so there's that
Sometimes you want to combine these syntaxes, most often when importing something that uses the commonjs syntax. Some cases were already discussed for example here:
How to correctly use ES6 "export default" with CommonJS "require"?
but there surely are more situations that can occur!
So I was a dog last year for halloween. Went to Pittsburgh to see my buddy, and we all went out. Me, my brother, Mr. T, his buddy Adam, and Phil. Fucking unemployed, alcoholic Phil.
We go out, we get sloshed. This woman in a very skimpy army costume comes and sits on my lap, "I'm a slutty army girl!" (Yes, yes you are) and wants to take pictures with me.
so, after I finished what I had to do (and a bit more. I got paid more, not complaining), I asked my boss what's next. His response basically translates to: "Find something that looks fun/too-horrible-to-ignore and do something about it"
I love this :D
the time spent thinking about what to do is also accounted for
@ssube I have one last question before I dig into this a bit more. Javascript is not my skillset, so please forgive the potential noobness here. In the constructor, it's expecting an iterable (I assume this should be an array?) and a factory. What is the factory? I'm attempting to make a dictionary like object where each key has a list of values so it'd look like this (stole from a python sample)
btw, this is the last thing I made for him: towc.eu/prototype/eoxplore/inundo I really need to rethink a lot of things. Haven't shared it with anyone yet, wanted to see how good of a design job could I do. Answer is "not very much"
> Not the best start to a marriage! The tyre-fitter and his bride at the wheel of the £240,000 Ferrari they rented for their wedding day then CRASHED - after his foot slipped on the accelerator sauce
@KevinB he used the accelerator unintentionally. Probably he want to use the brake pedal. Not sure. It can be that he want to show off but that it went wrong
@KarelG "let me start this wonderful marriage by doing something potentially dangerous and would cost us thousands of debt should anything go wrong. What's the worst thing that could happen? "