anonīms Posted July 13, 2011 Report Posted July 13, 2011 (edited) var www_url = window.location.href; www_url = www_url.split('/'); ir kkā iespējams izmantot nevis www_url[1],[2], etc, bet gan pēdējo un pirmspēdējo atribūtu? jo pirms tam tie sleshi nav ar noteiktu skaitu. Edited July 13, 2011 by anonīms Quote
0 Kaklz Posted July 13, 2011 Report Posted July 13, 2011 http://www.w3schools.com/jsref/jsref_pop.asp divas reizes un dabūsi pēdējo un priekšpēdējo elementu. Quote
0 indoom Posted July 14, 2011 Report Posted July 14, 2011 www_url.split('/').slice(-2); būs divi pēdējie Quote
Question
anonīms
ir kkā iespējams izmantot nevis www_url[1],[2], etc, bet gan pēdējo un pirmspēdējo atribūtu? jo pirms tam tie sleshi nav ar noteiktu skaitu.
Edited by anonīms2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.