Generate JS code or html tag ?
I need to change image every 10 second and i have 2 ways to do this:
1) the first is to create a long JS array and use the innerHTML every times i need to change images.
2) the second is to create a looog HTML code with all images that i need, and always with JS change the position of images content div.
So, what is the best way for the pc performans?
hi, thanks for reaply, but can you explaine me why or link me somethings to read ? i can't find nothing ...
using arrays has many advantages over creating individual html elements. arrays elements are easy to read and change their values, change their order etc...
Yes, i know that. My dubt is another. In wicth memory browsers put this different information ( JS code and HTML page ) ?
I'm sure that JS code and his variables are in heap memory, but html pages where? Using a long array or scroll a long div have difference in prerformance? And this performance can be weighted with a non stop script running? I'm not looking for a easly code, i'm looking for a less expensive code.
i think both of them are stored in heap but in different ways. its not easy to say which one is more or less expensive. depends on many other things. browser can cause major difference
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)