如何在HTML HREF中组合锚标记和传递的变量? [英] How do I combine an anchor tag AND a passed variable in an HTML HREF?

查看:138
本文介绍了如何在HTML HREF中组合锚标记和传递的变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 < A NAME =blah> 

在我目前所在的页面上,我想要在那个不同的页面上定位还传递一个GET参数,例如:

 < A HREF =otherpage.htm#blah?data = 1234>好东西!< / A> 

这似乎不适合我。它加载页面并传递变量但不会转到锚点。我已经在锚标记上搜索了一些示例,并且有很多示例,但是没有人会谈到在页面中跳转到锚点,同时还会在URL中传递参数。

$

 < A HREF =otherpage.htm>解决方案

书签始终放在最后。 ?data = 1234#blah>好东西!< / A>


Say I have an anchor somewhere on a different page:

<A NAME="blah">

On the page I'm currently on, I want to go that that anchor on that different page while also passing a GET parameter, such as, for example:

<A HREF="otherpage.htm#blah?data=1234">Good Stuff!</A>

This doesn't seem to be working for me. It loads the page and passes the variable but doesn't go to the anchor. I've searched for examples on the anchor tag, and there's tons of them, but nobody talks about jumping to an anchor in a page while also passing parameters in the URL.

解决方案

The bookmark always goes last.

<A HREF="otherpage.htm?data=1234#blah">Good Stuff!</A>

这篇关于如何在HTML HREF中组合锚标记和传递的变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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