JavaScript içinde geçerli URL almak? | Netgez.com
SORU
2 Ocak 2009, Cuma


JavaScript içinde geçerli URL almak?

JQuery kullanıyorum. Nasıl geçerli URL yolunu bulurum ve bir değişkene atamak?

Örnek URL:

http://localhost/menuname.de?foo=bar&number=0

CEVAP
2 Ocak 2009, Cuma


Yol almak için kullanabilirsiniz:

var pathname = window.location.pathname; // Returns path only
var url      = window.location.href;     // Returns full URL

Bunu PaylaÅŸ:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Phlearn Photoshop and Photography Tutorials

    Phlearn Phot

    11 EKİM 2011
  • Rozetked | Обзоры

    Rozetked | Ð

    5 AÄžUSTOS 2011
  • Sergio Fernandez

    Sergio Ferna

    1 EKİM 2009