I am opening the fb via:
fb.start(URL, "caption:my caption");
In the iframe, I have a click event that should iterate through the text fields on the parent. I am using the following:
$('#finished').click(function () {
parent.fb.$('input[type="text"]').each(function () {
alert(this.id);
});
return false;
});
Is it possible to reference the parent fields in such a manner?
iterating through parent fb objects
Page: 1
Author | Post |
---|---|
#1 Sun Jun 30, 2013 7:18 pm
|
|
Member
Registered: Jan 2011
Posts: 3
|
|
#2 Sun Jun 30, 2013 7:33 pm
|
|
Member
Registered: Jan 2011
Posts: 3
|
Forgot to mention that I am getting the following error in the click function:
Uncaught TypeError: Cannot call method 'each' of null
|
#3 Mon Jul 01, 2013 2:17 am
|
|
Administrator
Registered: Aug 2008
Posts: 3382
|
The Floatbox library and API is not jQuery. Floatbox's fb.$ function is not jQuery's $ function. It does not take a css selector as its argument. It takes an id string. In your use of it, it is returning null because there is no element available that has the requested id of ('input[type="text"]'. Please see the details of Floatbox's API, including fb.$, in the API Reference.
The returned value from a successful fb.$ call is a node element, not an array as is the case with jQuery's $. There is no "each" function attached to that returned node element. Your problems have nothing to do with referencing the parent name-space, but everything to do with using the Floatbox fb.$ function as if it was the jQuery $ function. |
Page: 1