Problem with Ajax call

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
mwalter
Experienced User
Posts: 140
Joined: Wed Sep 14, 2016 2:58 pm
First Name: Mark
Last Name: Walter
Company Name: Paragon Consulting Services
Contact:

Problem with Ajax call

Post by mwalter »

I have a UDF program that accepts an item number. All is working fine until the item number contains a special character like a "/".

The call looks like this:

Code: Select all

var itemSend = encodeURIComponent(item);
	    	ajaxJSON({
	    		url: "http://myIBMI.com:8080/profoundui/universal/trnValidItem",
	    		params: {
	    			orderNumber: order,
	    			itemNumber: itemSend,
	    			location: loc,
	    			batchNumber: batch,
	    			userName: user
	    		},
	    		method: "get",
	    		async: true,
	    		handler: function(ob) {
When I run the code, it's like it's ignoring the call. If I plug the URL from the Developer tools into a browser, it just sits and spins. I can see the encoded value for itemNumber in the URL.

Any Ideas?

Thanks.
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Problem with Ajax call

Post by Scott Klement »

Browsers have debuggers, network monitors, etc built in to assist with debugging applications. I would suggest using these tools to learn a little more about what's failing:

1. Look at the network requests made. Are they being made when you expect? Is the data sent what you expect it to be?

2. Is the JavaScript code crashing? Is there an error message in the console that explains what's wrong?

3. Is the JavaScript not crashing, and the network request being sent properly -- but not getting any response? If so, what is happening on the server-side? Is the UDF program crashing? Are there errors in the job log?

It'd help an awful lot to narrow down what's happening... the more information you provide, the more likely we'll be able to help you.
mwalter
Experienced User
Posts: 140
Joined: Wed Sep 14, 2016 2:58 pm
First Name: Mark
Last Name: Walter
Company Name: Paragon Consulting Services
Contact:

Re: Problem with Ajax call

Post by mwalter »

The issue was on my end. Thanks, Scott.
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests