How to prescribe a condition on javascript that a page is loaded without using jQuery?
4 answers
Here is a miracle Crossbrowser event onDOMContentLoaded or onReady
Connect this script to the page and write onReady(function(){});
|
There is an interesting solution on studioad.
- yes very interesting solution and quite a bit of code, thanks - makregistr
|
If I understand the task correctly, then it’s possible to check whether the jquery page is being used is something like this:
if(!$()) console.log("whithout jquery") else console.log("jquery version - "+$().jquery)
- Wrong.
!$()
- a call to a non-existent function. And in general, you still misunderstood the task. - Qwertiy ♦
|
Put the JS code at the bottom of the page. Or create a handler for <body onload="function();">
Where is the function, this is the output of your message
|