Can you write within the script the new order of an array as a comment without the script actually using it ? Suppose I have an array of 10 items, then I push and unshift more items in the array, for myself or anyone else viewing the code I want to show the list in the new order, can this be done ?
Siberian
13
Junior Poster
Recommended Answers
Jump to PostWhat like cloning the original array and messing with it while leaving the original intact?
//edit
Ok just re-read
Not sure if I understand. Do you mean like using the console and watching values of variables as you step through a routine?
Jump to PostIt is all unclear, can you please provide a testcase ?
Jump to PostTo concatenate the individual strings together, comma separated :
var list_ = list.join();
Then you can do what you want with
list_
.alert(list_); document.getElementById('myDiv').innerHTML(list_);//pojs $("#myDiv").html(list_);//jQuery
Only use
document.write
in the document writing phase. Once the document has achieved its
Jump to PostTry this:
HTML
<div id="element-to-be-commented"> <div>Some div...</div> <div>Inspect the element underneath this</div> </div>
JS
var commentContainer = document.getElementById("element-to-be-commented"); var data = {name: "gon1387", notAnotherArray: [2,4,1]}; // Convert the object to string through JSON api // then create a comment out of the result …
All 14 Replies
diafol
Troy III
272
Posting Pro
Siberian
13
Junior Poster
Airshow
416
WiFi Lounge Lizard
Team Colleague
gon1387
22
Newbie Poster
Siberian
13
Junior Poster
diafol
Airshow
416
WiFi Lounge Lizard
Team Colleague
diafol
Siberian
13
Junior Poster
diafol
Siberian
13
Junior Poster
Airshow
416
WiFi Lounge Lizard
Team Colleague
diafol
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.