1

Searched for this thing and tried all of them but i can't seem to make it work.

I want to iframe only a specific part of the website into a forum post, the forum supports html posting. I want to iframe the div: ptContainer from this website doodle.com/5bd7fzirdd3gnbzh to a post here interncup-thc.ucoz.com/forum/5-1-2 The post which seems to be empty actually has this code inside:

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script> $("#ptContainer").load("http://doodle.com/5bd7fzirdd3gnbzh");</script>

But it doesn't work.

Irvin Dominin
  • 30,819
  • 9
  • 77
  • 111
Skan So
  • 153
  • 1
  • 3
  • 15

1 Answers1

0

With that code you are not framing, your are loading. There is a big difference between the two actions.

Iframe:

The HTML Element (or HTML inline frame element) represents a nested browsing context, effectively embedding another HTML page into the current page. Each browsing context has its own session history and active document. The browsing context that contains the embedded content is called the parent browsing context. The top-level browsing context (which has no parent) is typically the browser window.

Ref: https://developer.mozilla.org/en-US/docs/HTML/Element/iframe

jQuery load:

Description: Load data from the server and place the returned HTML into the matched element.

Ref: http://api.jquery.com/load/

The two solution are not related; is important to know what you want to do.

If you want to use iframe you can do a simple html iframe like:

<iframe src="http://doodle.com/5bd7fzirdd3gnbzh" width="300" height="300"></iframe>

Fiddle: http://jsfiddle.net/IrvinDominin/32bDj/

With the use of iframes you have no direct/simple control to the content of the iframed page.

With jQuery load the problem is that you facing is a not allowed Access-Control-Allow-Origin a typical Cross Domain request issue. Check here the solutions: JQuery load content from a remote site

Community
  • 1
  • 1
Irvin Dominin
  • 30,819
  • 9
  • 77
  • 111
  • what i actually want is a way to get that schedule table into my forum with any necessary means. only the table content and nothing else, but i can't seem to find any way to do it – Skan So Apr 21 '13 at 15:09
  • Scrap html from other pages is not usually a good idea; considering that you don't have control of the scraped website you must check out JQL, get the page using it, scrap the resulting page, and extract the div "#pollContainer" (always hoping that doodle not change the rendered HTML ) – Irvin Dominin Apr 21 '13 at 15:37
  • already checked jquery load and couldn't make it work, that's why i'm asking help, i just can't seem to get only the "#ptContainer" on my forum – Skan So Apr 21 '13 at 15:41
  • You CANNOT use jquery load because of Cross Domain Request, try using JQL, read the answer first. – Irvin Dominin Apr 21 '13 at 15:42