[Javascript] !case sensitive

Andrew Dunn adunn at mail.interworx.com.au
Wed Jul 11 21:31:36 CDT 2001


Hi,
    I think you need to read up on string manipulation with javascript,
there is a number of methods and properties of the string object which you
could find useful.

To disable case sensitivity just convert everything to lower case ie:

	function convertString(strVar) {
		var lowerCase = strVar.toLowerCase();
		return lowerCase;
	}

Getting the image name:

	function getImgName(slika) {
		var imgName = slika.substring(slika.lastIndexOf("/"))	//finds the last /
in the string and returns the rest of the string after it
		return imgName;
	}


Andrew


-----Original Message-----
From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]On
Behalf Of Iztok Polanic
Sent: Thursday, 12 July 2001 8:36 AM
To: javascript at LaTech.edu
Subject: [Javascript] !case sensitive


Hi!

1. Because I'm having headaches with JavaScript case-sensitive, I was
wondering
if there's a way how to disable this.

2. I'm trying to get a source name of an image:

var slika = window.document.images[2].src;

but the problem is that now the variable 'slika' contains
'http://tralala.com/tralala/images/image.gif'. But is there a way how to get
just the name of the image (the text that's  in <img src=""> tag)?

TNX!

Bye,

Iztok



_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
http://www.LaTech.edu/mailman/listinfo/javascript





More information about the Javascript mailing list