How to start implementing JavaScript on web page?


#1

I have acquired basic javascript fundamentals and now want to implement on web pages but can not understand where and how to start. help me please.


#2

although javascript has functions and methods (like appendChild) its difficult, there are plenty of libraries/frameworks which can help you with it (jquery, reactJS and many more)


#3

I am somewhat familiar with jQuery. Suppose I want to pop up a message when user click a link so can this be done with pure JavaScript without any js library or framework.


#4

yes, this can be done in JS. Jquery just makes it easier


#5

Hi moderator then please help me to understand how to start this types of works with javascript?


#6

not sure that will fit inside a single answer, you will need an eventlistener:

https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener

you will preventDefault:

https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault

to prevent the link from redirecting, so you can display your pop-up. You can use your alert or confirm if you need something simple, if you need something more sophisticated you can google: javascript popup window or javascript modal box

Jquery UI also has dialog, you could draw inspiration from there


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.