firefox navigates when using <a href="javascript:$('#window').data('kendoWindow').open()

4 posts, 0 answers
  1. Logan
    Logan avatar
    61 posts
    Member since:
    Apr 2013

    Posted 29 Oct 2019 Link to this post

    I have a number of projects that have anchor tags that use code similar to <a href="javascript:$('#window').data('kendoWindow').open()">open</a> to open kendo windows.  I have recently gotten reports that users are getting an error using that link in firefox.  It appears to try to navigate to $('#window').data('kendoWindow').open().

    If i change this to put $('#window').data('kendoWindow').open() into a separate function and call that from the Javascript function it appears to work.  The problem is that i have followed this paradigm in many projects over the year.

    You can see am example at https://dojo.telerik.com/IWAKIjom/2

     
  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    2112 posts

    Posted 31 Oct 2019 Link to this post

    Hello Logan,

    Consider using the following small modification to the js code executed on clicking the anchor:

    <a href="javascript:$('#window').data('kendoWindow').open(); void(0)">broken open</a><br/>
    Here's the modified dojo example.

    Regards,
    Ivan Danchev
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Logan
    Logan avatar
    61 posts
    Member since:
    Apr 2013

    Posted 31 Oct 2019 in reply to Ivan Danchev Link to this post

    Hi Ivan,

    Thanks for getting back to me.  My bigger question is why did it stop working?  Was it a change in kendo or a change in browsers (it still works in chrome) and if it was a kendo change is it something you could change back?

     

    I have this style call across a number of applications and need to know if I need go through all of them and change these style of calls.   I assume I should not only do this with window.open/close but really any kendo call?

  4. Ivan Danchev
    Admin
    Ivan Danchev avatar
    2112 posts

    Posted 04 Nov 2019 Link to this post

    Hi Logan,

    I tested several Kendo UI versions up to R1 2015 and the exhibited behavior was identical, so something with regard to how js code executes in an anchor's href tag must have changed in the latest versions of Firefox, i.e. it is not a change in the Window introduced by us that is behind this.

    The suggested use of void(0) should be applicable to all scenarios when you want to execute some arbitrary code, instead of navigate, on clicking an anchor.

    Regards,
    Ivan Danchev
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top