Prospects for the feed

What kind of garbage are you?

Tired!!!

“Do you call you humans boring? I’ve been opening this page for a few days, and I opened it again today! This web page!” The javascript boss patted his head and sighed: “Ah, this page javascript execution task, I really do not want to accept! If it goes on like this, my hair won’t be safe!”

“Ah! Forget it! I’m not the boss of the browser. Work, work!” The javascript boss picks up the javascript syntax interpreter on the side, interprets and executes the javascript text sent by the HTML parser.

Soon, the empty variable hall began to have a sound, the sound gradually became noisy, even came out of the noise!

The big screen in the executive lobby is filled with all kinds of information about the current executive lobby.

anxious

“Jingling ~ jingling ~ jingling ~” one side of the phone suddenly rang up, JS boss conveniently pressed the speaker.

“How slow it is! That was seconds ago! I’m still waiting to parse the HTML!” The anxious voice of an HTML parser came through the phone.

“Don’t interface ah, you are not unknown, this webpage opened a few days ago, inside the JS code that poor yo, there is a fixed time while loop, you say can fast where to go! There is a note on it, it says to add money to optimize the experience! What a black site.” Js boss picked up a side of the towel, wiped the sweat on his forehead, just from the circulation out of him, but also intermittent dizzy.

“Ok! There it is again. I thought you were losing your business.” The HTML parser exclaims.

“How can it be, this is not fast! That’s all right.”

“Ok, then you busy first! Hurry up! “and the HTML parser hung up the phone.

‘Oh, I’m dead tired! Said, JS boss stretched a stretch, the bones of the back snapped, “my old waist!”

Stretch out, JS boss put down the tools, picked up the phone, dialed the HTML parser phone, “I can, you continue.”

A short wait

After putting down the phone, Boss JS walked to the coffee machine, pressed the button and took a sip of a rich cappuccino to refresh himself.

“This webpage, can toss dead me! Ah ~ “said, JS boss put down the hands of coffee, toward the event hall walked.

“Do you have an event here?” Js elder brother asks to the younger brother in charge here.

‘Not yet! The younger brother looked into the event hall and said.

Js boss walked into the event hall, the whole hall is 1:2 rectangular, divided into two parts, left and right two squares each half, the square area on both sides of the middle are separated by railings, like the corridor in front of tourist attractions, winding, but only one queue. In the middle of the left square, there are three big words for macro task, and three big words for micro task on the right. The floor on the right, want to break many than the left obviously, as if had experienced many trample.

“Looks like the HTML parser is having a hard time, too! If this is the usual page, the event has come! There’s a long line here!”

“What webpage, I just see eldest brother you also stayed in front of work desk for a long time!”

“Ah…” See the incident has not come over, JS eldest brother and small chat up.

“Excuse me, is this the event hall?” While js boss and younger brother chatting, came to an event, head with a big DOMContentLoaded logo.

“Yes, come and register! Name, source.” As soon as I saw an event coming, I immediately returned to work.

“Hello, I’m DOMContentLoaded event, just sent over by the HTML parser”

“Ok, boss this is the first event, take it.”

“Well, talk to you later.”

“All right! Little brother mouth said, but the heart was thinking: “I am afraid there is no time, every time, in said, or this web page…” The younger brother seemed to think of the event hall crowded appearance, mentioned his state of mind.

“But just to this event, delicate, long drop is quite good ah! Which function is blessed ~ “the younger brother smiled.

The other half!

“Come, come with me.” Js boss says to the incoming event object.

“Well, where are we going? The event object wondered.

“The hall of Variables! Find your other half!” Js boss boss a face of excitement.

“Is there still an organizational allocation?” The object of the event gets strong, and a dimple appears on his smiling face.

“I don’t know. Let’s go to the Hall of Variables. !” As they spoke, they had reached the Hall of variables.

“Hey, everybody, quiet down, please, the other half of DOMContentLoaded next to me!” Js boss to the grandstand, into the microphone said.

“Me!!!!!!! Me!!!!!!! Me!” Variable hall in a corner, issued an excited cry, I saw that area in order to sit a lot of functions, they are not old area, also no longer new area, but a special space.

“Then come out and follow me!” Js boss put down the microphone, came up a handsome guy, a look at the eldest brother side of the event sister, eyes can not move, feet can not open.

“Look at you! Js boss patted the function on the shoulder, said: “go, go to me!”

perform

Speak between, three people come to js old executive hall.

“Lie down and let me awaken your true power!” The boss said to the incoming function.

“My real strength? The function asked doubtfully, lying on the workbench.

“Here we go! Said js boss pressed the button on the workbench, the workbench function eyes shot two ray of light, cast in the white screen on the workbench.

“This is the code you saved that needs to be executed. See for yourself?”

See workbench no sound, JS eldest brother row row own head: “forget, forget, you this can’t talk! Ha ha! Feel it for yourself.”

“DOMContentLoaded, come on, he needs your help with his implementation! Stay by my side and I’ll call you if I need you.”

“…” The object of the event is clearly frightened by what is happening in front of him.

“Hey, stop staring! Js boss waves in front of the event object.

“Oh, oh, boss you say.”

“Wait for your cooperation!”

“Oh, oh, okay. At your command.”

After ordering, JS boss picked up the tools on the workbench and began to execute the content on the white screen.

“Give me your Target attribute.” Js told DOMContentLoaded.

“Yeah, yeah, it’s the Document object. I’ll go down to the hall of Variables and call him over.”

‘Well, well, go!

.

After a while, JS put down his tools and breathed a sigh of relief. “How does DOMContentLoaded feel?”

“A little tired!

The boss pressed another button on the workbench. The function sat up and shouted, “Just now, my eyes are shining! Did you see that? Light up!”

.

“What’s the matter, you? Why don’t you speak?”

Js boss and the event object smiled at each other without speaking.

“Well, I’ve got something to do. Why don’t you go back to the Hall of Variables? I also need to go to the hall of Variables to clean out memory, let’s go.”

Micro tasks

After a while, js is in the event lobby, and the DOMContentLoaded event object and function are back in place.

Another round of naming variables began, a wave of cleaning finished, JS boss rushed to the event hall.

“Did that function execution create any microtasks?” Js elder brother asked the steward, while looking to the right side of the variable hall, found a lot of lines.

“So many!

“That’s right! Just as the steward said this, a peevish voice rang out: “How long will it take? I’ve been waiting a long time!”

“This is? Js elder brother asked the steward.

“Load event! I’m not in a good mood about the load event today. I don’t know why?” The younger brother whispered in the elder’s ear.

“Wait a minute, I need to execute the microtask queue.”

“Hurry up! I hear I’m not wanted again today? I have a bad temper!”

“Good good good, I grasp!” Eldest brother quickly got a small task to variable hall.

“Whose task is this? Claim it!”

“To me! Me!” I have another function in the function area.

“Let’s go! The boss leads the function to the execution hall again. After a while, I cleaned up the variables and walked to the event hall again.

And so on and so on, and the line on the right eventually gets shorter and shorter, until the microtask queue is completely empty.

Cross to jump over and over again

“Next event!” “Shouted Boss JS.

“Me!” There came the angry object of the incident, load on his head.

“Oh, wait a minute. I let you out. You’re out, you’re so angry!” The steward in the event hall ran out.

“Boss, it’s a temper tantrum, I…” The younger brother further explained.

“It’s all right, come with me!” Js boss on the Load event.

Soon, Js took Load to the variable hall and shouted, “The other half of Load, come out!”

The hall, quiet for a while, is bustling again.

“Didn’t you hear? My other half! Come out quickly!” The load function stands up and shouts again.

. Still no variable response.

“That you, stay here, I still have to pick up the next event!” Js boss said to Load.

“Ok, that I can want to see one by one, old niang fierce point how! Be afraid of nothing! One by one.”

“There really isn’t…” Js elder brother looked at this violent temper sister, also dare not say loudly, say that finish immediately ran to the event hall.

Since load does not have a corresponding function, no new microtasks are added to the right side of the event hall.

“Next!” Js eldest brother said to the steward of the event hall.

Soon, JS boss led the two functions, out of the event hall.

After a while, js boss cleaned the variable hall.

After a while, JS carried out the micro-tasks one by one, and the task queue on the right side of the event hall was cleared again.

“Next!” Js eldest brother said to the steward of the event hall.

.

The whole JS hall, I saw a busy figure in the event hall, executive hall, variable hall repeatedly between the horizontal jump, as if an infinite cycle of Mobius ring, never end, and JS boss incarnation of a ninja, high-speed running.

Reread machine

With the host off screen looking at the next page, the macro task queue in the event hall has no new event objects to enter, and js boss is idle.

Pick up the desk that cup has not been very hot coffee, JS boss drank a big mouth, looked at the screen before that person browsing the page, can not help but sigh: “look! Human nature is a repeater! It’s boring to open these same pages and do the same things every day, confined to the three o ‘clock routine.”

“Ah! But who isn’t a repeater?” Js eldest brother heaved a sigh and walked towards the event hall.

“Next!” Js eldest brother said to the steward of the event hall.

“No, boss!

“That I wait in you this, I narrow for a while, have incident to call me!”

“Hurrah!

reading

  • What kind of garbage are you?
  • Browser clutter