When you hover over a hyperlink you see in the corner of your browser the url you're gonig to. I'm using javascript to navigate through my tabs div. When I hover over the tab I see the url. I would like to hide this. Is this possible?
Link to example
Don't do it! Clients like to see where links are going. This behavior isn't up to you.
The only thing you could reasonably do is set the link to go to nowhere, and set the onclick attribute with sourcecode that does a window.location.
If you don't use the "href" attribute, the link won't show up.
Simply do this:
<a id="tab1">Tab 1</a>
$('#tab1').click(function(event) {
switchTabs();
});
This will register a click event (using jQuery) on the link without displaying any URL to the user. This is the proper way for handling links that don't redirect the user.
Hide Text
Then in that function you can have a switch case statement which uses window.location to send the user to another page.
Downsides to this include alienating your users which disable Javascript, and search engines probably won't follow this link.
Related
Is there a way to get the link of a button click in a website?
This is the Website
https://onlineradiofm.in/stations/mirchi and there is a play button. I want the link to the play button click so that everytime i open the link, the audio starts playing automatically.
Is there a way to achieve this?
Any help is appreciated
Add jquery code in the page where you want to click the button on page load.
<script>
$(document).ready(function()
{
$("#button-id").trigger("click");
})
</script>
Replace button-id with your button id.
There is no link in the play button, it's a click event. The solution to your problem may differ a lot depending if you own the site you are trying to redirect to the audio or not. In case that the website is owned by you, then you could just create the link you are asking for playing with query string parameters to execute a Js script that clicks the button (like the one proposed by #Pranay kumar 's answer). If you don't own the specified website, then its much harder. In this second case, you could make a python script that clicks the button. An example that may guide you to this solution can be found here. This should work in your case, but the solution would not be a link, it would be a script.
Need to click a link in other site.
<a href='https://www.google.co.in/search?client=ubuntu&channel=fs&q=apple&ie=utf-8&oe=utf-8&gfe_rd=cr&ei=ZV-9WJLODa2l8weF86joBg'/>
Above anchor tag will open the google search.
But i want to open the first search result automatically.
Is there any way to inject the Jquery(to open first search automatically) while user clicking the link
No, that's not possible, and that's a good thing. Just think about the security implications if this were actually possible: anyone could remote control your browser to click on any link they want.
On medium.com they have a clickable link on an h3 element, however the browser seems to know the URL that it will take you to and shows it in the bottom left side of the screen.
When I inspect element I see that this link is only an h3 element. It has a name attribute, an id and a class on it. There is no element and there is no href.
I assume that they listen to the click event of this element and then redirect the user to the correct page, but what I don't understand is how google chrome knows that this is a link and even shows the url it will take you to.
Is this something the browser now supports? Is there a specific way of forcing the browser to show it?
Yes, there is a <a> element, just further up the line:
This would have been visible in your screenshot too, in the selector bar at the bottom:
(Link to the page, if anyone is interested.)
Yep, it can be done through a simple listener, eg in jQuery:
<h3 id="link1">Link1</h3>
And the codebehind:
$("#link1").click(function () {
window.location.href = "http://www.google.com";
});
Should work in any modern browser, but I'd say they'd all interpret it differently. I'm not sure we really need to know why it works, just that it does - you could get in to asking how anything works in a browser. Presumably they quickly parse all of the code as it is loaded so they know all of the possible events. Something like this might help.
But if not Siguza finde <a href>. I think chrom count dependecis and show redirect page or function. Status bar you can just turn off or on. Or change by "wrong" redirect like can you show "Im the best" take
test
show : localhost34567/Im the Best! ---> ok not perfect :D but you can play with it and have better results.
https://superuser.com/questions/239202/turn-off-the-link-hover-statusbar-in-google-chrome
I use skeleton framework to sketch tabs inside IFRAME widget. Each tab has code like this:
<a class="active" href="#skeletonTab0" target="_top">Name of tab</a>
href pointed to #.... is required for the menu to work.
When user right clicks on this tab and selects "copy URL" he gets the URL of the widget host http://dummyhost.com/index.php#skeletonTab0.
But because the widget is embedded on site http://importantnews.com i would like him to copy URL to:
http://importantnews.com/index.php?showTab=0
Is there any way to make it so that a will have href pointed to #skeletonTab0 but when user tries to copy the URL he will get proper URL on important news?
Basically the question is if i can provide user trying to copy URL from a href other href than actual href?
EDIT: Today, i've found a working example of something similar to what i try to obtain, but still figure out how to make this work for me.
Look at this site:
https://plus.google.com/100784670873737717716/posts/PAEa7sFcKMS
When you click "What i learned" it redirects you to http://www.readwriteweb.com.
When you copy the URL of this link you get http://www.readwriteweb.com.
But when you click the link plus.url.google.com* redirecting to http://www.readwriteweb
Have you any ideas?
Not really, no. What you could do is have the link point to http://importantnews.com/index.php?showTab=0 but register an onclick listener so that when the link is clicked, the default action (i.e. going to that link) is cancelled and replaced by your desired action.
I have a pretty simple problem which I have not been able to fix myself (I am having trouble manipulating iframes).
Basically, go to say this page....
http://andrew.koallo.ca/new/393NelsonSt-JordanFisher
click on "Click here to Map"...and a map should load up for you....now if you his back once...it will only take back the iframe....so basically you have to hit the back button twice to return to your original page.
Is it possible to avoid this?...Upon clicking the "Click here to Map" button I set the src of the iframe equal to the respective source....
I was reading that perhaps location.replace can help? have no been able to get it working.
Thanks for any help,
Andrew
the page you mentioned is offline atm, but you need to set the url for the iframe like this:
$('#myIframe').get(0).contentWindow.location.replace('http://...');
so the url won't make it into the browsers history.
Either put a "back" button in the page with an onclick event to the referrer or change the iframe's code to only use Ajax calls.