As of my requirement, I have placed an anchor tag in an IFRAME. When I click on anchor link, the page redirects the page in the IFRAME. Here, my requirement is when user clicks on anchor tag, (Which is in IFRAME) the page redirects to the main url (Not in the IFRAME). How can I do this in PHP or in JavaScript. Can you please say some thing?
try <iframe> <a href="#" onclick='window.location.href="homepage.php"' >click here </a> </iframe>??.. this ones javasript..
You're looking for the <a target= attribute. Setting it to _top will change the url of the outermost frame, and setting it to _parent will change the url of the parent frame.
Related
I am trying to echo a URL with anchor tag on the backend page after the script is run which should take to that page and to that location of that page where anchor is placed.
After the form submission it takes to script page where at the end the code is:
echo "<meta http-equiv='refresh' content='0;url=finalpage.php#submitted' />";
I have place the anchor on finalpage.php which is way down to header and i want that it should directly take to that anchor:
<a name="submitted"></a>
The page do refresh taking to finalpage.php, but it takes to the header and not where the anchor tag is.
I tried with Location(header:..), die(...), but not working
Please help!
Have you tried setting the id attribute for the anchor, not the name?
<a id="submitted"></a>
The url hash component focuses on the element with its I'd on page load
I am currently working on home.php where I have the following anchor link echo'd:
<a href='#?id=$thought_id' class='toggle-comment' data-id='$thought_id' style='padding-left: 5px;'> Comments ($num_of_comments) </a>
Now, when I hover over the Comments anchor, I get the id of the thought fine. It's just that when I hover over the link, or when I click the link, the url reads:
http://localhost/home.php#?id=210
So, 210 is the ID of the thought the comments anchor is assigned to, which works. But I do not understand why the file name is appending to the anchor link when it hasn't been defined to do so.
Even when I put <a href='#'> The URL still reads http://localhost/home.php#
Your browser is going to show you the full, canonical URL (including the anchor) when you hover over a link. It's the same link that will be copied to your clipboard if you right-click it and choose "Copy Link Location".
I want to show a click-able image popup on my home page of my website.
when user clicks on that image further they can view the website.
Use anchor text around it...
<a href="<URL TO WHERE YOU WANT TO GO>" ><img src="<PATH TO IMAGE>" /></a>
The simplest solution is probably to use a third party extension like SplashR or similar:
http://extensions.joomla.org/extensions/style-a-design/popups-a-iframes/11693
Well, my website can not redirect to
https://www.facebook.com/QuaFootSpa
from
http://quafootspa.com/
I have tried redirection to facebook page through
a tag href attribute and also javascript function. but it redirects to middle page. kindly browse http://quafootspa.com/ and click on facebook icon on the top so it will redirect to middle page that says Go To Facebook.com
Clicking on the (Go to Facebook.com) will direct to https://www.facebook.com/QuaFootSpa
Try target='_top' in the href.
So it becomes
<a target='_top' href="https://www.facebook.com/QuaFootSpa/">
Right now the link is being opened in the lower frame and FB doesnt like it.
Try <a href='http://www.facebook.com/QuaFootSpa/' target='_blank'>Facebook Page</a>
your putted https:// instead of http://
Tested and works.
You are using frame and in frame self works in the frame so use target="_top"
<img src="images/qspa/fb_btn.png">
I have a webpage with some frames within each other in it. Last frame loads a website with many URLs. Some URLs have target="_top" and some have target="_blank". When I click to URL with target="_top" it breaks all frames on my parent page and load this URL, but when I click URL with target="_blank" it leaves my parent page as is (with frames) and opens this URL in a new window. Now the question: how to do that when URL with target="_blank" clicked, beside the opening URL in a new window it breaks all frames in my parent page and close it? Thanks
<a href="your/url" target="_blank" onclick="window.location.href = this.href;">
Does that work? I'm not sure I'm entirely understanding the situation. Or do you want to "close" the parent page, e.g.
<a href="your/url" target="_blank" onclick="window.close();">