Use jQuery to navigate away from page

后端 未结 3 593
青春惊慌失措
青春惊慌失措 2021-02-01 01:53

I will only have a relative link available to me but I want to use jQuery to navigate to this rel link. I only see AJAX functionality in jQuery. How can I do this using jQuery

3条回答
  •  情歌与酒
    2021-02-01 02:27

    Other answers rightly point out that there is no need to use jQuery in order to navigate to another URL; that's why there's no jQuery function which does so!

    If you're asking how to click a link via jQuery then assuming you have markup which looks like:

    Click Me!
    

    You could click() it by executing:

    $('#my-link').click();
    

提交回复
热议问题