I am working on creating a widget or snippet of a website that can easily be added to another webpage by including a script tag for my JavaScript file hosted on Amazon S3 and a div element where content will be inserted. Even though I have uploaded the CSS and HTML files to Amazon, I encountered errors when trying to reference them in the JavaScript code. Despite making the files public on Amazon, I kept receiving different errors, with the most recent being a 403 forbidden error. If anyone has any suggestions or solutions, please feel free to share!
var css_link = $("<link>", {
rel: "stylesheet",
type: "text/css",
href: "https://s3.amazonaws.com/lawkickstas/lawkick.css"
});
css_link.appendTo('head');
var jsonp_url = "https://s3.amazonaws.com/lawkickstas/lawkick_html.js";
$.ajax({
url: jsonp_url,
dataType: 'jsonp',
success: function(dataWeGotViaJsonp){
console.log(dataWeGotViaJsonp);
}
});