1
I have a link tag as per:
<link rel="stylesheet" type="text/css" media="all" href="../css/screen.css" />
When loading the site, it brings me all the css that is inside this file, but when I go to get this content with jQuery it does not return me anything.
console.log( $('link').html() );
(an empty string)
If I make a call only from the selector the log returns me the element:
console.log( $('link') ); // assim eu obtenho o retorno abaixo
Object[link]
My question is how to get the content of this css with jQuery.
already tried $('link'). val(), $('link'). text() from all Empty
– SneepS NinjA
I believe you have to use AJAX.
.html()
returns nothing because there is no HTML inside the taglink
– Lucas
@Lucas if I use AJAX I would have to fall into PHP p/ resolve, wanted a jQuery solution or at most a pure javascript
– SneepS NinjA
Yes, you need to use Ajax. No, you don’t need to implement anything in PHP. You didn’t implement anything for the browser to get this CSS, because you think Ajax would need, which is exactly the same thing?
– Vinícius Gobbo A. de Oliveira
@Wineusgobboa.deOliveira can give me an example
– SneepS NinjA
@Sneepsninja It couldn’t be clearer than Lucas hehehe...
– Vinícius Gobbo A. de Oliveira