What is the purpose of utilizing jQuery for retrieving CSS resources?

Upon reviewing the Chrome Dev Tools screenshot, I am puzzled by the fact that my CSS assets are being fetched by jQuery. The CSS sheet is included in the normal way, using a

<link rel="stylesheet">
tag in the <head> section, while jQuery and jQueryUI are included at the end of the body.

On inspecting line 6128, I encountered the function curCSS, which seems to be utilized by jQueryUI despite being deprecated.

jQuery         v1.11.1
Google Chrome  v39.0.2171.65 (64-bit)

EDIT1:

I would like to clarify that these assets are not actually utilized by jQueryUI, but rather consist of background images and fonts for my content.


EDIT2:

After commenting out jQueryUI and refreshing the page (Ctrl+F5), the assets continue to be loaded by something on line 3580.

**jQuery.js snippet removed for brevity**

Furthermore, when I also comment out jQuery, the assets load as expected.


EDIT3:

To explain why only jQuery + UI were loaded without any other scripts:
I initially included jQuery + UI in my base template, and upon loading another page that did not require jQuery at all, I noticed unusual behavior from jQuery during debugging.

The markup involved was kept minimal:

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Pagetitle</title>

    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"/>

    <link rel="stylesheet" href="css/jquery-ui.min.css"/>
    <link rel="stylesheet" href="css/fonts.css"/>
    <link rel="stylesheet" href="css/style.css"/>
</head>
<body>
    <div style="font-family: ArialNarrowBold">CONTENT</div>

    <script type="text/javascript" src="js/jquery/jquery.js"></script>
    <script type="text/javascript" src="js/jquery/jquery-ui.js"></script>
</body>
</html>

Subsequently, the Chrome dev-tools display the following:

The font ArialNarrowBold is located in fonts.css. Despite having no additional scripting on the page apart from jQuery and jQuery-UI inclusion, jQuery continues to attempt to load it independently even if jquery-ui.min.css is excluded.

Even after relocating the font-loading to a style block, jQuery persists in attempting to fetch it autonomously.

<style type="text/css">
    @font-face {
        font-family: 'ArialNarrowBold';
        src: url('fonts/ArialNarrowBold.eot');
        src: url('fonts/ArialNarrowBold.eot?#iefix') format('embedded-opentype'),
             url('fonts/ArialNarrowBold.woff') format('woff'),
             url('fonts/ArialNarrowBold.ttf') format('truetype');
        font-weight: normal;
        font-style: normal;
    }
</style>

Answer №1

It appears that there may be a regression in Chrome Devtools based on my testing. After checking with both Chrome Canary and Chromium, I was unable to reproduce the issue on either browser. It would be beneficial for you to report this problem: https://support.google.com/chrome/answer/95315?hl=en

Before submitting the bug report, make sure you are using the latest version of Chrome and see if that resolves the issue.

Answer №2

When utilizing jquery to include an image src attribute, I am experiencing the same issue. If you take note of the column labeled "Initiator":

It appears that Chrome tracks in that column the script responsible for initiating the request. Perhaps you are loading some html using jquery that contains embedded css, or any asset not linked with css.

For instance:

$(img).attr('src', 'image.png');

//OR
$(div).load('/load/index.html');

This will result in similar information being displayed on the chrome console.

Answer №3

For optimal performance, attempt accessing the site through Firefox and analyze its behavior. If you encounter any mention of "jQuery", it may signify a critical issue. However, if the message is "nothing", it could indicate a problem specific to Chrome. Remember to document the issue!

Answer №4

Do you have jQuery implemented on your website? It seems necessary if you are loading it.

Make sure to provide all the relevant markup, especially any jQuery code (inline or in script tags).

  • Are you sending AJAX requests? Sometimes responses can cause issues like this.

  • Have you considered using AJAX JSONP?

  • Is Ruby a part of your tech stack?

    • If it is, are you utilizing .js.erb files? I've encountered situations where JavaScript returned from .js.erb files through AJAX calls gets injected directly into the page and executed.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Tips for using Jquery to retrieve HTML from external sources

I have successfully managed to display an internal webpage on my HTML, as shown below: <!doctype html> <html> <head> <script type="text/javascript" src="jquery-1.4.4.js"></script> </head> <body> & ...

Combining strings in a loop using Javascript

I have a loop hash data stored in a variable called rec. var rec = { }; for (var b = 0; b < 2; b++) { rec['id'+b] = b</p> } Next, I have a piece of JavaScript code that creates a template for a table. var template ='<tab ...

Selecting multiple rows in the Telerik MVC Grid is a breeze!

I've searched extensively for a solution to this, but haven't been able to find one. Is there anyone out there who knows if it's possible to select multiple rows at once by holding down the shift or control key instead of using checkboxes? ...

Recurrence of the Chosen Headers

After discovering the new website http://csslint.net, I've started to question my approach to constructing stylesheets. One method I have recently used is as follows: /* Fonts */ h1 { font-size:20px } p { font-size:12px } /* Colors */ h1 { colo ...

In mobile view, the grid text should be positioned on top of the input field

Created a basic grid layout with input fields. Everything looks fine on the PC, but on mobile devices, long text causes the input field to be positioned below the text. However, when the text is short like Lor, it appears next to the input field... I want ...

When the window is fully loaded, JavaScript executes

Can someone help me set up this script to start running when the page loads? I want the vat field to automatically show up if the company name has been entered. Thank you! //--></script> <script type="text/javascript>//-- $('.colorbox ...

What is the best way to integrate JQuery URL in Joomla components?

Can anyone show me how to load a jquery URL in Joomla (Component)? I have a button that, when clicked, will reload the page and use the GET method to display a value from a variable. JavaScript: jQuery("#btnclickme").click(function(){ jQuery("#divpro").l ...

Get rid of the white border surrounding the object tag

Help needed in removing a thin white border around the object tag. Below is the code snippet and what has been attempted: .hr-ob { background-color: #003262; width: 50px; height: 10px; border: none; outline: none; ...

issue with replicated field

My code is working perfectly fine, as you can see here. Now, I am attempting to replace <input id="input1" /> with <div id="input1"> </div>. You can view my progress here. The issue lies in the IDs - they are meant to change from input1 ...

Rotate Text in HTML <thead> Tag

I need assistance with rotating a table header. https://i.stack.imgur.com/hcvxx.png The HTML th elements within the thead section are described as follows: <th> <span class="rotate-all">Period</span> </th> <th> < ...

Using Jquery to input selected dropdown values into a text input field

Currently, I am facing some challenges in achieving this task. My goal is to have the selected option from a dropdown list called programs_dropdown added to a text field named programs_input, with the option values separated by commas. For example: php, j ...

My lists are not being styled by Embedded and Internal CSS

I want the ingredients list to be styled in green, equipment list in red, and method list in blue using different CSS techniques. My external works fine for changing the color to red, but my internal styles don't seem to apply to the other lists. < ...

The jQuery hide() method conceals an element without affecting its parent

Can't seem to figure out JQuery... So, here's the issue: I've got a page where visitors can enter their email address by clicking on a link inside a div (id="contact"). <div id="contact"><a href="">Interested in leaving your con ...

Utilizing the jQuery plugin 'cookie' to retain the current tab selection on a webpage

Is it possible to provide a detailed explanation on how I can utilize the jQuery Cookie plugin to maintain the selected tab throughout my entire website? Here is the current JavaScript code in JSFiddle format: http://jsfiddle.net/mcgarriers/RXkyC/ Even i ...

Revamp local route variables in Express.js without the need for a page refresh

Currently, I am working on a project using node.js along with the express.js framework and EJS for template handling. Below is my routing code: app.get('/',function(req,res) { res.render('index', { matches: [], status_messag ...

What is the best way to assign a unique hour between 9am and 5pm to each column representing an hour?

Currently, the columns are only displaying 9:00am for visual purposes. for (let i = 0; i < 8; i++) { var row = $('<div class="row">'); var col1 = $('<div class="col-md-2"><p class="hour">9:00AM</p>'); v ...

Using AJAX as a data source for jQuery UI autocomplete

I am currently facing an issue with implementing the jQuery UI autocomplete feature using an Ajax data source. I have reviewed my code but cannot identify the mistake. Below is the code snippet: $(document).ready(function () { var data = new Por ...

Create a custom, adaptive layout using Bootstrap that caters to different device types

I have created a website where users can upload a file with an activation code and input it manually. However, I want to restrict the file upload functionality on smartphones and tablets. Here is how I am attempting to do this: <!DOCTYPE html> &l ...

The v-bind class feature is failing to update the CSS on the object's properties

I'm attempting to dynamically modify the CSS of certain buttons based on object properties within a list. Below is the data I am rendering out, and despite following the documentation and ensuring my setup is correct, I seem to be overlooking somethin ...

Maintaining the size and proportions of an object as it

I'm currently learning the ins and outs of HTML/CSS while working on a navigation bar. However, I've run into an issue with scaling. Here is the website in full-screen mode.https://i.sstatic.net/kCFqn.png Here is the website when it's sligh ...