Is there any way to call function 'before document ready' in Jquery?
Just call your function before the document ready statement.
<script>
thisWillFireImmediately();
$(function() {
thisWillFireOnDocumentReady();
});
</script>
If you simply call a function in the head tag it will execute immediately, before the DOM is even parsed (that's the 'problem' that ready
solves).
<!doctype html>
<html>
<head>
<script>alert(1)</script>
</head>
<body>
</body>
</html>