History API - Part 2 (The Good Stuff)

  Рет қаралды 7,214

Steve Griffith - Prof3ssorSt3v3

Steve Griffith - Prof3ssorSt3v3

Күн бұрын

Пікірлер: 25
@mathewi2761
@mathewi2761 5 жыл бұрын
Steve Griffith his js videos are the best on youtube. Simple and solid explanations of modern js functionality
@stolensentience
@stolensentience 3 жыл бұрын
This channel deserves to blow up. Needs way more attention. Thanks Steve, incredible lessons.
@BrianHaferkamp
@BrianHaferkamp 4 жыл бұрын
Thanks for this explanation. I've been struggling with this for a while and this really got me over the hump to understand what's going on what is available to me through the API.
@TargetedIndividual
@TargetedIndividual 3 жыл бұрын
Hello. I have a question. If I have never set up postman or any other method to make api calls or http requests, how is it possible for them to be happening? Is there a way to trace the origin? Can I use the api to see all previous inquiries? I believe my network and devices are hacked and I'm wanting to figure out how to see everything that's been going on and trace it back to a person. I believe there are virtual machines hosted on my android device as well as my other devices secretly. I need to find out how to trace it back to an ip and that to a person. I've used the stream app on my iPad to see tons of http Requests happening In the background. Any help would be greatly appreciated. Thanks. Kevin Christian.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 жыл бұрын
Pretty much any app has the capability of making network requests. There are lots of tools like wireshark for monitoring or recording traffic on your network. Not really something that I could help you with, especially just in a video comment.
@andylib
@andylib 3 жыл бұрын
This was so helpful, thank you!
@tranpaul4550
@tranpaul4550 3 жыл бұрын
I have a question. You add event listener for the window in 2 events "popstate" and "hashchange", but when you click on the "a" tag, you change the url by using pushState. However, I am not seeing anything indicates that popState event handler being trigger (showing some text as coded in the ps, hc functions)
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 жыл бұрын
You can approach the problem in two ways - listen for the popstate or hashchange as triggers to do things OR listen for the clicks, intercept the click and then use pushState | replaceState
@tanburiadnanakyldz174
@tanburiadnanakyldz174 4 жыл бұрын
hello, can we use popstate method to call a new html page as a n one of the page of our web page ... like an ajax or jquery calling the html page or importing the html page .
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
popstate is the event that happens when a page loads / navigates through the history array. It's not a method that we can call to navigate. location.href = 'new url' will navigate, as will the history.go( ) or history.back( ) methods.
@kevinthomas3669
@kevinthomas3669 3 жыл бұрын
Thank You!!!!
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 жыл бұрын
I have a couple new videos on: popstate and hashchange events - kzbin.info/www/bejne/iqPSkq1pp6ytirs and pushState and replaceState methods - kzbin.info/www/bejne/oGK9eaivna10psk That you might find useful.
@kevinthomas3669
@kevinthomas3669 3 жыл бұрын
how would you control page refresh?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 жыл бұрын
listen for the popstate event.
@ryanford516
@ryanford516 5 ай бұрын
5:17 "But neither hashchange nor popstate fire when we call replaceState or pushState. If it did, you'd just get a circular loop that was constantly calling itself." I don't get it. How would a circular loop appear? In my understanding, if you called replaceState and it triggered popstate (if that were the way how JS works), this event would fire once and that's it because there'd be just a single active history entry change. I'm confused.
@AnilThakur-lx6ps
@AnilThakur-lx6ps 2 жыл бұрын
Thanks for posting this video can you please help me to understand can we get KZbin watched history in API in android ?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 2 жыл бұрын
That has nothing to do with the History API that I am talking about here. To find data based on the KZbin API - developers.google.com/youtube/v3/getting-started However, watched history is private information. You can't access other people's watch history.
@dangerzone-136
@dangerzone-136 4 жыл бұрын
Thanks for your grear video Dear, But I can not working browser back and forward button on my onepage multistep form..How can I do that Dear? Thanks!
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
You need to use pushState( ) to change the URL as the user steps through the form and then use the popstate event to intercept the back and forward button event.
@dangerzone-136
@dangerzone-136 4 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3Thanks for your kind response. Yes I have added pushState and the first step is working fine and second and rest of the does not work properly. could you please check them and tell me what's going wrong there?
@dangerzone-136
@dangerzone-136 4 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 Here are the code..step working but animation sometimes conflict each other: var state = {}; $(document).ready(function () { history.pushState({ step: 1, }, null, ""); function my_next1_2() { var pgrbar = 2 * 5.56; $('#step-1').css('display', 'none'); $('#step-2').css('display', 'block'); $('.progress-bar').width(pgrbar + '%'); $('#step-2').removeClass("slideInLeft").addClass("slideInRight"); $('html, body').animate({ scrollTop: $('.app-container').offset().top }, 100); } $('.next1_2').click(function () { my_next1_2(); history.pushState({ step: 2, }, null, ""); }); function my_next2_3() { var pgrbar = 3 * 5.56; $('#step-2').css('display', 'none'); $('#step-3').css('display', 'block'); $('.progress-bar').width(pgrbar + '%'); $('#step-3').removeClass("slideInLeft").addClass("slideInRight"); $('html, body').animate({ scrollTop: $('.app-container').offset().top }, 100); } $('.next2_3').click(function () { my_next2_3(); history.pushState({ step: 3, }, null, ""); }); function my_prev2_1() { var pgrbar = 1 * 5.56; $('#step-2').css('display', 'none'); $('#step-1').css('display', 'block'); $('.progress-bar').width(pgrbar + '%'); $('#step-1').removeClass("slideInRight").addClass("slideInLeft"); $('html, body').animate({ scrollTop: $('.app-container').offset().top }, 100); } $('.prev2_1').click(function () { my_prev2_1(); history.back(); }); function my_prev3_2() { var pgrbar = 2 * 5.56; $('#step-3').css('display', 'none'); $('#step-2').css('display', 'block'); $('.progress-bar').width(pgrbar + '%'); $('#step-2').removeClass("slideInRight").addClass("slideInLeft"); $('html, body').animate({ scrollTop: $('.app-container').offset().top }, 100); } $('.prev3_2').click(function () { my_prev3_2(); history.back(); }); window.onpopstate = function (event) { if (event.state.step === 1) { my_prev2_1(); } if (event.state.step === 2) { my_next1_2(); my_next3_2(); } if (event.state.step === 3) { my_next2_3(); } }; });
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
@@dangerzone-136 you have a mixture of jQuery and vanilla JS. Whenever you hand off parts of your code to another library then you are giving up control of what happens in what order.
@dangerzone-136
@dangerzone-136 4 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 So how should I do then?
@liveinhouse
@liveinhouse 6 жыл бұрын
Great, thanks i got it what i wont
Practical Navigation with popstate and hashchange events
26:04
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 7 М.
NodeLists versus HTMLCollections in the DOM
14:58
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 14 М.
Walking on LEGO Be Like... #shorts #mingweirocks
00:41
mingweirocks
Рет қаралды 6 МЛН
Family Love #funny #sigma
00:16
CRAZY GREAPA
Рет қаралды 46 МЛН
ТЫ В ДЕТСТВЕ КОГДА ВЫПАЛ ЗУБ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 3,5 МЛН
Wait… Maxim, did you just eat 8 BURGERS?!🍔😳| Free Fire Official
00:13
Garena Free Fire Global
Рет қаралды 9 МЛН
Capture DOM Changes with MutationObservers
11:45
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 13 М.
My Favorite State Manager Is...URLs?
6:29
Theo - t3․gg
Рет қаралды 72 М.
clientx vs pagex vs screenx vs offsetx
7:56
CodeMore
Рет қаралды 20
DHH discusses SQLite (and Stoicism)
54:00
Aaron Francis
Рет қаралды 98 М.
The history API is dead. Long live the navigation API | HTTP 203
17:52
Chrome for Developers
Рет қаралды 36 М.
How to understand almost anything - Markus Völter - DDD Europe
49:54
Domain-Driven Design Europe
Рет қаралды 1,6 М.
Exploring the History pushState and replaceState Methods
13:08
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 17 М.
Creating and Dispatching Custom JS Events
12:28
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 19 М.
Using the History API - JavaScript Tutorial
16:40
dcode
Рет қаралды 32 М.
Walking on LEGO Be Like... #shorts #mingweirocks
00:41
mingweirocks
Рет қаралды 6 МЛН