Jump to content

[JS] Updating Object Property


RichardG

Recommended Posts

Hey I'm kinda stuck,

 

I have an array tab objects with the properties .url and .title, what I'm trying to do is to update the properties of each object after a link has been pressed. The tabs .url property controls the URL that is loaded into an iframe and the title is the text on the tab.

 

function tabObject(url, title) {
       this.url = url;
       this.title = title;
}

function tabChange() {
       var url = "http://www.yahoo.com";
       tab[n].url = url;                           // n is the array element
       $('#tabs').attr('src', url);               //#tabs is the iframe ID
}

 

 

<a href="#" onclick="tabChange()">link</a>

 

 

For some reason this isn't updating the iframe.

Visit my Toolscape blog

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.