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 7507713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:32:37+00:00 2026-05-29T22:32:37+00:00

I am just picking up on using jquery and have managed to put the

  • 0

I am just picking up on using jquery and have managed to put the .ajax function into use to retrieve an an html page.

Now, the retrieved html page has a link to a css file and I want to grab that as well so that when the page is loaded, the css will be in the cache as well.

So my question essentially is that is it possible to run another ajax call as the success function and if so, is the config I am thinking of using (see code below) on the right track?

$(window).load(function(){  
    var ourPath;
    $('head link[rel="id_tag"]')
    .each(function() {
        ourPath = $(this).attr('href');
        $.ajax({
            url: ourPath, 
            dataType: 'html',
            ifModified: true,
            success: function (html) {
                var dataURL;
                $(html).find('link[rel="stylesheet"]')
                .each(function() {
                    dataURL = $(this).attr('href');
                    $.ajax({
                        url: dataURL, 
                        dataType: 'text',
                        ifModified: true
                    });
                });
            }
        });
    });
});

I am particularly unsure about the $(html).('head link[rel="stylesheet"]'); and dataURL = $(this).attr('href'); lines (assuming the whole idea is feasible in the first place)

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

    Coming back to update this.

    What actually works reliably is:

    $(window).load(function(){  
        $('head link[rel="id_tag"]')
        .each(function() {
            $.ajax({
                url: this.href, 
                dataType: 'html',
                ifModified: true,
                success: function (html) {
                    $(html).filter('link[rel="stylesheet"]')
                    .each(function() {
                        $.ajax({
                            url: this.href, 
                            dataType: 'text',
                            ifModified: true
                        });
                    });
                }
            });
        });
    });
    

    The key is $(html).filter('link[rel="stylesheet"]') in place of the suggested $(html).find('link[rel="stylesheet"]').

    The input given helped lead to the solution nonetheless.

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

Sidebar

Related Questions

I am using the editArea library and jquery to do what i need... http://www.cdolivet.com/index.php?page=editArea&sess=2b8243f679e0d472397bfa959e1d3841
I'm looking at using AJAX to allow some content within part of a page
Can any one teach me how to use sessions? I have a login page
I'm just picking up Cython. I'm using it to build a core library in
At work we have just started using CodedUI, in our product there are a
This might be a simple question but I'm just picking this up so please
just a quick question: I am a CS undergrad and have only had experience
Just how much slower are events? I have written a streaming XML parser (that
just wondering if anyone knows of a truly restful Put/delete implementation asp.net mvc preview
I'm using jQuery UI 1.8 and I would like to hide the year from

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.