iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > JavaScript

Closed Thread
 
LinkBack Thread Tools
Old March 23rd, 2009, 01:06 PM   #1
User of Users
SuperMember
 
TheSealPortalTeam's Avatar
 

Join Date: May 2007
Location: Buffalo
Posts: 344
Blog Entries: 16
Thanks: 33
Thanked 1 Time in 1 Post
Rep Altering Power: 0 TheSealPortalTeam is on a distinguished road
Exclamation Having problem with Ajax

I have a site that I have been working on recently. I am making a series of widgets for users of this site to add to his/her own site.

The problem I am having is getting my generated code to return any proper value. The error I get in Aptana is: Exception: Guest is not defined File: http://egtworlds.com/!dev/widget/wid...=user-get-name Line: 1 Column: 0


Here is the file and code
http://egtworlds.com/!dev/widget/widgetcode.php?webid=1&type=user-get-name

That generated something like this:
Code:
   
           var http_request991001 = false;
           var elementName991001 = elementName991001;

           document.write("<span name='elementName991001' id='elementName991001' class='egtWorldsWidget'></span>");

           function makeRequest991001(url, parameters) {
              http_request991001 = false;
              
        if (window.XMLHttpRequest) { // Mozilla, Safari,...

                http_request991001 = new XMLHttpRequest();

                     if (http_request991001.overrideMimeType) {
                         
                     // set type accordingly to anticipated content type
                        //http_request991001.overrideMimeType('text/xml');
                           http_request991001.overrideMimeType('text/html');
                     }

              } else if (window.ActiveXObject) { // IE

             try {
                    
            http_request991001 = new ActiveXObject("Msxml2.XMLHTTP");
         
        } catch (e) {
            
            try {
                
                   http_request991001 = new ActiveXObject("Microsoft.XMLHTTP");

                    } catch (e) {}

             }
          }
     
        if (!http_request991001) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      http_request991001.onreadystatechange = alertContents991001;
      http_request991001.open('GET', url + parameters, true);
      http_request991001.send(null);
   }

   function alertContents991001() {
      if (http_request991001.readyState == 4) {
         if (http_request991001.status == 200) {
            //alert(http_request991001.responseText);
            result991001 = http_request991001.responseText;
        //alert(result991001);
            document.getElementById(elementName991001).innerHTML = result991001;            
         } else {
            alert('There was a problem with the request.' + http_request991001.status );
         }
      }
   }
    makeRequest991001('widget.php','?webid=1&type=user-get-name');
document.write('widget.php' + '?webid=1&type=user-get-name');
When you run the ajax call you should get "Guest (Log In)", (or the user name of the person who is logged in at the main site).

Please help me get this working, thanks in advance.
__________________
Thank you for your help on my project,EGT Worlds: The funny thing about web portals.
If you already have an about PM me
, I'll include you in the contributes list.

Last edited by TheSealPortalTeam; March 23rd, 2009 at 01:31 PM..
TheSealPortalTeam is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Old March 24th, 2009, 11:51 AM   #2
User of Users
SuperMember
 
TheSealPortalTeam's Avatar
 

Join Date: May 2007
Location: Buffalo
Posts: 344
Blog Entries: 16
Thanks: 33
Thanked 1 Time in 1 Post
Rep Altering Power: 0 TheSealPortalTeam is on a distinguished road
Re: Having problem with Ajax

This one was simple, Simply pointed to the wrong file.

Sorry for wasting your time. It took all of 4 hours for me to figure that out.
__________________
Thank you for your help on my project,EGT Worlds: The funny thing about web portals.
If you already have an about PM me
, I'll include you in the contributes list.
TheSealPortalTeam is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Bookmarks

Tags
ajax , egt worlds , javascript , php , widgets


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET AJAX and Image problem chandra.nowduri .NET 2 November 14th, 2009 08:07 AM
ajax problem asiyeh PHP 1 April 11th, 2009 11:30 PM
Loading files through AJAX/JS problem utb JavaScript 0 March 19th, 2009 01:18 PM
ajax problem uday JavaScript 0 September 11th, 2008 03:34 AM
problem in IE after asynchronous (AJAX) call pesho318i HTML, XHTML and CSS 3 March 21st, 2008 01:17 PM


Search Engine Optimization by vBSEO 3.2.0 RC8