Jump to content

This is kinda wierd


Shadowing

Recommended Posts

Hey guys i came accross a issue that i dont understand the resultsI"m using data() to store a array in

$('div#game_announcements_array').data("announcements",game_announcements_array);

and then im also grabing it

var game_announcements_array = $('div#game_announcements_array').data("announcements"); 

i am grabing from the array using

$('div.game_announcements').html(game_announcements_array[0]);

then im removing the first element in the array

var game_announcements_array = game_announcements_array.shift(); 

for some reason this is updating data() with the new array lol. how is that possible?

Edited by Shadowing
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...