Hello,
I'm having som problems with cookies. From a website I found the following two general functions for setting and getting a cookie:
function setCookie(name, value, expires, path, domain, secure) {
var curCookie = name + "=" + escape(value) +
((expires) ? "...
Thanks a lot to Dave & Adam who have patiently tried to help me with my sorting problem, I appreciate it :-)
I don't have time to get into it right now, but I'll take a look at it tomorow evening. Hopefully it will work this time or I'll return with more questions :-)
Thanks
/Peter
I'm terribly sorry, I should have given a better example. I'll try with a more real-world example:
Lets say I want to keep a
"database" of my CD's. I would do it like this:
function Library(band,album,year,genre) {
this.band = band
this.album = album
this.year = year...
Hi Dave and thanks again :-)
This is not exactly what I need. I haven't explained my problem well enough sorry. As I said in my previous posting; I don't know the terminology for all this.
Anyway, what you suggest will sort all entries in say lib.vars[0] alphabetically which is not what I...
Hello Dave, thanks for your reply,
This is not exactly what I want. Your code will sort the entries in lib.vars[i] where "i" is some number. What I need to do is sort lib.vars based on one of the "labels" (I don't know the exect terminology here). For example in my example I...
Hello again,
I have an array defined like this:
function Library(x,y,z,p,q,r) {
this.x = x
this.y = y
this.z = z
this.p = p
this.q = q
this.r = r
}
library = new Array();
library[0] =...
I think I found what the problem is, but am missing a solution. It appears that when calling an array like:
author[sortArray[i]]
where "i" is some number, javascript interprets the number in relation to the alphabet. "a" is 0, "b" is 1 and so on.
If the array...
Hi ChetN,
Thanks for your reply.
using "var dosort=author.sort()" isn't an option for my as I have severel array working together. author[0] is used in connection with title[0], subject[0] etc. So if I rearrange the array I will break the relationships between these arrays.
Any...
Hello,
I want to make a table of authors sorted alphabetically, but the script on my page (se below) is wrong as it sorts the array "author" like this:
author 6
author 8
author 2
author 4
author 1
author 5
author 3
author 7
the html-page looks like this:
Sorry for all the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.