Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-02-2012, 03:37 PM   PM User | #1
sorlaker
Regular Coder

 
Join Date: Dec 2009
Posts: 166
Thanks: 23
Thanked 1 Time in 1 Post
sorlaker has a little shameless behaviour in the past
Getting whole content of iframe.

What wrong in this code?
Code:
<script type="text/javascript" src="jquery.js"></script>
<script>
	$(function (){
		function manda(){
			var text =                      $('#frame').contents().find('p[class=no_boder]').html();
			$('div').html(text);
		}
	});
</script>
i've already tried using this ->
$('#frame').contents().html();

How can i get the content?
sorlaker is offline   Reply With Quote
Old 01-02-2012, 08:35 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,200
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Question: Do the iframe contents come from the SAME DOMAIN as your main page? If not, nothing you can do will get the contents, as cross-domain scripting is not allowed (with a couple of very limited exceptions that only apply if you "own" the code used in both domains).

Oh, and by the by, this is a jQuery question, not strictly JavaScript. I have no idea if your syntax is correct in jQuery. You might want to post in the jQuery forum to get the experts there involved.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:36 PM.


Advertisement
Log in to turn off these ads.