jquery - Refreshing javascript (.js page) not working as expected -


Every time Javascript is refreshed, a new news ticker is created. I just need to refresh the ticker and display it in the same box, it should not make a new news ticker, otherwise the page will be filled with news stickers

In addition to this, I only end one loop Should set the fresh time after. After the end of a loop, fresh action should be performed.

Is there any other way to refresh it?

This is my code. (Ticker.js)

  $ ('document'). Ready (function init () {var jsonData1 = $ .ajax ({url: "/ restartSpringRestService / rest / color indicator", data type: "json", async: false}). Feedback text; var jsonObj1 = JSON.parse JsonData1); var size = 0; (jsonObj1 in var size card) {size ++;} var i = 1; var data array 1 = new array (size + 1); while (i & lt; size +1) { DataRay 1 [i] = New Array (); // DataAre [i] [1] = (JasonObj [I]. Site IndicatorColor); DataArray 1 [I] [0] = (Jason OOBJ 1 [I]. Buffer High) ; Data Aarere 1 [I] [1] = (JSONBJ1 [I]] BufferMyDium; Data Aarere 1 [I] [2] = (JSO Naobies 1 [i] buffer take); data array 1 [i] [3] = (jesenobj 1 [ii] cpu hi); data array 1 [i] [4] = (jsonogbg 1 [i] cpmmedium); data array 1 [I] [5] = (JSONABJ1 [c] CPUOO); DataArere 1 [I] [6] = (JasonObj 1 [I]. Mori High); Aire 1 [I] [7] = (Jason OBJ1 [Ii]. Memory Medium); DataArere 1 [I] [8] = (JasonObject 1 [Take Memory]; i ++;} Var valBufferHigh = jsonObj1 [1] .bufferHigh; Var Valuu Hu = Jason OBJ 1 [1]. Cpu high; Var Valmemori Hi = Jason Obje 1 [1]. Memory high; Warning ("Welbuffer Haightes" + Walphur High + "::::: + + + Walku High +" ::::::::: "+ Walmomori High); var url =" http: // LocalHost: 8080 / Restart Display Service / rest / meet allocititectural param "; var i = 1; $ .getJSON (url, function (data) {$ .eeec (data, function (i, item) {warning (" hiii "+" ::: :::: "+ Item.Buffarcount +" :::: ::: "+ item.cpu +" ::::: "+ item.memory); var msg =" "; if (item.battercount> Gt; valBufferHigh || item.cpu & gt; valCpuHigh || item.memory & lt; li & gt; "+" Site Name: & lt; a & gt; "+ item.siteName +" & lt; / a & Lt; / li & Gt; ";; ;;;;;;;;;;;;;;;;;;;; 07 ;;;;;;;;;;;;;;;;;;;;;;; r ;;;;;;;;;;;;;;;;;;;;;;;;o ;;;2 ;;;;;;;;;; fr; (" ::::::::: + msg); & Gt; valBufferHigh) {msg = msg + "
  • " Buffer number: valCpuHigh) {msg = msg +" & lt; Li & gt; "+" "+" cpu: buffer count + "& lt; / a & gt; & lt; / li & gt; & lt; a & gt;" + item.cpu + "& lt; / a & Gt; & lt; / li & gt; ";} If (Item case> ValMemoryHigh) {msg = msg +"
  • "+" "+" Memory: & lt; A & gt; "+ Item. Memory +" & lt; / A & gt; & Lt; / Li & gt; ";} Warning (msg); $ (" # News ul "). HTML (msg) .liScroll ();} // $ (" # News ul "). Html (" & lt; li "+" Site Name: & lt; a & gt; "+ item.siteName +" & lt; / a & gt; & lt; / li & gt; "html ((& lt; li & Gt; "Buffer Count: " + "Memory:

  • Comments

    Popular posts from this blog

    Member with no value in F# -

    java - Joda Time Interval Not returning what I expect -

    c# - Showing a SelectedItem's Property -