hi,
i have an ahref link within my page which when clicked will call a javascript function to switch css files. this works fine however i want the new page to appear in a new window. i have tried using the target="_blank" attribute but it doesnt seem to do anything.
I would even settle for being able to use the back button on the browser to return to the page with the CSS before it was switched. here is my javascript function:
// activeCSS: Set the active stylesheet
function activeCSS(title) {
var i, oneLink;
for (i = 0; (oneLink = document.getElementsByTagName("link")); i++) {
if (oneLink.getAttribute("title") && findWord("stylesheet", oneLink.getAttribute("rel"))) {
oneLink.disabled = true;
if (oneLink.getAttribute("title") == title) {
oneLink.disabled = false;
}
}
}
}
// findWord: Used to find a full word (needle) in a string (haystack)
function findWord(needle, haystack) {
return haystack.match(needle + "\\b");
}
and here is my html:
<a href="/infoglueDeliverWorking/about" class="PrintIconLink" onclick="activeCSS('print');
return false;">
the url is the same as the url you are at before the link was clicked so essentially just ahref="".
regards,
cajchris
i have an ahref link within my page which when clicked will call a javascript function to switch css files. this works fine however i want the new page to appear in a new window. i have tried using the target="_blank" attribute but it doesnt seem to do anything.
I would even settle for being able to use the back button on the browser to return to the page with the CSS before it was switched. here is my javascript function:
// activeCSS: Set the active stylesheet
function activeCSS(title) {
var i, oneLink;
for (i = 0; (oneLink = document.getElementsByTagName("link")); i++) {
if (oneLink.getAttribute("title") && findWord("stylesheet", oneLink.getAttribute("rel"))) {
oneLink.disabled = true;
if (oneLink.getAttribute("title") == title) {
oneLink.disabled = false;
}
}
}
}
// findWord: Used to find a full word (needle) in a string (haystack)
function findWord(needle, haystack) {
return haystack.match(needle + "\\b");
}
and here is my html:
<a href="/infoglueDeliverWorking/about" class="PrintIconLink" onclick="activeCSS('print');
return false;">
the url is the same as the url you are at before the link was clicked so essentially just ahref="".
regards,
cajchris