Google Groups Home
Help | Sign in
Message from discussion how to address to iframe content with jquery ?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
simo  
View profile
 More options Mar 13, 10:21 am
From: simo <simon.geor...@gmail.com>
Date: Thu, 13 Mar 2008 07:21:32 -0700 (PDT)
Local: Thurs, Mar 13 2008 10:21 am
Subject: Re: how to address to iframe content with jquery ?
I noticed it and forgot to remove them!

sorry, and thank you chrismark!

On Mar 13, 4:55 pm, chrismarx <chrism...@gmail.com> wrote:

> should be like the example:

> var oBody = $("#MyIFrame").contents().find("body");

> notice:(no "<" ">")

> On Mar 13, 7:43 am, simo <simon.geor...@gmail.com> wrote:

> > Hi,

> > adapting your script I'm trying to access the content between my
> > Iframe <body> tag but i'm not able to ...

> > here is my code :

> > ------
> > var iBody = $jq("#mce_editor_0").contents().find("<body>");
> > alert('iframe:'+ iBody);
> > alert('iframe:'+ iBody.html());
> > --------

> > alert('iframe:'+ iBody);  displays an object
> > alert('iframe:'+ iBody.html()); displays null

> > Which method should I use? Thanks.

> > On Mar 13, 3:13 pm, "Patrik Nikkanen" <patrik.nikka...@dwm.se> wrote:

> > > Read:http://docs.jquery.com/Traversing/contents

> > > Example:
> > > var oBody = $("#MyIFrame").contents().find("body");
> > > oBody.append('<h1 id="hello">Hello world</h1>');
> > > $('#hello', oBody).bind('click', function () { alert('Why, hello there!')});

> > > ----- Original Message -----
> > > From: "EugeneS" <SEuge...@gmail.com>
> > > To: "jQuery (English)" <jquery-en@googlegroups.com>
> > > Sent: Thursday, March 13, 2008 12:47 AM
> > > Subject: [jQuery] how to address to iframe content with jquery ?

> > > > Hello,

> > > > so lets imagine i have some iframe inside my html page:
> > > > <iframe width="750" scrolling="no" height="255" src="http://
> > > >www.some_url.com/some_page.htm"></iframe>

> > > > how can i work with the loaded content ?

> > > > i was trying something like:
> > > > aa = $('iframe').html();

> > > > $("div > img", $(aa)).each(
> > > > function(){
> > > > if ($(this).parent('div').attr('style'))
> > > > {
> > > > $(this).parent('div').click(function(){
> > > > alert("Hello2");
> > > > });
> > > > }
> > > > });

> > > > to clarify this: i want to add onClick event to some IMG which is
> > > > inside DIV and this DIV inside this url
> > > >http://www.some_url.com/some_page.htm
> > > > which is loaded in IFRAME...

> > > > how can i add some onClick event to some image which is loaded in
> > > > iframe ?

> > > > finally stuck :(

> > > > --


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google