Mozilla Firefox doesn't load SVG objects in addEventListener('load'
Primarily you need to decide use jquery or not and do not mix jquery-code with native javascript-code.
Javascript version:
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<object data="http://gbip.ru/poselki/genplan/5/full/gp.svg" type="image/svg+xml" id="obj"></object>
<script type="text/javascript">
window.addEventListener('DOMContentLoaded', function() {
var obj = document.getElementById('obj');
obj.addEventListener('load', function(){
console.log('loaded');
});
});
</script>
</body>
</html>
Jquery version
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<object data="http://gbip.ru/poselki/genplan/5/full/gp.svg" type="image/svg+xml" id="obj"></object>
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var $obj = $('#obj');
$obj.on('load', function () {
console.log('loaded');
})
});
</script>
</body>
</html>
Ubuntu 14.04.3 LTS, Firefox 40.0.3
I solved it by using:
$('#svg').load('"image/svg+xml"', function () {
alert('svg loaded');
});
It works on Chrome, Firefox and IE9+.