Ich bin auf der Suche nach einer Möglichkeit Links in einem neuen Tab öffnen zu lassen.Beiträge hierzu sind mind. 2 Jahre alt,daher weiß ich nicht,ob die in der 3.2 überhaupt noch funzen,oder würde der folgende Code noch funktionieren :
Code: Alles auswählen
<script type="text/javascript">
// <![CDATA[
function loadjQuery(url, success) {
var script = document.createElement('script');
script.src = url;
var head = document.getElementsByTagName('head')[0],
done = false;
head.appendChild(script);
script.onload = script.onreadystatechange = function()
{
if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete'))
{
done = true;
success();
script.onload = script.onreadystatechange = null;
head.removeChild(script);
}
};
}
if (typeof jQuery == 'undefined') {
loadjQuery('http://code.jquery.com/jquery.min.js', function()
{
$(document).ready(function() {
$("a[href^=http]").each(function(){
if(this.href.indexOf(location.hostname) == -1) {
$(this).attr({ onclick : "window.open(this.href);return false;", rel : "nofollow" });
}
})
});
});
} else {
$(document).ready(function() {
$("a[href^=http]").each(function(){
if(this.href.indexOf(location.hostname) == -1) {
$(this).attr({ onclick : "window.open(this.href);return false;", rel : "nofollow" });
}
})
});
}
// ]]>
</script>
thx vorab
Greets
Lordikon30