Ajax Talk - Asynchronous javascript and xml discussion board
 FAQ   Search    Usergroups      Register   Profile   Check your messages   Log in 
Signup now to enjoy a range of free membership advantages !!
Ajax Talk - Moderators Wanted
Ajax Functions not working

 
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> AJAX Help
View previous topic :: View next topic  
Author Message
interpim
New one
New one


Joined: 06 Nov 2008
Posts: 1

PostPosted: Thu Nov 06, 2008 11:07 pm    Post subject: Ajax Functions not working Reply with quote

So, I am fairly new to Ajax, but fairly capable with PHP.

I have created a small app, that works great in Firefox, but is absolutely worthless in Internet Explorer. I have tried a different Request Object Function that checks for browser and it seems to work, but it breaks two of my functions in Firefox and they still don't work in IE.

Here is the page with my original working app in Firefox.
http://interpim.com/vn_emblem

on my local machine I have the version with the updated Request Object function as posted below.

Code:
function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        ro = new XMLHttpRequest();
    }
    return ro;
}

var http = createRequestObject();


The two functions that bomb when i use this are as follows
Code:
function ajaxFunction(){
   z=z+1 ;
   if(z >= 279){
   z = 1;
   }
   document.form.pic_num.value=z;
   http.open('GET', 'ajax.php?pic='+z, true);
   http.send(z);
   http.onreadystatechange=function(){
      if(http.readyState==4){
        document.getElementById('somediv').innerHTML = http.responseText;
      }
   }
}

function pat_color_fwd(){
   col = col + 1;
   if(col >= 4){
   col = 1;
   }
   document.pat_color_form.pat_color_num.value=col;
   http.open('GET', 'pattern.php?pic='+sh +'&col='+col, true);
   http.send(sh,col);
   http.onreadystatechange=function(){
      if(http.readyState==4){
        document.getElementById('pattern').innerHTML = http.responseText;
      }
   }
}

If anyone has any clue to what I am doing wrong please let me know... Honestly the PHP backend is very simple, and all it does is return an image url based on the variable sent by the javascript
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> AJAX Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
 Advertisements
 XML & Copyright Notice 
    


Powered by phpBB © 2001, 2005 phpBB Group

What is according to Wikipedia: Ajax Web2.0 XML E4X


Link to our site:

  


del.icio.us digg spurl wists simpy newsvine blinklist furl blogmarks yahoo! myweb smarking ma.gnolia segnalo reddit fark technorati cosmos


Normal Bookmark


Partner Button Links:
Codecrunch.com: Webmaster Tutorials    One Ajax


Partner Text Links:
quomon | web20log | ajaxmatters | tableless | 456bereastreet | music charts | gift ideas | competitions | free xbox 360 | link trade ?


Credits:
it consultancy & project management lead generation zoekmachine optimalisatie steal these buttons seo expert