Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7160815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:27:38+00:00 2026-05-28T13:27:38+00:00

I have a script which loads content into a iframe using: document.GetElementById(‘iframeid’).src = ‘site.html’;

  • 0

I have a script which loads content into a iframe using:

document.GetElementById('iframeid').src = 'site.html';

Now, the problem is that I want only a portion of the page loaded. If I could use jQuery I would specify which part by:

$('#iframeid').load(src = 'site.html .classforportion');

However if seems like jQuery .load doesn’t work for iframes.

Is it possible to ‘fool’ the browser into grabbing the contents of a variable or a function for the first case? Or is it possible to create temporary ‘html’-files only for so long that the script would load the right contents into it and pass it to an iframe (hm… seems unlikely…).

A work around solution for this specific case would be removing the first line of the loaded page. Is that possible with javascript or jQuery? Is it possible for this situation involving the iframe?

Thanks, going crazy over this thing! So, any help appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:27:39+00:00Added an answer on May 28, 2026 at 1:27 pm

    Ive never heard of a way of doing this with javascript since you cannot access files outside your own domain with javascript. You can do like this with PHP

    <?php
    function get_content_part($part=null, $website = null) 
    {
    $website = file_get_contents($website);
    $data = str_replace("\n", '', $website);
    echo preg_match("/\<div class\=\"'.$part.'\"\>(.*)<\/div\>/",$data,$match);
    return $match;
    }
    ?>
    

    Maybe integrate this with a javascript Ajax call and you can do it by javascript calls.
    Best regards
    Jonas

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following script: <script type=text/javascript> $(document).ready(function(){ document.write(<script type=\text/javascript\ src=\http://site.com/script.js\><\/script>); }); </script> When
I have Resorts.aspx which loads content from ResortProducts.ascx into a div via Ajax. Resorts.aspx
I have inc/content.php file which contains iframe with src= to my domain. On my
I have a JSP page which loads another jsp page's content which is working
I have a div which has no content. the content is dynamically loaded into
I have the following script that loads a page into a div and not
I already have code which lazy loads scripts on request. My issue now is
I have a script which contacts a few sources and tell them the IP-address
I have a script which logs on to a remote server and tries to
I have a script which will be run interactively by non-technical users. The script

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.