Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> How to manually dispatch hashchange event (w środku PL)
grasnal
post 23.02.2013, 21:34:27
Post #1





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 2.07.2009

Ostrzeżenie: (0%)
-----


Hej!

Przeklejam ze StackOverflow bo nie doczekałem się tam odpowiedzi. Może tu jakaś dobra dusza mnie pokieruje. Z góry dzięki.

---------


1 - What is correct syntax for WebKit (primary for Safari on iPad, good if it works on Win Chrome) to .addEventListener to hashChange event?

2 - Is is possible (and how) to manually/programmatically dispatch hashChange event by .dispatchEvent on browsers mentioned above?

TIA.

I've found answer for 1:

window.addEventListener("hashchange", function() {console.log(location.hash)});

But I still have no idea how to dispatch hashchange manual since I don't know what EVENTOBJECT I should pass to window.dispatchEvent(EVENTOBJECT).
Go to the top of the page
+Quote Post
lukasz1985
post 24.02.2013, 00:29:27
Post #2





Grupa: Zarejestrowani
Postów: 205
Pomógł: 43
Dołączył: 5.03.2012

Ostrzeżenie: (0%)
-----


window.dispatchEvent(new HashChangeEvent("hashchange"))

https://developer.mozilla.org/en-US/docs/DO...hashchange#dasf

http://www.whatwg.org/specs/web-apps/curre...vent-hashchange
Go to the top of the page
+Quote Post
grasnal
post 24.02.2013, 12:51:21
Post #3





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 2.07.2009

Ostrzeżenie: (0%)
-----


Podziękował. EOT.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 21.05.2025 - 12:09