Popup div
-
Good day friends! I am working on a site and in this site there is HTML link. On click event of the link am calling JavaScript function which is running fine. but when I specify the href of the link the JS function is discarded.
-
Good day friends! I am working on a site and in this site there is HTML link. On click event of the link am calling JavaScript function which is running fine. but when I specify the href of the link the JS function is discarded.
-
Good day friends! I am working on a site and in this site there is HTML link. On click event of the link am calling JavaScript function which is running fine. but when I specify the href of the link the JS function is discarded.
There might be an exception, check your console for errors. F12 for development tools and then check Console for any messages. Also, use
event.preventDefault()
to stop the browser from navigating away upon click on the link,function onclickhandler() {
event.preventDefault();// rest of the code here.
}This will do what you need.
The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~
-
There might be an exception, check your console for errors. F12 for development tools and then check Console for any messages. Also, use
event.preventDefault()
to stop the browser from navigating away upon click on the link,function onclickhandler() {
event.preventDefault();// rest of the code here.
}This will do what you need.
The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~
thanks for the reply. the link button is Compose. what if person click on Inbox link and from Inbox page click on Compose link? For sure the person will be redirected to Compose page but the popup div appears and disappear after complete load of the page. Any help please.
-
thanks for the reply. the link button is Compose. what if person click on Inbox link and from Inbox page click on Compose link? For sure the person will be redirected to Compose page but the popup div appears and disappear after complete load of the page. Any help please.
Then, in such cases if you only want to dynamically update the content instead of having to manage events, I recommend using Single-page applications. If not, then use my suggestion, that was the answer to disable the browser from navigating to that link itself, you can run the logic as needed.
The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~
-
Good day friends! I am working on a site and in this site there is HTML link. On click event of the link am calling JavaScript function which is running fine. but when I specify the href of the link the JS function is discarded.
How are we supposed to know what is happening without being able to see anything?
There are two kinds of people in the world: those who can extrapolate from incomplete data. There are only 10 types of people in the world, those who understand binary and those who don't.
-
How are we supposed to know what is happening without being able to see anything?
There are two kinds of people in the world: those who can extrapolate from incomplete data. There are only 10 types of people in the world, those who understand binary and those who don't.