Jquery functions in a separate .js file




















Active Oldest Votes. Improve this answer. AlexCheuk AlexCheuk 5, 6 6 gold badges 28 28 silver badges 35 35 bronze badges. This is what i do, see my post further down. Also you have to use it on elements which were already loaded. Haralan Dobrev Haralan Dobrev 7, 2 2 gold badges 44 44 silver badges 63 63 bronze badges. Mohammad Adil Mohammad Adil Hien Vu Hien Vu 45 1 1 silver badge 7 7 bronze badges. Sign up or log in Sign up using Google. In combinedjsfiles.

NOTE: This is a theory, I haven't actually tried it, but I don't see why it wouldn't work, people do the same thing with stylesheets :. The way I manage javascript libraries is to have separate files on the server that are split up in logical sections - then include them into the page by one request.

For example,. Then I'd have a dynamic file that automatically combines all the javascript files into 1 and make it accessible like this;. This could also have the benefit of speeding up page loads because users' browsers will need to make less requests.

In reality, I often have 2 dynamic files. The other is more 'experimental' scripts that are more likely to be modified. That way the bulky file gets cached by users' browsers and doesn't have to be re-downloaded every time I make an update to the scripts that are more likely to be updated. Once the 'experimental' script reaches a stage where it's no longer being updated, it gets put into the bulky file. Leave a comment on guest's reply. Hi, I'm using Firefox 2.

IE 6 exhibits the same problem also. I'm totally stumped. Leave a comment on clowwizarderiol's reply. You need to make sure that jquery. Leave a comment on tlphipps's reply. There has to be some other problem.

Are you absolutely sure that jquery. Any chance the link pointing to jquery. Leave a comment on juha. Ok, I have to examine the specifics of my computer set up. On the second machine, it works. Based on Suni's remarks, I will look at the first machine more closely. I appreciate everyone throwing out ideas for me to examine.

My gut feeling is that this is a caching issue on the browser that is failing. This lesson is about JavaScript call function from another JS file. The circleArea function runs as soon as you click on the input element of the type button.

It calculates the circle area and displays it in the browser. The createElement method creates an element node with a particular name.



0コメント

  • 1000 / 1000