Welcome Guest, Not a member yet? Register   Sign In
Expected '/' error in javascript code
#1

[eluser]nandish[/eluser]
Code:
function getYear(school){
    xmlHttp=GetXmlHttpObject();  
    state = $("#state option:selected").text();
    statename = state;
    schname = school;
    if(school == 'Select a School'){
        return false;
    }
    href ='/index.php/cseureport/yearAjaxreq/'+school+'/'+state;
  if (xmlHttp==null){
      alert ("Your browser does not support AJAX!");
      return;
    }
   xmlHttp.onreadystatechange = stateYear;
    xmlHttp.open("POST",href,true);
    xmlHttp.send(null);
}
//----------------------------------------------------------------------------------
function stateYear(){
  if(xmlHttp.readyState == 4){
    if(xmlHttp.status == 200){

    document.getElementById('yeardd')[removed] = xmlHttp.responseText;
    }}
}

//------------------------------------------------------------------------------------------------
function getMyprofile(userName){
    xmlHttp=GetXmlHttpObject();   //Ajax request for userID
    href ='/index.php/cseureport/getuserID/'+userName;
  if (xmlHttp==null){
      alert ("Your browser does not support AJAX!");
      return;
    }
   xmlHttp.onreadystatechange = stateuserID;
    xmlHttp.open("POST",href,true);
    xmlHttp.send(null);
}
//--------------------------------------------------------------------------------------------
function stateuserID(){
  if(xmlHttp.readyState == 4){
    if(xmlHttp.status == 200){
    document.getElementById('usedID').value = xmlHttp.responseText;
    }
    var userID = document.getElementById('usedID').value;
document.location.href = '/index.php/userEdit/'+userID+'/userAdmin/'
    }
}
//-------------------------------------------------------------------------------------------------
function GetXmlHttpObject(){
var xmlHttp=null;
try{
  xmlHttp=new XMLHttpRequest();
  }
catch (e){
  try{
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e){
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}
//--------------------------------------------------------------------------------------------------
function logout(){
    $("#form")[0].action = '/index.php/userLogon';
    $("#form")[0].submit();
}
//---------------------------------------------------------------------------------------------------
$(document).ready(function(){
    $("A.find").mouseover(function(){
        this.title = 'Click here for Edit profile';
    });
});

//--------------------------------------------------------------------------------------------------
function subYear(state,schol,year){  
$.post('/index.php/cseureport/yearAjaxreq/'+schol+'/'+state,function(result){
$('#yeardd').html(result);

});

}
//--------------------------------------------------------------------------------------------------
function subschool(state,schol,year){
    $.post('/index.php/cseureport/schoolAjaxreq/'+state,function(items){
       $('#schooldd').html(items);
       if(items){
          restoreDD(state,schol,year);
       }
        }
       );
}
//----------------------------------------------------------------------------------

Thanx

[Mod edit: Removed [size] and [color] tags and put code inside a [code] block]
#2

[eluser]Crafter[/eluser]
What??!!??
#3

[eluser]Derek Allard[/eluser]
Are you looking for help? Nandish, I would strongly, strongly, strongly encourage you to take the time to try to make your posts more descriptive. Just looking at your postings, nearly all of them are you starting a thread, and here is a sampling of the subject lines:
Quote:Need suggestion
need help
Need Help
need urgent help
need suggestion
Need urgent url suggession
Need experts help
test
sugg!
Need suggession!
Need help on email stuff
Help.
You can probably imagine that these don't exactly let us know what your thread is about.

Here you've posted what seems to be a javascript question in the "Code and Application Development" forum, and then its just a big dumping of code, no explanation, no telling us what you're after, no error message, no context, nothing.

If you want to start reducing your code and find out what line the error is coming from, you may find it easier for us to help out.

Thanks!
#4

[eluser]Nick Husher[/eluser]
Why are you rolling your own AJAX layer when you're using either prototype or jQuery, both of which have their own (excellent) AJAX layers built-in?




Theme © iAndrew 2016 - Forum software by © MyBB