Timeline for javascript function call through href?
Current License: CC BY-SA 3.0
16 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 8, 2015 at 16:26 | audit | Suggested edits | |||
| Jul 8, 2015 at 16:27 | |||||
| Jun 23, 2015 at 15:33 | vote | accept | javasundaram | ||
| Jun 23, 2015 at 15:33 | vote | accept | javasundaram | ||
| Jun 23, 2015 at 15:33 | |||||
| Jun 12, 2015 at 10:11 | vote | accept | javasundaram | ||
| Jun 23, 2015 at 15:33 | |||||
| Jun 12, 2015 at 10:10 | answer | added | javasundaram | timeline score: 0 | |
| Jun 12, 2015 at 9:35 | comment | added | Quentin | @Niko — No. It makes it more complicated. Should be a button rather than a link too. | |
| Jun 12, 2015 at 9:34 | comment | added | asontu |
@Quentin if it's a huge chunk of HTML I wouldn't advise using createElement. I agree that addEventListener would be a better option though, OP could get the best of both by giving the clickable elements an id="some_button_id" and then document.getElementById('some_button_id').addEventListener(...)
|
|
| Jun 12, 2015 at 9:28 | answer | added | asontu | timeline score: 2 | |
| Jun 12, 2015 at 9:28 | comment | added | Niko | I'm just being curious : is there an advantage of doing this in href instead of onclick event ? | |
| Jun 12, 2015 at 9:23 | comment | added | Quentin |
Mashing together strings in JavaScript to make HTML with JavaScript inside it is a recipe for a headache. Don't do that. Use DOM. Use createElement. Use createTextNode. Use appendChild. Use addEventListener. Your code will be more verbose but infinitely easier to understand, debug and maintain.
|
|
| Jun 12, 2015 at 9:19 | history | edited | Pete | CC BY-SA 3.0 |
added 2 characters in body
|
| Jun 12, 2015 at 8:05 | review | Help and improvement | |||
| Jun 12, 2015 at 9:19 | |||||
| Jun 12, 2015 at 8:03 | answer | added | guhur | timeline score: 1 | |
| Jun 12, 2015 at 8:01 | comment | added | Nitish | how are you passing arguments? | |
| S Jun 12, 2015 at 7:53 | review | Triage | |||
| Jun 12, 2015 at 8:03 | |||||
| S Jun 12, 2015 at 7:53 | history | asked | javasundaram | CC BY-SA 3.0 |