In web development, JavaScript is often executed when clicking on elements.
In both Internet Explorer 9 and FireFox 4 a little message pops up in the bottom left hand corner with the JavaScript function will be executed by clicking on elements these elements.
ASP.NET makes use of the JavaScript __doPostback(…ugly parameter names..) on almost every element that sends a request to the server. This JavaScript is automatically added to the HTML elements that are generated by the ASP.NET controls and I have no way to circumvent this.
For example, an ASP.NET DropDownList is rendered as an HTML Select element and the __doPostBack() method is added to it so that whenever the user selects a new element, the server can process this action.
The __doPostaback() method is embedded into many of the ASP.NET controls and there is no easy way to change this.
One of my end users commented that this new feature makes it feel as if they are in “Debug-mode”….
So, my question is: how do I either make this popup show something user friendly…or is there a way to tell the browser (via HTML) not to display this nastiness?
Thanks!
-Frinny
Why don’t you make the
hrefof the link a hashtag and attach the actual action via JavaScript:Your location will still be
#footo look nice, but the actual action will be in thefoo.onclickfunction.Alternatively you can specify the event inline (
<a href="foo" onclick="return foo();">Foo</a>), but I try to keep a clear MVC separation with HTML, CSS, & JS.Using a hashtag also gives you the ability to listen for hash-change events or check the hash tag onload so that a user can still middle-click a link and have it work correctly in a new tab.