Marc2: GET-Variable einfügen

Beitrag lesen

Hallo,

ich habe einen Button erstellt. Diesen Button sollen Besucher in Ihre Seite einfügen können.

Dies soll so funktionieren:
<script type="text/javascript" src="http://localhost/wort/button.js?wort=Auto"></script>

Meine Frage ist nun ob es möglich ist, dass die "GET-Variable" (in diesem Fall Auto) in meinem Javascript Code an der Stelle EINFÜGEN (so hab ich es in meinem Code gekennzeichnet) eingefügt wird.

Die button.js hat folgenden Inhalt.

  
document.write('<style type="text/css">'+  
'.wort-link .active-link{'+  
'font:75%/1.5  Arial,Verdana, Helvetica, sans-serif;'+  
'color:#2a2a2c;'+  
'padding-left:15px !important;'+  
'text-decoration:none !important;'+  
'margin:0 10px !important;'+  
'height:30px !important;'+  
'float:left !important;'+  
'color:#2a2a2c !important;'+  
'font-weight:bold !important;'+  
'background:#eeeeee url(http://localhost.de/images/layout/active.gif) top left no-repeat !important;'+  
'font-size:1em !important;'+  
'border:none !important;'+  
'text-decoration:none;'+  
'}'+  
'.wort-link .active-link span{'+  
'text-decoration:none;'+  
'padding-right:15px !important;'+  
'display:block !important;'+  
'float:left !important;'+  
'height:26px !important;'+  
'padding-top:4px !important;'+  
'background:#eeeeee url(http://localhost.de/images/layout/active.gif) top right no-repeat !important;'+  
'}'+  
'.wort-link .active-link:visited{'+  
'color:#999999 !important;'+  
'}'+  
'.wort-link .active-link:hover{'+  
'cursor:pointer !important;'+  
'background-position:0 -30px !important;'+  
'color:#fff !important;'+  
'}'+  
'.wort-link .active-link:hover span{'+  
'cursor:pointer !important;'+  
'background-position:100% -30px !important;'+  
'}'+  
'.tbwp-link{'+  
'font-size:11px; !important;'+  
'text-decoration:none; !important;'+  
'border-bottom:1px solid #fff; !important;'+  
'}'+  
'.tbwp-link:hover{'+  
'border-bottom:none; !important;'+  
'}'+  
'.wort-clear{'+  
'clear:both !important;'+  
'}</style>');  
document.write('<div class="wort-link" id="wort-word">');  
document.write('<p><a href="http://localhost.de/search?word=EINFÜGEN" class="active-link"><span>EINFÜGEN</span></a></p><p class="wort-clear"></p>')  
document.write('</div>')

Das Problem ist, dass der Javascript Code in eine Seite eingefügt wird. Deshalb ist window.location.search wirkungslos.
Lässt sich das überhaupt umsetzen?