Calling a javascript function from Amazon S3 -
it's simple context: have simple javascript file called myjs.js in amazon s3 bucket, this:
<script type="text/javascript"> function myfunction() { alert("help my!!"); } </script>
i want call it, django html template hosted in heroku, this:
<html> <head> <title>calling s3's js heroku </title> <script type="text/javascript" src="https://s3-sa-east-1.amazonaws.com/js.mybucket/myjs.js"></script> </head> <body> <input type="button" name="test" value="click me" onclick="myfunction()"> </body> </html>
it doesn't work. way: not mime trouble.
your file shouldn’t contain <script>
tags; it’s javascript, not html. (check browser’s console — tell syntax error is.)
Comments
Post a Comment