Þetta er kannski ekki svar við nákvæmlega því sem þú spurðir um en vonandi einhverstaða í grendinni samt.
<HTML>
<HEAD>
<TITLE> </TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!–
url_Takn1 = UrlGildi("TaknNr1");
url_Takn2 = UrlGildi("TaknNr2");
function UrlGildi(Hrefvalue)
// Fall sem nær í gildi URLs og nær í þær breytur sem þarf
{
var Default = "";
var url = location.href.indexOf(Hrefvalue);
if (url > "") {
var takn = location.href.indexOf("&",url);
if (takn > 0) {
return location.href.substring(url+Hrefvalue.length+1,takn);
}
}
else
return Default;
} // Enda GetUrlVariables
if (url_Takn1 > ""){
alert('TaknNr1 = ‘+url_Takn1);
}
if (url_Takn2 > ""){
alert(’TaknNr2 = ‘+url_Takn2);
}
function Prenta(Nr1, Nr2){
var Slod = ’
http://localhost/vedur/tester.htm' + ‘?TaknNr1=’+Nr+'&TaknNr2='+Nr2+'&';
//alert(Slod);
document.location = Slod;
}
//–>
</SCRIPT>
</HEAD>
<BODY>
<input type="button" value="1-a" onclick="javascript:Prenta('1', ‘a’);"><br>
<input type="button" value="2-b" onclick="javascript:Prenta('2', ‘b’);"><br>
<input type="button" value="3-c" onclick="javascript:Prenta('3', ‘c’);"><br>
<input type="button" value="4-d" onclick="javascript:Prenta('4', ‘d’);"><br>
<input type="button" value="5-e" onclick="javascript:Prenta('5', ‘e’);"><br>
<input type="button" value="6-f" onclick="javascript:Prenta('6', ‘f’);"><br>
<input type="button" value="7-g" onclick="javascript:Prenta('7', ‘g’);"><br>
<input type="button" value="8-h" onclick="javascript:Prenta('8', ‘h’);"><br>
<input type="button" value="9-i" onclick="javascript:Prenta('9', ‘i’);"><br>
<input type="button" value="10-j" onclick="javascript:Prenta('10', ‘j’);"><br>
</BODY>
</HTML>
Vona að þú getir notað þetta.