What instruction should I use so this function is executed once the page loads instead of on click? I tried:
window.onload=function () {
("#geocomplete").trigger("geocode");
but the code above didn't work.
<script>
$(function () {
$("#variables").variables({
map: ".map_canvas",
details: "form",
types: ["calculations", "grades"]
});
$("#submit_button").click(function () {
$("#variables").trigger("calculations");
});
});
</script>
variables()
plugin that you're using?<script>
tag) should fire when the document is done loading due to you having$(function() {...})
, as per jQuery's.ready()
docs (api.jquery.com/ready). Assuming$
is jQuery at least...