Merhaba arkadaşlar bir sayfadan json ile altın fiyatlarını çektim fakat veriler sayfa yenilendikçe yenileniyor, ben tüm sayfa için yenileme kodu koydum fakat buda tüm sayfayı etkiliyor, sadece json verisini yenilemek istersem nasıl yaparim,
birde fiyat yükseldikçe yeşil, düştükçe kırmızı olmasını nasıl sağlarım yardımcı olabilir misiniz?
json veri sayfa yenileme
6
●154
- 06-10-2020, 00:28:31Hocam JSON verisini backend ile değil JavaScript ile çekeceksiniz aynı zamanda timer koyup tekrar JavaScript ile çekeceksiniz.
Yükselip Düşmesi olayı ise son veri adında bir değişken oluşturun yeni gelen veri son veriden büyükse ona göre işlem yapın ardından yeni gelen veriyi son veriye setleyin - 06-10-2020, 00:31:03Üyeliği durduruldujs + jquery ile anlık yenileme yapabilirsiniz. İstediğiniz verinin yenilenmesini istiyorsanız js kullanmalısınız. Artı olarak setinterval ile her 1 saniyede yeni güncel veriyi sayfa yenilenmeden işlem yapmasını sağlayabilirsiniz.alakara adlı üyeden alıntı: mesajı görüntüle
- 06-10-2020, 14:59:47Merhabalar;
Json verisini aldığınz url sadece json mu sağlıyor. Yani şunu demek istiyorum bir url var ve taryıcıdan açtığınızda raw json datasını mı görüyorsunuz? Eğer böyleyse Jquery Ajax diye arayın google da. Ayrıca javascript setInterval ya da setTimeOut konularını arayın. Bu js methodlarıyla belirli aralıklarla Jquery Ajax ile json verisin tekrar çekin. Ondan sonra aldığınız veriyi de parse etmeniz gerekiyor. - 06-10-2020, 20:40:28Böyle veri çekiyorum, bu verileri teker teker sadece fiyatları çekiyorum, dğerlerini sabit olarak tablo içerisine kendim yazım yazdım
{"@context":"http:\/\/schema.org","@type":"WebPage","name":"D\u00f6viz Kurlar\u0131","mainEntity":{"@type":"ItemList","name":"D\u00f6viz Kurlar\u0131","itemListElement":[{"@type":"ExchangeRateSpecification","currency":"USD","currentExchangeRate":{"@type":"UnitPriceSpecification","price":7.7912,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"EUR","currentExchangeRate":{"@type":"UnitPriceSpecification","price":9.1758,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"GBP","currentExchangeRate":{"@type":"UnitPriceSpecification","price":10.081,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"CHF","currentExchangeRate":{"@type":"UnitPriceSpecification","price":8.5243,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"CAD","currentExchangeRate":{"@type":"UnitPriceSpecification","price":5.8686,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"RUB","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.0999,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"AED","currentExchangeRate":{"@type":"UnitPriceSpecification","price":2.1219,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"AUD","currentExchangeRate":{"@type":"UnitPriceSpecification","price":5.5648,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"DKK","currentExchangeRate":{"@type":"UnitPriceSpecification","price":1.2328,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"SEK","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.8744,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"NOK","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.8395,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"JPY","currentExchangeRate":{"@type":"UnitPriceSpecification","price":7.3743,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"KWD","currentExchangeRate":{"@type":"UnitPriceSpecification","price":25.52,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"ZAR","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.4697,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"OMR","currentExchangeRate":{"@type":"UnitPriceSpecification","price":20.3081,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"MYR","currentExchangeRate":{"@type":"UnitPriceSpecification","price":1.8784,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"PHP","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.1607,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"QAR","currentExchangeRate":{"@type":"UnitPriceSpecification","price":2.1412,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"SYP","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.0062,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"RSD","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.0781,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"UAH","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.2752,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"TWD","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.2706,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"MDL","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.4659,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"PEN","currentExchangeRate":{"@type":"UnitPriceSpecification","price":2.1725,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"SGD","currentExchangeRate":{"@type":"UnitPriceSpecification","price":5.7267,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"MKD","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.1499,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"UYU","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.1835,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"PKR","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.0475,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"THB","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.2498,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"SAR","currentExchangeRate":{"@type":"UnitPriceSpecification","price":2.0795,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"ILS","currentExchangeRate":{"@type":"UnitPriceSpecification","price":2.2871,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"BHD","currentExchangeRate":{"@type":"UnitPriceSpecification","price":20.8021,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"MXN","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.3607,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"NZD","currentExchangeRate":{"@type":"UnitPriceSpecification","price":5.161,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"IRR","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.0002,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"CSK","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.3402,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"BGN","currentExchangeRate":{"@type":"UnitPriceSpecification","price":4.6904,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"ARS","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.101,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"BRL","currentExchangeRate":{"@type":"UnitPriceSpecification","price":1.399,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"AZN","currentExchangeRate":{"@type":"UnitPriceSpecification","price":4.5873,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"CLP","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.0098,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"RON","currentExchangeRate":{"@type":"UnitPriceSpecification","price":1.8829,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"CRC","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.013,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"HKD","currentExchangeRate":{"@type":"UnitPriceSpecification","price":1.0054,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"BAM","currentExchangeRate":{"@type":"UnitPriceSpecification","price":4.7073,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"ISK","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.0564,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"KZT","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.0182,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"LKR","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.0421,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"DZD","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.0605,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"MAD","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.8424,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"JOD","currentExchangeRate":{"@type":"UnitPriceSpecification","price":10.9868,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"LTL","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.976,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"LYD","currentExchangeRate":{"@type":"UnitPriceSpecification","price":5.7213,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"INR","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.106,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"IDR","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.0005,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"IQD","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.0066,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"CNY","currentExchangeRate":{"@type":"UnitPriceSpecification","price":1.1487,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"HUF","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.0255,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"BYR","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.0002,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"PLN","currentExchangeRate":{"@type":"UnitPriceSpecification","price":2.0497,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"EGP","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.4976,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"ALL","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.0744,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"KRW","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.0067,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"COP","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.002,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"LVL","currentExchangeRate":{"@type":"UnitPriceSpecification","price":5.4364,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"HRK","currentExchangeRate":{"@type":"UnitPriceSpecification","price":1.212,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"LBP","currentExchangeRate":{"@type":"UnitPriceSpecification","price":0.0052,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"GEL","currentExchangeRate":{"@type":"UnitPriceSpecification","price":2.4313,"priceCurrency":"TRY"}},{"@type":"ExchangeRateSpecification","currency":"DVZSP1","currentExchangeRate":{"@type":"UnitPriceSpecification","price":8.2032,"priceCurrency":"TRY"}}]}}