anonīms Posted July 13, 2011 Report Share 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 Link to comment Share on other sites More sharing options...
0 Kaklz Posted July 13, 2011 Report Share 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 Link to comment Share on other sites More sharing options...
0 indoom Posted July 14, 2011 Report Share Posted July 14, 2011 www_url.split('/').slice(-2); būs divi pēdējie Quote Link to comment Share on other sites More sharing options...
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īmsLink to comment
Share on other sites
2 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.