Dynamic URLs in HANA XS -
i'm trying implement simple product catalog using hana xs javascript. pages of catalog should rendered on server side.
how can handle "dynamic" urls based on data read hana database? example, http:///myapp/store/[product-slug]/ (products stored in hana database , have unique slugs).
you can create router function on application.
on 'http:///myapp/index.html', create javascript function called 'getslug'. function path url , split string based on '/', result be: [0] store [1] [product-slug]
create function router content. need have column in product table slug.
the router function receive array of slugs. on function need implement structure of app.
for example, every time fisrt item 'store', load html of products div.
this kind o single page application. every time load page, call function:
$(document).on('load', function(){ router(); )
Comments
Post a Comment