ziedinjsh Posted July 7, 2016 Report Share Posted July 7, 2016 Sveiki! jQuery kods $(function(){ var pages = { index: {url: 'home.php'}, section1: {url: 'section1.php'}, section2: {url: 'section2.php'}, section3: {url: 'section3.php'} } $('.menu li').on('click', function(){ var section = $(this).attr('id'); console.log(pages+section); }); }); console par parāda [object Object]session.session ir uzspiestais id. man interesē kā es varu iegūt url parametru no pages konrētam id piem. pages.section1.url??P.S. Paldies jau iepriekš Link to comment Share on other sites More sharing options...
jurchiks Posted July 7, 2016 Report Share Posted July 7, 2016 (edited) pages[section].url... Edited July 7, 2016 by jurchiks Link to comment Share on other sites More sharing options...
ziedinjsh Posted July 7, 2016 Author Report Share Posted July 7, 2016 Paldies! Link to comment Share on other sites More sharing options...
Recommended Posts