answersLogoWhite

0


Best Answer

If you are using PHP for creating a website, it will turn into a mess if you don't use separate files for CSS & Javascript. It is not that much of a problem as external javascript functions are not that difficult to call from html or php files. The code looks neat and we can differentiate the problem areas more accurately.

The problem obviously resides when you use ASP.NET & call external javascript files. ASP.NET assigns different client side and server side ids for controls. It maybe a good idea there to discard the external coding of javascript if javascript functions are not called

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why should you consider placing javascript in an external file?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can you add Ajax requests in Ajax server page?

If you add javascript to the server page then it is possible. But it would be bad programming practise. Ideally the ajax requests should be on an external javascript file and that should be referenced by a client side page.


How do you set a javascript program as the background of your webpage?

Not sure what you mean by setting the javascript program as the background of your webpage, but if you mean that you want to incorporate some javascript functionality to your webpage like changing the html content when people click on an image or hover over some text, and you have not learned javascript yet, a good place to start is Lynda.com. You should also consider just learning jquery. Jquery is a much easier to learn and simpler to type code that employs the same functionality as javascript and much more. You can also learn how to write jquery on Lynda.com. You will just need to download their library or link to Google's version of it by placing one line of markup in your html document, then you create your javascript document and write your scripts in it.


Which tag is used to implement javascript in an HTML file?

The SCRIPT tag is used to implement a JavaScript (or other kind, i.e. VBScript) in an HTML document. The tag can either contain the actual JavaScript code, or can point to an external script file that should be included at render-time. To add JavaScript directly to the document in HTML 5, place these tags in either the HEAD section or just prior to the BODY sections closing tag. <script type="text/javascript"> //JS code goes here </script> To call an external JavaScript file, use the "src" attribute, like so: <script type="text/javascript" src="path/to/script.js"></script> If you're unsure of where to put the JavaScript tags, see the related answer(s).


What should I consider when placing speaker stands in a round room?

The primary consideration would be to make sure that the speaker sound is pointed primarily towards where the listener will be positioned. Ideally, the listener should be at the center of the room. Also, consider the height of the speakers. They should be at ear level. The acoustics of the room should be the first consideration when placing speakers on stands. You also want to consider the apth the wires must run.


How do you run javascript progamming?

Javascript should run on its own. and when the page is loaded it will automaticly render on its own.


Why does javascript uses prototype instead of classes for inheritance?

Oh,I think you should watch Doglus clockford about in javascript. He said that Javascript isMisunderstood Programming Language.


How do you insert HTML and JavaScript in Blogger post?

To add javascript (google ads) on blogger post you should keep a note of these pointers:1. Open Post and go to HTML view.2. Complete script should be in 1 line. Remove all line Breaks.3. If you are using some onclick or other events then your javascript should be in double quotes.eg. 5xDeals4. If your script is too long, then you can put it somewhere on web and call it on your post.I've used all these tips while placing ads on www.5xdeals.com.. You can check that out...Microk


Bobs friend tells him that he should consider purchasing an external hard drive What is an appropriate reason why someone would use an external hard drive?

It saves hard disk space.


Which programming language should I learn JavaScript or Python?

Javascript is more easier, while Python is more complex. So, maybe you should try Javascript.


What internal and external pricing factors should you consider when raising collage tuition fees?

what is the fees structure of orissa engineering college


How do you create a java script?

Press f12 then go and have a look around the scripting or you can right click and go to inspect element which will probably make it go quickier. Firebug is awesome tool, Here is the javascript trick for you to edit the page displayed. javascript:document.body.contentEditable='true'; document.designMode='on'; void 0 just copy and paste this script to your Url box and press enter. Now edit anything you want.


Where can I get JavaScript books?

Hi, I can give you an blog address where it has pointed out 8 best javascript books you can buy. Its here springpeople.com/blog/8-books-every-javascript-developer-should-read/ Hope it helps you.