Click here to Skip to main content
15,899,679 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Populating Input Fields Using Button UIs Pin
ASPnoob9-Feb-14 18:57
ASPnoob9-Feb-14 18:57 
Questionjava script project - algebric expressions Pin
chgovind2-Feb-14 0:22
chgovind2-Feb-14 0:22 
AnswerRe: java script project - algebric expressions Pin
Richard MacCutchan2-Feb-14 1:38
mveRichard MacCutchan2-Feb-14 1:38 
QuestionFailed to load resource: the server responded with a status of 405 (Method Not Allowed) Pin
Vimalsoft(Pty) Ltd30-Jan-14 8:25
professionalVimalsoft(Pty) Ltd30-Jan-14 8:25 
AnswerRe: Failed to load resource: the server responded with a status of 405 (Method Not Allowed) Pin
Kornfeld Eliyahu Peter2-Feb-14 1:30
professionalKornfeld Eliyahu Peter2-Feb-14 1:30 
AnswerRe: Failed to load resource: the server responded with a status of 405 (Method Not Allowed) Pin
swatishri20-Aug-20 15:19
swatishri20-Aug-20 15:19 
GeneralRe: Failed to load resource: the server responded with a status of 405 (Method Not Allowed) Pin
Vimalsoft(Pty) Ltd20-Aug-20 23:53
professionalVimalsoft(Pty) Ltd20-Aug-20 23:53 
QuestionNo 'Access-Control-Allow-Origin' header is present on the requested resource Pin
Vimalsoft(Pty) Ltd30-Jan-14 1:42
professionalVimalsoft(Pty) Ltd30-Jan-14 1:42 
Good Day

i have a web api that i want to call on the client side and return its contents, so it s a post and i return some string. Now i have a form that will have the data to be posted as depicted below

HTML
<form name="registrationForm"    method="post">


and there are other controls within the form and i have a button that triggers the post as depicted below


HTML
< <input title="Register"  onclick="ProcessRegistration();" style="width: 100px; height: 100px; align-self: center" type="submit" name="submit_fourth" id="submit1" value="register" />


onCick i call a function from the client side, the definition of the function is


function ProcessRegistration()
      {

          $.getJSON("http://www.mydomain.maindomain.com/api/Registration/Create", function (data) {

              alert(data);
          });


      }


now when i click the button to fire the service i get the following error in the console


 XMLHttpRequest cannot load http://www.mydomain.maindomain.com/api/Registration/Create. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:46506' is therefore not allowed access. 


Does anyone know how to solve this ?

Thanks
Vuyiswa Maseko,

Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.

C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com

AnswerRe: No 'Access-Control-Allow-Origin' header is present on the requested resource Pin
Kornfeld Eliyahu Peter2-Feb-14 1:29
professionalKornfeld Eliyahu Peter2-Feb-14 1:29 
AnswerRe: No 'Access-Control-Allow-Origin' header is present on the requested resource Pin
Doug Twyman3-Feb-14 18:28
Doug Twyman3-Feb-14 18:28 
GeneralRe: No 'Access-Control-Allow-Origin' header is present on the requested resource Pin
Vimalsoft(Pty) Ltd3-Feb-14 19:00
professionalVimalsoft(Pty) Ltd3-Feb-14 19:00 
AnswerRe: No 'Access-Control-Allow-Origin' header is present on the requested resource Pin
Abhishek_RK2-Mar-14 20:57
Abhishek_RK2-Mar-14 20:57 
QuestionLearning jQuery Pin
DRAYKKO27-Jan-14 7:06
professionalDRAYKKO27-Jan-14 7:06 
AnswerRe: Learning jQuery Pin
Richard Deeming27-Jan-14 7:34
mveRichard Deeming27-Jan-14 7:34 
GeneralRe: Learning jQuery Pin
DRAYKKO27-Jan-14 7:50
professionalDRAYKKO27-Jan-14 7:50 
GeneralRe: Learning jQuery Pin
Richard Deeming27-Jan-14 10:05
mveRichard Deeming27-Jan-14 10:05 
AnswerRe: Learning jQuery Pin
Graham Breach27-Jan-14 9:44
Graham Breach27-Jan-14 9:44 
QuestionDuplicate File Remover Code Pin
Rahul Michael26-Jan-14 18:10
Rahul Michael26-Jan-14 18:10 
QuestionRe: Duplicate File Remover Code Pin
Richard MacCutchan26-Jan-14 21:53
mveRichard MacCutchan26-Jan-14 21:53 
AnswerRe: Duplicate File Remover Code Pin
Rahul Michael27-Jan-14 6:09
Rahul Michael27-Jan-14 6:09 
GeneralRe: Duplicate File Remover Code Pin
Richard MacCutchan27-Jan-14 6:35
mveRichard MacCutchan27-Jan-14 6:35 
GeneralRe: Duplicate File Remover Code Pin
Thomas Daniels27-Jan-14 6:26
mentorThomas Daniels27-Jan-14 6:26 
QuestionAnyone can help me? Pin
ArjanD21-Jan-14 8:44
ArjanD21-Jan-14 8:44 
SuggestionRe: Anyone can help me? Pin
Richard Deeming21-Jan-14 10:15
mveRichard Deeming21-Jan-14 10:15 
QuestionHelp with my statement. Pin
Yhen Caisip18-Jan-14 16:56
Yhen Caisip18-Jan-14 16:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.