javascript - jQuery .resize event listener in separate file -


I need to isolate my jQuery code from my html page, but when the problem is occurring it's occurrence of event It comes. I have index.html and main.js, where I want to put all the jQuery code.

The event does not seem to trigger from the external JS:

  $ (window) .on ('resize', function () { 
< P> As the html was intended to be used inline on the page but not in the external js file. It is worth noting when the sizing event works that both "load" and "click" events completely exterior js Working file, but not resizing?

Hey guys,
just thought that the same Kiss with problem I would like to know, I used to find the solution to this issue all I had to do was add the HTML script to the async attribute in the tag.

  & lt; script src = "js / main .js" Type = "text / javascript" async & gt; & lt; / script & gt;  

to be loaded in asynchronous form with the rest of this external file page Is set, thus enabling


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -