webForumDet fria alternativet
Logga in / Bli medlem

php-variabel i javascript?

JavaScript

2 svar · 134 visningar · startad av kittlos

Medlem sedan sep. 2002205 inlägg
Trådstart#1

Hur får jag följande funktion att omvandla variabel p till det den innehåller när jag använder den i länken?

function tabort(p)
{
var f = document.formular;
var agree=confirm("Är du säker på att du vill ta bort den här publiceringen?");
if (agree)
document.location.href = "tabort_publicering.php?pub_id='p'&bildid=<?= $id; ?>";

}
Medlem sedan dec. 20025 483 inlägg
#2
document.location.href = "tabort_publicering.php?pub_id="+p+"&bildid=<?= $id; ?>";

:)

Medlem sedan sep. 2002205 inlägg
#3

tack!

258 ms totalt · 4 externa anrop · v20260731065814-full.51f67c91
123 ms — deklarationer (db)
0 ms — hämta statistik (cache)
132 ms — hämta tråd, inlägg och bilagor (db)
122 ms — ändringar (db)