ziedinjsh Posted July 7, 2016 Report 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š
jurchiks Posted July 7, 2016 Report Posted July 7, 2016 (edited) pages[section].url... Edited July 7, 2016 by jurchiks
Recommended Posts