Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Need help debugging some javascript. Function not getting defined!
Old 05-18-2006, 11:58 PM Need help debugging some javascript. Function not getting defined!
Novice Talker

Posts: 9
Trades: 0
Cant seem to figure out why my getData function is not getting defined.... Please help! This is a .js file so <script></script> tags are not included.


var = xmlobject = false;

if(window.XMLHttpRequest){
xmlobject = new XMLHttpRequest();
}
else if(window.ActiveXObject){
xmlobject = new ActiveXObject("Microsoft.XMLHTTP");
}

/*function displayData(){
var loopCount;
var displayID = document.getElementById('output');

for(loopCount = 0; loopCount < usernames.length; loopCount++){
displayID.usernames[loopCount] = new Option(usernames[loopCount].firstChild.data);
}*/

function getData(whatdata){
var datasource = "search_profiles_now.php?whatdata=" + whatdata;

if(xmlObject){
xmlobject.open("GET", datasource);

xmlobject.onreadystatechange = function()
{
if(xmlobject.readyState == 4){
var xmldoc = xmlobject.responceXML;
usernames = xmldoc.getElementByTagName("username");
displayData();
}
}
xmlobject.send(null);
}
}
twizler is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-19-2006, 12:15 AM Re: Need help debugging some javascript. Function not getting defined!
vangogh's Avatar
Post Impressionist

Posts: 11,147
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Usually when I get that function not found error it has nothing to do with the function itself, but something else above in the code that's wrong. At first I missed it, but I think your problem is your first line of code

var = xmlobject = false;

Don't think you meant to put that first equals sign in there. See if that's causing the problem. As far as I could tell everything else looks fine.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Design, Development, Marketing, and SEO Tutorials |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 05-19-2006, 01:48 AM Re: Need help debugging some javascript. Function not getting defined!
Novice Talker

Posts: 9
Trades: 0
I took out everything above my function and it ran correctly. I just put that var xmlobject inside the if statment and it ran.

Thanks for the idea!
twizler is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Need help debugging some javascript. Function not getting defined!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12789 seconds with 11 queries