jQuery of course requires everything to be inside
$(document).ready = function() {};
similarly, svg-web requires:
window.onsvgload = function() {};
Is there a correct, elegant way to combine these that doesn’t introduce any problems?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can just bind the functions to run on the appropriate event, like this:
There’s no harm is using both, in fact that’s the appropriate usage, always use the event you need, this is no different from
document.readyvswindow.loadwhen you need images ready, not just the DOM.If it matters,
svgloadhappens afteronloadin the browsers that support it as of the time of this answer, not sure if that’ll be consistent when other browsers support it though.