Focus Textfield in iframe (Tricky!)
I'd like to set focus to a textfield on my website. There are 2 problems:
- The textfield is located in an external page (on which i have no control over). It's embedded in my page using iframe.
- The textfield has a own random id generated every time the page is loaded.
This is the HTML code of the textfield which i want to focus()
<div class="UIComposer_InputShadow"><textarea placeholder="Discuss this event" onfocus="window.UIComposer && UIComposer.focusInstance("c4d1cd73d90f2f8884818513");" name="status" id="c4d1cd73d90f2f8884818513_input" title="Discuss this event" class="UIComposer_TextArea DOMControl_placeholder">Discuss this event</textarea></div>
Note that "c4d1cd73d90f2f8884818513_input" and c4d1cd73d90f2f888481851开发者_JAVA百科3 are randomly generated values.
It would be so great if anyone could help me out with this,
Thanks so much! ;)
Greetz,
Camillo
Sorry, there is no way you can do this: The Same Origin Policy prevents you from any and all access to that external iframe.
I'm guessing this is for a Facebook plugin. Even if you could do this, I doubt Facebook wants you manipulating elements within their plugin.
精彩评论