MantisBT - NetSurf
View Issue Details
0002429NetSurfJavascriptpublic2016-02-21 15:412016-03-07 13:37
ReporterChris Young 
Assigned To 
PlatformAmigaOSAmigaOSOS Version4.1
Product Version3.4 
Target VersionFixed in Version 
Fixed in CI build #
Reported in CI build #3421
URL of problem page
Summary0002429: Button onclick does not run
DescriptionA button with the following code does not execute:
<input type="button" onclick="self.location.href='comment_new.php?com_itemid=2359&com_order=0&com_mode=flat'" class="formButton" value="Publish Comment" />
The log is in additional information.
Steps To ReproduceVisit and click on the first "Publish Comment" button (next to "Refresh", not the one right at the bottom of the page)
Additional Information(215.071750) render/html.c:89 fire_dom_event: Dispatching 'click' against 0x4ba7b7a8
(217.888851) render/html.c:89 fire_dom_event: Dispatching 'click' against 0x513495d8
(217.895597) javascript/duktape/dukky.c:815 dukky_generic_event_handler: WOOP WOOP, An event:
(217.903153) javascript/duktape/dukky.c:822 dukky_generic_event_handler: Event's name is click
(217.912093) javascript/duktape/dukky.c:832 dukky_generic_event_handler: Event phase is: at-target (2)
(217.920908) javascript/duktape/dukky.c:85 dukky_create_object: name=NETSURF_DUKTAPE_PROTOTYPE_EVENT nargs=1
(217.928683) javascript/duktape/dukky.c:77 dukky_populate_object: Call the init function
(217.937817) javascript/duktape/dukky.c:106 dukky_create_object: created
(217.945051) javascript/duktape/dukky.c:865 dukky_generic_event_handler: OH NOES! An error running a callback. Meh.
(217.953193) javascript/duktape/dukky.c:876 dukky_generic_event_handler: Uncaught error in JS: TypeError: cannot read property 'location' of undefined
(217.967463) javascript/duktape/dukky.c:878 dukky_generic_event_handler: was at: internal raw uncompiled handler line 1
(217.975447) javascript/duktape/dukky.c:879 dukky_generic_event_handler: Stack trace: TypeError: cannot read property 'location' of undefined
    anon internal raw uncompiled handler:1 preventsyield
TagsNo tags attached.
Attached Files

Dave Higton   
2016-02-21 20:31   
Can you check the URL, please, Chris? I can't find "Refresh" on the page, nor "Publish comment". Same result with Firefox on Ubuntu.
Chris Young   
2016-02-21 21:10   
Hmm, appears that you need to be logged in to see the button. Copying and pasting the input button from my description into a new page should enable the problem to be seen.

It looks like it doesn't like "self.". The code does work in Firefox.

Issue History
2016-02-21 15:41Chris YoungNew Issue
2016-02-21 20:31Dave HigtonNote Added: 0001330
2016-02-21 21:10Chris YoungNote Added: 0001333
2016-03-07 13:37Vincent SandersStatusnew => acknowledged
2016-03-07 13:37Vincent SandersDescription Updatedbug_revision_view_page.php?rev_id=1841#r1841
2016-03-07 13:37Vincent SandersAdditional Information Updatedbug_revision_view_page.php?rev_id=1843#r1843