javascript - how to create a dynamic page on django project? -
i have been building django app creating static pages without ajax requests. build dynamic subpage change content without page refresh/reload. try outline trying accomplish , hope can point me right direction.
page:
basicly suggest stock replacement users. page suggests sell stock symbol srce , buy symbol xom. in table add data, dividend yield, payout ratio, ...
want implement is, clicking on "i don't want sell srce", want replace stock srce stock sell list. clicking "i don't want buy xom" want replace xom stock in buy list.
create new urls , pages that, because want change data in table , symbol name (also graph data, i'll deal later) think easier if page not reload. stock , data replaced dynamically through js/jquery?
sorry long post, here comes question. how do that?
thought angular.js way go, after watching few videos think complex such easy task. should use raw ajax/jquery?
guess data both sell , buy list should in json format. how make json data shown in page , replaced dynamically?
yes javascript u need it. don't need js-library jquery makes things way easier.
you can avoid using ajax loading stock data while page loading , write e.g. javascript-array. replace data in table using loaded data array when button clicked. maybe makes page load slow @ start guarantees fast interaction after has finfished loading. using ajax (accessing pythong script loads single data data base , responds browser) maybe cause longer loading time when changing stock proposal in case user clicks "i dont want buy"-button.
for how parse json-data can e.g. read article: parse json in javascript?
Comments
Post a Comment