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

  • Home
  • SEARCH
  • 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 262925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:33:31+00:00 2026-05-11T22:33:31+00:00

I’m working on a project where the client wants to have existing pages dynamically

  • 0

I’m working on a project where the client wants to have existing pages dynamically loaded into a single page. That’s no problem, but the styling is not working as it should when the pages are loaded as standalone files on the existing site. Is there a way to extract the CSS link from each page and have it dynamically applied to the viewer page?

Here’s a copy of the function I wrote out to call the external pages into the viewer page:

$(function () {
    $('a.dock-item2').click(function () { // click on an anchor with the dock-item2 class
        $("#page").remove();             // remove what's in the viewer already
        var href = $(this).attr('href'); // grab the external file path and name
        $('<div id="page" />').load(href, function () { // create a new div and load 
            // the page content
            $(this).hide()               // just stuff to make a nice transition...
                .appendTo('#viewer')
                .fadeIn(1000);
        });
        return false;
    })
});

I’d like to apply it strictly to the div in question… but maybe that isn’t the best thing to do. Should I consider loading this stuff into an iframe instead? Maybe it’s just Friday and I can’t think rationally anymore.

  • 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-11T22:33:32+00:00Added an answer on May 11, 2026 at 10:33 pm

    Getting non-body tags (tags that do not exist within the body) from remote pages is difficult/impossible with jQuery’s ajax features. That being said, if this is the case you can setup a PHP script locally to act as the middle man. It can read the contents of the page, find the css file, and then return that or even return the contents of the css file itself – you then could dynamically place it on your page. This shouldn’t be too difficult, especially if you use something like phpQuery to grab the <script> tag, or even PHPSimpleHTMLDOMParser, which is similar to phpQuery.

    All hypothetical, but it just might work 😉 Of course if you just wanted to load iframes, you could. This would keep all links operable within the iframe.

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

Sidebar

Related Questions

No related questions found

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.