B
B
boberskyibohdan2017-07-20 11:08:43
JavaScript
boberskyibohdan, 2017-07-20 11:08:43

How to make a click on an element after going to a subpage?

There is an index page, it has a "Cart" button ( link to the page ). When you click on it, you need to go to the page with OpenCart ( link ) and click on the cart to open it.

if(window.location == 'http://fitkevich-food.freedomain.thehost.com.ua/sportpeet.html') {
  $('.cart').click(function() {
    window.location.href = "http://fitkevich-food.freedomain.thehost.com.ua/magazin";
    $('.cart-r--btm a').click();
  })
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Zakharov, 2017-07-20
@cashalot

Clicks in jquery are not able to do on the link itself. To do this, you need to push some span into the link and click on it already. For example, asdsad .
And the code is this: Then this click will be counted and you will be happy)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question