I have a web-page which results from the adding of sidebars to an original pop-up. The pop-up had an external link and the one of the sidebars has an identical external link. Both are redirected via an internal file.
I do not want two identical links in the same page, and decided to use an anchor to connect the two. I have two scripts but unfortunately none is perfect. The one above does not work with Safari; while the other, below, creates a dark veil in some of the browsers. The reason for this is that at the end of the external url it adds #anchor.
I am looking for a way to remeove that “#anchor” from the end of the url. The script that does not work with Safari does not append anything to the end, so I assume that a solution can be found.
<a href="javascript:void(0);" onclick="_Link('anchor')"><an image</a>
and below
<a id="anchor" href=/request/index.php?id=CrowneCoogee/" target="_blank">
function _Link($a) {
if(!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/)) {
document.getElementById($a).click();
} else {
var $e = document.createEvent('MouseEvents');
$e.initMouseEvent('click', true, true, window);
document.getElementById($a).dispatchEvent($e);
}
}
I am looking for a way to remeove that “#anchor” from the end of the url. The script that does not work with Safari does not append anything to the end, so I assume that a solution can be found.
Unfortunately, with so many changes trying one thing and the other, I’ve mixed the code… and with this last code I am getting the home page, which means that it is not addressing the correct url in the intermediary file
You have 2 Crowne Plaza logos. Both should take you to their website. From the right sidebar, vua the bottom sidebar anchor and then via the internal redirects.
My first problem is that I mixed up the code and now instead of gettong the right url, it is picking up the default which is my index page.
Once we get that working again, then the main problem is to make sure the url of the hotel goes without anything added to it.
Anyway, that’s what I want to do, if you can help. The basic code is already there but as my knowledge of js is NIl, if you can help put the last code together, I would be grateful.
Sure I can help, but I need to comprehend what you are trying to achieve.
To summarize: you have two images (the Crowne Plaza Logos). These images should both link to the same page (the Crowne homepage), but you don’t want to write:
<a href="www.linktothecrownehomepage.com">
<img src="/Pinto/Logos/CrowneLogo.jpg" width="130" height="130" title="Crowne Plaza website">
</a>
The logo on the left should rely on an anchor to the one in the middle (or vice versa). The actual link is in a redirects.txt file that keeps hundreds of urls