This is the code I have written so far.
HTML:
<h1>Test Message</h1>
Default CSS:
h1{
font-size: 24px;
}
Jquery:
$(document).ready(function(req, res){
$.ajax({
url:"example.com/test.css",
type : "GET",
crossDomain: true,
contentType: "text/plain",
dataType:"script",
success:function(data){
$("<style></style>").appendTo("head").html(data);
//loading complete code here
}
}); });
Test.css (uploaded to my domain)
h1 {
font-size: 36px;
}
Now I am trying to fetch test.css from my domain and override its styles with the default one. I can't get ahead of it because it's giving me an error "Unexpected error { " in test.css. Now how do I resolve this error and override the code?