Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> zmienna GET w JavaScript
php programmer
post
Post #1





Grupa: Zarejestrowani
Postów: 1 045
Pomógł: 5
Dołączył: 8.11.2004
Skąd: trójmiasto

Ostrzeżenie: (0%)
-----


Witam mam skrypt o adresie
www.stronka.pl/index.php?parametr1=wartosc1&parametr2=wartosc2

i teraz nie wiem jak pobrać wartość parametru,
w php bym miał po prostu
  1. <?php
  2. $_GET['parametr1']
  3. ?>


a w JavaScript questionmark.gifquestionmark.gifquestionmark.gifquestionmark.gifquestionmark.gif

Ten post edytował php programmer 22.08.2006, 09:50:27
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 4)
revyag
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 2 258
Pomógł: 16
Dołączył: 21.09.2004
Skąd: Kielce

Ostrzeżenie: (0%)
-----


http://www.dynamicdrive.com/forums/showthread.php?t=11883


--------------------
-------------

------
Go to the top of the page
+Quote Post
php programmer
post
Post #3





Grupa: Zarejestrowani
Postów: 1 045
Pomógł: 5
Dołączył: 8.11.2004
Skąd: trójmiasto

Ostrzeżenie: (0%)
-----


THX revyag. JavaScript chyba nie ma przed toba tajemnic!
Go to the top of the page
+Quote Post
nospor
post
Post #4





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Ale tu nie trzeba znac js, tylko google tongue.gif
http://www.google.com/search?hl=pl&cli...=Szukaj&lr=
http://www.11tmr.com/11tmr.nsf/d6plinks/MWHE-695L9Z
I mamy bardzo ciekawa funkcje:
Kod
function getURLParam(strParamName){
  var strReturn = "";
  var strHref = window.location.href;
  if ( strHref.indexOf("?") > -1 ){
    var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
    var aQueryString = strQueryString.split("&");
    for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
      if (
aQueryString[iParam].indexOf(strParamName + "=") > -1 ){
        var aParam = aQueryString[iParam].split("=");
        strReturn = aParam[1];
        break;
      }
    }
  }
  return strReturn;
}


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
php programmer
post
Post #5





Grupa: Zarejestrowani
Postów: 1 045
Pomógł: 5
Dołączył: 8.11.2004
Skąd: trójmiasto

Ostrzeżenie: (0%)
-----


Dzięki,
no właśnie w google szukałem
"get JavaScript" ale nic nie mogłem znaleźć
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 10:31