Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with window.event.srcelement

Status
Not open for further replies.

jgales

Programmer
Mar 7, 2003
14
US
I am having a problem using the href text in the window.event.srcelement item. I can pop up the value via an alert command but am unable to use any string functions against the item.


jgales
 
first of all window.event.srcElement is not the standards compliant way of writing something. event.target is!

Show us some sample code please so I, or someone else, can show you how to create a version that supports both IE and standard compliant browsers. Gary Haran
 
var idiff=0
var s1 = window.event.srcElement;
if (s1.href.indexof("divaimg2")==0)
idiff=721;
else {
var dstart = s1.indexof("20")
ddate = s1.substring(dstart,8);
ddate2 = ddate.substr(5,2) + "/" + ddate.substr(7,2) + "/" + ddate.substr(1,4);
alert(ddate2);
}

What I'm trying to do here is to obtain a substring of the href in order to determine what date the folder is. A date in thormat of yyyymmdd is part of the address. The bottom line is that I want to be able to utilize the address as a string and parse through it.
 
I resolved the problem. You can retrieve the string via window.event.srcelement.href
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top