0

I'm doing a site that fetches the stock property from a site and show it on my site. But i'm having issue in displaying the it.

Here's the code :

<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
</head>

<iframe id="frame3" src="http://www.stockpart.net" sandbox="allow-forms allow-scripts allow-same-origin " style="visibility : hidden "></iframe>

<script>
$(document).ready ( function(){
   $('#frame3').contents().find('.addClassClose').show();

});
</script>

I'm getting the following errors :

 AD BLOCK NOT DETECTED
pop.js:1 rt():in  true false tabunder 2
pop.js:1 rt():adv.bind  http://serve.popads.net/servePopunder.php?cid=242978
pop.js:1 Uncaught SecurityError: Blocked a frame with origin "http://stockpart.net" from accessing a frame with origin "http://www.example.com". Protocols, domains, and ports must match.

Anyway is there anyway i can fetch information with the other site class/id using jQuery within an iframe?

FreedomPride
  • 1,098
  • 1
  • 7
  • 30
  • **Uncaught SecurityError**: ***Protocols, domains, and ports must match.*** –  Dec 27 '14 at 20:25
  • possible duplicate of [jQuery/JavaScript: accessing contents of an iframe](http://stackoverflow.com/questions/364952/jquery-javascript-accessing-contents-of-an-iframe) – Patrick Evans Dec 27 '14 at 20:26
  • Anyway, *The domain stockpart.com is for sale.* Is that domain the one you want to use? –  Dec 27 '14 at 20:28
  • @JuanRocamonde my bad , it's .net .. We're migrating server that's why I'm sandboxing it. – FreedomPride Dec 27 '14 at 20:31
  • So you should first own the domain and be able to make changes in the server in order to make it allow your incoming iframe requests. –  Dec 27 '14 at 20:32
  • @JuanRocamonde , we're waiting for liquidweb to propogate the DNS . We already own the stockpart.net – FreedomPride Dec 27 '14 at 20:33
  • So why does it say uncaught securityError if the domain hasn't been propagated yet? I can not even load the page... :| –  Dec 27 '14 at 20:35

1 Answers1

-1

I found the answer on the post posted by Patrick Evans with some modifications.

<?php
$homepage = file_get_contents('http://stockpart.net');
echo $homepage;
?>

Then put the iframe on the main page to get the stock information

FreedomPride
  • 1,098
  • 1
  • 7
  • 30
  • Sorry I thought it wasn't you the one answering your own question. My fault –  Dec 27 '14 at 23:11