Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MyAlerts Issue (blocked by CORS policy)
#1
Hi there. After adding new myalerts_headericon template code for my theme Spectral, I received an error code in the console when clicking the alerts header icon:

jquery.js?ver=1820:2 Access to XMLHttpRequest at 'javascript:void(0)' from origin 'https://domain.net' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

When the alerts icon is clicked, the alerts "modal" will open in the footer and I will have to scroll down to view it.

myalerts_headericon:
<a href="javascript:void(0)" class="myalerts open_modal tooltip-s action-link" title="{$lang->myalerts_alerts}" data-selector="#myalerts_alerts_modal" rel="modal:open" onclick="MyBB.popupWindow('/alerts.php?modal=1&amp;ret_link={$myalerts_return_link}', { fadeDuration: 250, zIndex: (typeof modal_zindex !== 'undefined' ? modal_zindex : 9999) }); return false;">
<i class="far fa-fw fa-bell"></i>
<span class="indicator" data-number="{$mybb->user['unreadAlerts']}"></span>
</a>

Any help would be great. I attempted to add https://domain.net/ to the onclick, but it did not seem to help
Reply
#2
See if changing href="javascript:void(0)" to href="{$mybb->settings['bburl']}/alerts.php" helps.
devilshakerz.com/pgp (DF3A 34D9 A627 42E5 BC6A 6750 1F2F B8AA 28FF E1BC) ▪ keybase.io/devilshakerz
Reply
#3
(09-21-2019, 04:55 PM)Devilshakerz Wrote: See if changing href="javascript:void(0)" to href="{$mybb->settings['bburl']}/alerts.php" helps.

Did not work with the modal. Instead I uninstalled MyAlerts, installed a brand new installation of MyAlerts, replaced all files, activated again, and it is working now.

However, it did get rid of the console error, it just did not do the job properly
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)