Welcome to www.HAS.lv - programmējam HTML.

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Sign in to follow this  
Followers 0
linards1000

js dalit ar value no api

Hey, kāds varētu uzmest aci - 

links

Pašā javascript koda lejā ir divas vērtības kuras dala ar 17000, bet vajadzētu to 17000 aizvietot ar:

   
$tick = file_get_contents('https://api');
$url = $tick;
//$json = file_get_contents($url);
$data = json_decode($tick, TRUE);
$eur = $data[0]["price_eur"]; 

šo $eur

kā to labāk izdarīt , mēģināju visādi, bet slidojot to range slideri, vērtība nemainījas....

 

Liels Paldies jau iepriekš!

Edited by linards1000
0

Share this post


Link to post
Share on other sites
46 minutes ago, linards1000 said:

Hey, kāds varētu uzmest aci - 

https://jsfiddle.net/qh0vr6yj/

Pašā javascript koda lejā ir divas vērtības kuras dala ar 17000, bet vajadzētu to 17000 aizvietot ar:

   
$tick = file_get_contents('https://api.coinmarketcap.com/v1/ticker/bitcoin/?convert=EUR');
$url = $tick;
//$json = file_get_contents($url);
$data = json_decode($tick, TRUE);
$eur = $data[0]["price_eur"]; 

šo $eur

kā to labāk izdarīt , mēģināju visādi, bet slidojot to range slideri, vērtība nemainījas....

 

Liels Paldies jau iepriekš!

Cik noprotu, jsfiddle neatbalsta php, bet tavā kodā ir redzams php. Vari mēģināt iegūt to JSON ar XMLHttpRequest.

0

Share this post


Link to post
Share on other sites

Json rezultātu pamet zem kāda hidden input, izvelc value un darbojies.

Edited by bravo
1

Share this post


Link to post
Share on other sites

Paņem izsauc funkciju a, tad b, un beigais c, kurai padod b un d. :trollface:

Edited by GuskiS
0

Share this post


Link to post
Share on other sites
7 hours ago, bravo said:

Json rezultātu pamet zem kāda hidden input, izvelc value un darbojies.

plds šancē

Edited by linards1000
0

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0