1

I have a link in my page. It is linked to a div in the same page. It is supposed to open a dialog box. But I am getting an error in the console.

Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.

My code:

 <a href="javascript:void(0);" data-toggle="modal" data-target="#forgot-pop">Forgot password</a>

<div class="modal fade" id="forgot-pop" role="dialog">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="login-wrap">
                    <h3>
                        FORGOT PASSWORD</h3>
  </div>
   </div>
  </div>
  </div>

The dialog does not open, instead I see this error message:

XMLHttpRequest cannot load javascript:void(0);. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.

I have included, jquery & bootstrap. So what could be wrong?

Thanks

santubangalore
  • 796
  • 1
  • 12
  • 25

1 Answers1

1

This seems to happen in Chrome when you add

href="javascript:"

or similar to your a tag. Using a hash in stead works but I really prefer javascript:

(btw the void(0) part isn't needed)

qwertzman
  • 784
  • 1
  • 9
  • 23