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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The 'self' object is undefined

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello!

I have a page having two frames. At the left, there is a list of customers with a link displaying information on these customers within the frame of right side. At the right side, I can have a page A for information A, a page B for information B, etc. If I work on the page C of customer 1 and that I click on the name of customer 2 of the list, I would like that the link is 'pageC'. If I am in the page B, the link is 'pageB'. I wrote the following script:

function seekactiondetail(){
self.href = parent.frame2.location.href;
};

Here is the code HTML of the link:

<A HREF=&quot;pageA &quot; onClick=&quot;seekactiondetail>Aabed, Abdelaali</A>

But the 'self' object is undefined. Do you know why?

Thank you in advance!
 
self is probably not undefined. I believe that the undefined
part is actually self.href

try this instead: self.location.href jared@aauser.com
 
With 'self.location.href', that gives me the last clicked link. I would like to have the link that I click now.
 
this and self hold two different meanings... self refers to the current window, while this refers to the current object... try this:

<input onChange=&quot;alert(this.value)&quot;> that will show you the value of the textbox...so if you use this in a link, it refers to that link... jared@aauser.com
 
That functions if I put this.href in the function like parameter: < A HREF=&quot;pageA&quot; onClick=&quot;seekactiondetail(this.href)>Aabed, Abdelaali</A> . In the function, that does not function. I must use this.location.href which is the URL of the document.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top