This is a migrated thread and some comments may be shown as answers.

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

3 Answers 136 Views
Window
This is a migrated thread and some comments may be shown as answers.
Logan
Top achievements
Rank 1
Veteran
Logan asked on 29 Oct 2019, 01:22 PM

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

 

3 Answers, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 31 Oct 2019, 09:04 AM

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.
0
Logan
Top achievements
Rank 1
Veteran
answered on 31 Oct 2019, 11:46 AM

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?

0
Ivan Danchev
Telerik team
answered on 04 Nov 2019, 08:10 AM

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.
Tags
Window
Asked by
Logan
Top achievements
Rank 1
Veteran
Answers by
Ivan Danchev
Telerik team
Logan
Top achievements
Rank 1
Veteran
Share this question
or