Error occurred while calling the Javascript webservice

When attempting to call a basic web service and pass an email address as a parameter, I encountered an error message stating "Request format is unrecognized for URL unexpectedly ending in '/IsPreUsedEmail'".

Any suggestions on how to resolve this issue?

Thank you.

On the client side:

function CheckEmailAvailability(email) 
{
    var Url = "http://localhost:52476/MyShul/Services/GetData.asmx/IsPreUsedEmail";
    xmlHttp = new XMLHttpRequest();
    xmlHttp.open("GET", Url, false);
    xmlHttp.send('jbjkb@kjbk');
    var xmldoc;
    xmldoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
    xmldoc.loadXML(xmlHttp.responseXML.xml);
    if (xmldoc.parseError.errorCode != 0) {
         alert("DOM Not Loaded")
    }            
    return xmlHttp.responseXML.xml;
 }

On the server side:

[WebMethod]
public bool IsPreUsedEmail(string sEmail) 
{
    return true;
}

Answer №1

modify the link to,

let newLink = "http://localhost:52476/MyShul/Services/GetData.asmx/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="12ab56c8b4ac9fc6fecafcbed6dacbc0fd96dacadbd293cfcdcb">[email protected]</a>";

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Can React components receive props or data when they are inserted into regular HTML code?

I have a project where I need to make updates to an old-fashioned website. The current layout is table-based and coded by hand. My idea to streamline the process is to use React to minimize repetitive coding tasks. Specifically, I want to loop through an a ...

Acquire complete HTML rendering with Python and Selenium WebDriver

I am currently working on creating a web scraper using Python with Selenium webdriver. However, I am facing an issue where I am unable to access the necessary information when retrieving the website's source code through the webdriver. It seems that ...

Using Angular JS services and controllers in separate files may result in errors

Within my angularjs project, I manage the following files: /index.html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-wid ...

While working with Ngrx/effects, an error with code TS2345 occurred. The error message stated that the argument is of type 'Product[]', which cannot be assigned to a parameter of type

When I compile my code, I encounter the following issue (despite not finding any errors in the browser console and the application functioning properly). An error occurs in src/app/services/product.service.ts(15,9): The type 'Observable<Product> ...

Tips for adjusting the div style when resizing the browser

As I work on a script, I encounter an issue where the style of a div should change when it becomes larger due to resizing. Even though I have come up with a solution for this problem, there are still some inconsistencies. Sometimes the width is reported a ...

The page abruptly jumps to the top whenever I display an ID element

Im currently facing an issue with my webpage where everything seems to be functioning properly, except for one problem. When I set a hidden element to be shown, the page suddenly jolts upwards. Although the previously concealed element is successfully disp ...

[VUE Alert]: Rendering Error - "Sorry, there is a type error: object is currently undefined."

<script> const app = new Vue({ el: '#app', data:{ results:{} }, mounted() { axios.get('{{ route('request.data') }}').th ...

Can someone provide guidance on iterating through a nested array in d3 and appending child elements accordingly?

Looking at my JSON data, here is an example of what it contains. var data = [ { animal: 'dog', names: [ 'mark', 'cooper', 'pooch' ] }, { animal: 'cat', names: [ 'mary', 'kitty' ] ]; ...

Encountered a 'node:internal/modules/cjs/loader:1146' error while setting up a React application

Encountering these console errors node:internal/modules/cjs/loader:1146 throw err; ^ Error: Module '../../package.json' not found Require stack: - C:\Users\adity\AppData\Roaming\npm\node_modules\npm\li ...

Tips for getting rid of Next.js' default loading indicator

While working on my project using Next.js, I've noticed that whenever I change the route, a default loading indicator appears in the corner of the screen. https://i.sstatic.net/FVWEU.gif Does anyone know how to remove this default loading indicator ...

My JavaScript array is not working with the stringify function

I am trying to encode my JavaScript array into JSON using stringify. Here is the code: params["margin_left"] = "fd"; params["text"] = "df"; params["margin_to_delete"] = "df"; console.info(params); When I check the output in Chrome console, it shows: [m ...

Unable to loop through using ngFor

I have a component that retrieves data from the back-end and groups it accordingly. Below is the code snippet: getRecruitmentAgencyClientPositions(): void { this._recruitmentAgencyClientsService.getRecruitmentAgencyClientPositions(this.recruitmentAge ...

Best Practices for Retrieving Data with Django - Post Requests

I'm attempting to use Ajax to send a JavaScript array to Django. Here's my code: document.getElementById('input-generate').onclick = () => { // Get the token const csrftoken = document.querySelector('[name=csrfmiddlewar ...

Executing Numerous Post Requests concurrently from a single origin

I am currently working on a project that requires me to utilize a rest API backend server (NodeJs/Typescript) by making multiple simultaneous post requests from my frontend. Although this may seem unusual, it is a specific requirement for the project. Upo ...

Allow React to complete one loop (including setState) before starting another loop

handleSubmit = () => { this.setState({ modalState: false }) this.state.codeToClass.forEach((code, classId, map) => { const cr = _.find(this.state.classRoles, { id: classId }) if (code === cr.classCode) { console.log(&apo ...

Preserving form data using JavaScript exclusively upon submission

Hey there! I'm facing a little issue with a Form that has multiple checkboxes and a piece of JavaScript code designed to save the state of each checkbox when the user hits submit. My problem is that, currently, the checkbox state is being saved even i ...

In React, the ES6 prototype method map failed to render anything on the screen

Is there an issue with my map method implementation? var App = React.createClass({ getInitialState(){ return { items:[1,2,3] } }, renderItem(){ return( this.state.items.map((item,i))=> <li key={i}> { ...

Utilize Object.keys and Object.values to transform a JSON object into a ChartJS representation

I have a unique JSON file structure that I am trying to display in ChartJS. The data looks like this: { "AAPL": [ { "Q1": -26986, "Q2": -168099, "Q3": -137101, "Q4": -5 ...

Retrieve and utilize the dynamically produced values from the application's app.js in a script that is accessed using

In my Express.js Node web app, I generate a string in app.js during initialization: // app.js var mongourl = /* generated based on process.env.VCAP_SERVICES constant */; There is a script that I import into app.js using require(): // app.js var db = req ...

What is the process of invoking a function from a different component in Vue 3?

I attempted to use the $on method and this.$root.$refs.compname_component = this;, but encountered some errors. Please see my code below: formComponent.vue <template> <div v-if="showForm"> create Form </div> </templa ...