cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Javascript - FormData()

Gmachado14
10-Marble

Javascript - FormData()

hi,

I'm trying to send some values in a form to some server. Is this possible?

 

I have:

var xhttp = new XMLHttpRequest();
var form = new FormData();

form.append("temp_sensor", 1);
form.append("hum_sensor", 2);
xttp.open("POST", "127.0.0.1:5000/update_sensor", false);
xttp.send(form);

 

but I got this error:

Async Execution Failed in ServerCom_sendSensorInfo [Execution error in service script [sendSensorInfo] :: ReferenceError: "FormData" is not defined. (sendSensorInfo#1)]

 

Best Regards

 

 

ACCEPTED SOLUTION

Accepted Solutions

Hi, it's version 8. 

 

I already know that I'm doing one thing wrong. I was using localhost server but thingworx isn't in my machine. That's why the connection failed. Sorry!

 

I will fix this, then if I got any problems I comeback here. Sorry once again for taken your time

View solution in original post

2 REPLIES 2
supandey
19-Tanzanite
(To:Gmachado14)

Hi @Gmachado14 which ThingWorx version are you working with? Additionally, could you have the logging subsystem in the stack strace mode by navigating to System > Subsystems > LoggingSubsystem > Configuration and check the Enable Stack Tracing box to enable (server restart not needed).

 

Then reproduce this issue and please share with us the applicationlog, scriptlog & errorlog from ThingWorx.

Hi, it's version 8. 

 

I already know that I'm doing one thing wrong. I was using localhost server but thingworx isn't in my machine. That's why the connection failed. Sorry!

 

I will fix this, then if I got any problems I comeback here. Sorry once again for taken your time

Announcements


Top Tags