JavaScript eshte gjuha me e perdorur sa i perket client-side tek webfaqet. JavaScript tani eshte gjuha me e preferuar pasi qe edhe librarite e saj jane shume te pasura dhe te logjikshme per te punuar.
JavaScript është një gjuhë programimi e bazuar në prototip,dinamike me funksione e klasit parë.
JavaScript është i influencuar nga disa gjuhë të tjera dhe u projektua për t'i ngjare gjuhes Java por për të qënë i thjeshtë për të përdorur edhe për ata që nuk janë programues.
Js eshte e njohur per krijimin e web-sites, por perdoret edhe per te mundesuar qasjen e script-eve te objektet e nderfutura ne programe te tjera.JavaScript punon së bashku me HTML dhe CSS për krijimin e websiteve ndëraktive dhe tërheqëse.
Në web-site javascript punon brenda web browser-it.
Ja disa shembuj se për çfarë mund të përdoret JavaScript:
- Për të shfaqur informacion në bazë të datës së ditës
- Dedektimin e browser-it të përdoruesit
- Validimin e të dhënave të formave -
Krijimin e cookie-ve
- Ndryshimin dinamik të përmbajtjeve të faqeve web
- dhe shumë më tepër!
Me JavaScript munde te punojme brenda file te HTML me ane te tagjeve <script></script> qe munde te shenohen mbrenda tagjeve <head></head> ose atyre <bode></body>, por me e pershtatshme eshte te punohet me file te jashtme, pra duke krijuar nje file te posaqem psh: main.js dhe ta lidhim ate me html permes tagjeve <script src="main.js"></script>. Tagjet script eshte e preferuar te shenohen ne fund te tagut <body></body> per arsye qe loading i web-site behet me shpejt dhe qe kodet e HTML dhe CSS te behen loading para atyre te JavaScript.
Perparsite dhe mangesite e JS (english):
Perparsite dhe mangesite e JS (english):
Pros:
- Client-side JavaScript is very fast. It runs immediately within the web browser as there is no compilation requirement
- Gives a richer interface to a website
- Highly versatile
- It is the programming language of the web
- Reduced website server demand by virtue of being client-side
- Regular updates via the ECMA specification
- Several add-ons, such as Greasemonkey, for extending the functionality
- Simplistic implementation
- Plenty of resources and a mammoth community support
- Used for building a diverse range of applications
- Works exceptionally well with other programming languages
Cons:
- Absence of copy or equivalent method
- Allows only single inheritance
- As the code executes on the user machine, many people choose to disable JavaScript due to the fear of being exploited for a malicious intent
- Might be interpreted differently by different browsers
Comments
Post a Comment