B
B
by_roXe2016-03-01 19:58:51
JavaScript
by_roXe, 2016-03-01 19:58:51

How difficult is it to install the History API on a ready-made wordpress theme?

There is a theme for wordpress written from scratch, there was a need to implement a player on the site that will play when surfing the site (like VKontakte), after studying the question, I realized that this is the History API technology, how difficult is it to implement it into the finished layout? or for it initially it was necessary to plan the architecture of the site?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
IceJOKER, 2016-03-01
@IceJOKER

Depends on the site, if not a cumbersome site, then a few lines of JS code will do the trick.
Hang a listener on each link on the site, when clicked, prevent the transition e.preventDefault();| return false;
Next, you use the History API, follow the link using ajax, take the necessary data and replace it.
If you need to send a form, then too - by looking at post / get you send the desired request.
In fact, there is nothing complicated, I once did it myself (the architecture was also not initially thought out, I just took it and implemented it into the finished project)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question