使用jQuery导航离开页面 [英] Use jQuery to navigate away from page

查看:91
本文介绍了使用jQuery导航离开页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只能使用相对链接,但我想使用jQuery导航到此rel链接。我只在jQuery中看到AJAX功能。我怎样才能使用jQuery或纯HTML / JavaScript?

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 or just pure HTML/JavaScript?

推荐答案

其他答案正确地指出没有必要使用jQuery导航到另一个URL;这就是为什么没有jQuery函数这样做的原因!

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!

如果你问如何通过jQuery点击一个链接,那么假设你有一个看起来像这样的标记:

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

<a id="my-link" href="/relative/path.html">Click Me!</a>

你可以 点击() 执行:

You could click() it by executing:

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

这篇关于使用jQuery导航离开页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆