We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

How to count frames with javascript

Horalia Rodriguez
on
Medium Priority
1,633 Views
Last Modified: 2012-05-06
Hi, I work with a tool that uses javascript. One particular form that I'm working with, has several frames, and I need to pass the value of one frame, to another. Problem is, since my company doesn't have access to the "black box" code of the application, and of course, no tutorials are available that would show us the structure of a page, I have to idea how to pass this value. I was hoping of finding out the names of the frames used, I'm using the Form OnAfterLoad event handler. Any ideas?
Comment
Watch Question

I don't really understand the question.  Here's a function that should return frame names within an (x)html frameset.
  function getfnames(){
      var str = '';
      var f = top.frames;
      for(var i = 0; i < f.length; i++){
          str += 'Frame ' + (i + 1) + ', Name: ' + f[i].name + '\n';
      }
      alert(str);
  }

Open in new window

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Horalia RodriguezIT Developer

Author

Commented:
I actually wanted to know how to access all the elements in the frames. I already found out that there are three frames. What I need to know now, are the elements that each frame has so I can figure out which one I need to pass. Let me give you a little more explanation... The web page contains different forms, each form has its own events. I want to use a value contained in frame a in frame b. It's a real pain working with propietary software, you have to hack the system in order to make things work...
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.