Here is my current code snippet:
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
}
}); });
Uploaded test.css (on personal domain)
h1 {
font-size: 36px;
}
I am currently facing an issue while trying to fetch test.css from my domain and overwrite its styles with the default ones. The error message I am receiving is "Unexpected error { " in test.css. How can I troubleshoot this error and successfully replace the existing code?