Reviewers: Ray Ryan,

Description:
Description:
The Anchor widget defaults its href to "javascript:" if no href is
specified to prevent a blank page from loading.  However, this causes
FF2 to open the error console with no error message.

Fix:
Changed the href to the correct value "javascript:;".  Notice the ; on
the end to close the javascript expression.

Testing:
Verified this works on all browsers.

Please review this at http://gwt-code-reviews.appspot.com/77804

Affected files:
   user/src/com/google/gwt/user/client/ui/Anchor.java


Index: user/src/com/google/gwt/user/client/ui/Anchor.java
===================================================================
--- user/src/com/google/gwt/user/client/ui/Anchor.java  (revision 6326)
+++ user/src/com/google/gwt/user/client/ui/Anchor.java  (working copy)
@@ -74,13 +74,13 @@
    /**
     * Creates an anchor for scripting.
     *
-   * The anchor's href is set to <code>javascript:</code>, based on the
+   * The anchor's href is set to <code>javascript:;</code>, based on the
     * expectation that listeners will be added to the anchor.
     *
     * @param text the anchor's text
     */
    public Anchor(String text) {
-    this(text, "javascript:");
+    this(text, "javascript:;");
    }

    /**
@@ -93,7 +93,7 @@
     * @param asHtml <code>true</code> to treat the specified text as html
     */
    public Anchor(String text, boolean asHtml) {
-    this(text, asHtml, "javascript:");
+    this(text, asHtml, "javascript:;");
    }

    /**



--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to