0

I have a html file. i am calling a function in some javascript file from the html file. I want to dispatch the event from the js file and want to return the control back. i want to send the control back when i want. Can anyone please help me on how can i handle custom events in html and javascript.

Regards, Daksh

Vishal Arora
  • 543
  • 3
  • 8
  • 19

1 Answers1

0

I don't really understand what you'd like to achieve. Some code would be a help. If you're convinced that you need custom events, you can read about it on MDN.

If you use jQuery check these answers.

Community
  • 1
  • 1
dreame4
  • 749
  • 5
  • 9
  • 1
    This isn't really an answer is it ? Such statements belong as a comment. – Jibi Abraham Oct 30 '12 at 11:50
  • Partially it's an answer. But you're right, it would be more appropriate to add it as a comment. – dreame4 Oct 30 '12 at 12:12
  • basically i want to call some web services in the js class and i want to send control back to the html when the data is created. i am calling the services in js class on click of a button. i want to show some controls in the html when the data is created. for that i want to dispatch an event from the js class and listen it in a function in html – Vishal Arora Oct 30 '12 at 12:19
  • @Daksh Could you write an example on [jsfiddle.net](http://jsfiddle.net/) how you handle click on a button and retrieve data from web service? Defaults, all this operation are asynchronous so the control is always returned to HTML. Maybe I misunderstand you and you'd like to present some information that data is being created and after the data is ready just hide this info and display previous content? – dreame4 Oct 30 '12 at 12:46