ajax request gets stuck

hi guys,

im pretty new to creating sites using ajax, and i've got an irritating problem.

i have a dropdown box which is dynamically populated from the name field in a mysql table.
when a entry from the dropdown is selected, about 10 text fields get populated with the rest of the information for that person.

my problem is that if a field is missing a value, it sort of gets stuck and just says "loading".

i can attach my code, if needed but off the top of your heads, can you think of a way around this?

thanks
jack
jack-lindsayAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
andrevanzuydamCommented:
Hi Jack

I would start by debugging your AJAX errors with Firefox browser and error console.  It should tell you where your errors are occurring in your script and on which line.

I would like to know which library you are using to implement AJAX and which language your using to code with, most errors are data problems, spaces can cause problems in data you retrieve and needs to be handled accordingly.

Yours sincerely

Andre
0
 
jack-lindsayAuthor Commented:
ok i just tried debugging using firefox error console and on a record i know "gets stuck" it says

Error: xmlDoc.getElementsByTagName("CUSTWWW")[0].childNodes[0] is undefined
Source File: "pathtofile.js"
Line: 38

from what i can tell it doesn't like empty fields.  and it doesn't continue the script if it see's an empty field.

im using php to talk to a mysql database.  and im not using any libraries, im just using snippets of code from help websites and editing them till it works.  i dont think any of my problems are do with spaces as other records have spaces and they appear fine.

thanks
jack
0
 
andrevanzuydamCommented:
Ok, so you need to write some error handling in your Javascript for those empty values.

Could I interest you in taking a look at PHP4SACK, I don't want you to waste your time on it but perhaps this library will help you get up to speed fast and I can help you with any debugging on it.

http://sourceforge.net/projects/php4sack/

Otherwise you're going to have to post up some code so I can see what is happening.
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
jack-lindsayAuthor Commented:
thanks,

i will definitely look into php4sack

i've also attached file files related to the issue.  hopefully you can make sence of my work.  if you have any other recommendation related to my code, im more than happy to receive them


ajax.js
p1.php
getCust.php
0
 
andrevanzuydamCommented:
Thanks, give me a chance to look into your files, meantime see if you can make sense of php4sack, its coded to run javascript in the return AJAX results which is useful in many situations.
0
 
jack-lindsayAuthor Commented:
found the problem in the end.  i put in the code that it could only echo the code if the field wasn't null.  as the field was null the problem occured
0

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 
jack-lindsayAuthor Commented:
.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.