troubleshooting Question

Display a section of an iFrame only

Avatar of jhonc66
jhonc66Flag for Australia asked on
HTMLJavaScript
6 Comments1 Solution794 ViewsLast Modified:
Hi, I am using the following code in order to display and parse a search query.

$(document).ready(function () {
  
           
            url = window.location.href;
            var querystring = url.split("?")[1]; //GuessID=123&someother=123
            var targeurl = "http://old.racingnsw.com.au/default.aspx?s=search-wp&" + querystring;
            var $iframe = $('#horse-name-search-iframe');
            if ($iframe.length) {

                $iframe.attr('src', targeurl);
              $('#horse_name_searchid').load('http://old.racingnsw.com.au/default.aspx?s=search-wp #ctl06_Container');

                return false;
            }
            return true;
  
});

but when loaded, it is loading the iframe as a whole giving me a pge within a page.
how can I target only the inside content, so that no footer or header is displayed. i am trying to hide the top through css but that is not ideal, therefore I wought of a javascript solution

<div id="horse_name_searchid" class="horse_name_search1" style="overflow: hidden; height: 703px;">
<iframe id="horse-name-search-iframe" src="http://old.racingnsw.com.au/default.aspx?s=search" style="margin-top: -260px;"  width="100%" height="1000" frameborder="0" ></iframe>
</div>
display-only.png
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros